Page 217
C8051F060/1/2/3
A
DVANCD
0x03
Bit Timing Register
0x04
Interrupt Register
0x05
Test Register
0x06
BRP Extension Register
Advanced
Information
Please refer to the Bosch CAN User’s Guide for information on the function and use of the Message Handler
Registers.
18.2.4. CIP-51 MCU Special Function Registers
C8051F06x family peripherals are modified, monitored, and controlled using Special Function Registers (SFR’s).
Most of the CAN Controller registers cannot be accessed
directly
using the SFR’s. Three of the CAN Controller’s
registers may be accessed directly with SFR’s. All other CAN Controller registers are accessed indirectly using three
CIP-51 MCU SFR’s: the CAN Data Registers (CAN0DATH and CAN0DATL) and CAN Address Register
(CAN0ADR). In this way, there are a total of five CAN registers used to configure and run the CAN Controller.
18.2.5. Using CAN0ADR, CAN0DATH, and CANDATL To Access CAN Registers
Each CAN Controller Register has an index number (see Table 18.1 below). The CAN register address space is 128
words (256 bytes). A CAN register is accessed via the CAN Data Registers (CAN0DATH and CAN0DATL) when a
CAN register’s index number is placed into the CAN Address Register (CAN0ADR). For example, if the Bit Timing
Register is to be configured with a new value, CAN0ADR is loaded with 0x03. The low byte of the desired value is
accessed using CAN0DATL and the high byte of the bit timing register is accessed using CAN0DATH. CAN0DATL
is bit addressable for convenience. To load the value 0x2304 into the Bit Timing Register:
CAN0ADR = 0x03;
CAN0DATH = 0x23;
CAN0DATL = 0x04;
// Load Bit Timing Register’s index (Table 18.1)
// Move the upper byte into data reg high byte
// Move the lower byte into data reg low byte
Note: CAN0CN, CAN0STA, and CAN0TST may be accessed either by using the index method, or by direct access
with the CIP-51 MCU SFR’s. CAN0CN is located at SFR location 0xF8/SFR page 1 (Figure 18.6), CAN0TST at
0xDB/SFR page 1 (Figure 18.7), and CAN0STA at 0xC0/SFR page 1 (Figure 18.8).
18.2.6. CAN0ADR Autoincrement Feature
For ease of programming message objects, CAN0ADR features autoincrementing for the index ranges 0x08 to 0x12
(Interface Registers 1) and 0x20 to 0x2A (Interface Registers 2). When the CAN0ADR register has an index in these
ranges,
the CAN0ADR will autoincrement by 1 to point to the next CAN register 16-bit word upon a read/write
of CAN0DATL
. This speeds programming of the frequently programmed interface registers when configuring mes-
sage objects.
NOTE: Table 18.1 below supersedes Figure 5 in section 3, “Programmer’s Model” of the Bosch CAN User’s
Guide.
Table 18.1. CAN Register Index and Reset Values
CAN REGISTER
INDEX
0x00
0x01
0x02
REGISTER NAME
RESET
VALUE
0x0001
0x0000
0x0000
0x2301
0x0000
0x0000
0x0000
NOTES
CAN Control Register
Status Register
Error Register
Accessible in CIP-51 SFR Map
Accessible in CIP-51 SFR Map
Read Only
Write Enabled by CCE Bit in CAN0CN
Read Only
Bit 7 (RX) is determined by CAN bus
Write Enabled by TEST bit in CAN0CN