AP29000
Connecting C166 and C500 Microcontroller to CAN
Ways of handling the SAE 81C90/91 and the CAN Module on the C167CR / C515C
Application Note
51
V 1.0, 2004-02
Example for an Extended CAN receive object with 3 bytes data length:
C167CR / C515C:
MCFG_Mn = 0x34; /*Mess. Configur. Reg. n (EFn6h/F7n6h)*/
/* 0 0 1 1 0 1 0 0 */
/*|<-DLC->| D X - - */
/* I T */
/* R D */
Then the identifier of the message is configured in the Arbitration Registers
corresponding to the chosen CAN protocol. Please mind the identifier bit positions in
these registers:
/* Configure identifier: */
/* (example for Standard CAN (11-bit identifier) */
C167CR:
UAR_Mn = 0xE068; /* Upper Arbitr. Reg. n (Adr. EFn2h) */
/* 1 1 1 0 0 0 0 0 0 1 1 0
1 0 0 0
*/
/* 2 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 (Identifier-Bits */
/* 0 9 8 7 6 5 4 3 8 7 6 5 4 3 2 1 13 - 28 ) */
LAR_Mn = 0x0000; /* Lower Arbitr. Reg. n (Adr. EFn4h) */
/* 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 */
/* 4 3 2 1 0 |res| 1 1 1 9 8 7 6 5 (Identifier-Bits */
/* 2 1 0 0 - 12) */
C515C:
UAR0_Mn = 0x68; /* Upper Arbitr. Reg. n Low (F7n2h) */
UAR1_Mn = 0xE0; /* Upper Arbitr. Reg. n High (F7n3h) */
/* 1 1 1 0 0 0 0 0 <UAR1_Mn UAR0_Mn> 0 1 1 0
1 0 0 0
*/
/* 2 1 1 1 1 1 1 1 (Id.-Bits 2 2 2 2 2 2 2 2 */
/* 0 9 8 7 6 5 4 3 13 - 28) 8 7 6 5 4 3 2 1 */
LAR0_Mn = 0x00; /* Lower Arbitr. Reg. n Low (F7n4h) */
LAR1_Mn = 0x00; /* Lower Arbitr. Reg. n High (F7n5h) */
/* 0 0 0 0 0 0 0 0 <LAR1_Mn LAR0_Mn> 0 0 0 0 0 0 0 0 */