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
48
V 1.0, 2004-02
•
If Extended CAN is used, then the "Upper Global Mask Long" and the "Lower Global
Mask Long" have to be initialized according to the identifier bits to be used for
acceptance filtering (application specific). Shall all bits of the 29-bit identifier be
evaluated, then all respective bits of the "Global Mask Short" are set to "1":
C167CR:
UGML = 0xFFFF; /* Upper Global Mask Long (Adr.EF08h) */
/* 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 */
/* 2 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 (Ident.-Bits */
/* 0 9 8 7 6 5 4 3 8 7 6 5 4 3 2 1 13 - 28) */
LGML = 0xF8FF; /* Lower Global Mask Long (Adr.EF0Ah) */
/* 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 */
/* 1 1 1 (Ident.-Bits */
/* 4 3 2 1 0 - - - 2 1 0 9 8 7 6 5 0 - 12) */
C515C:
UGML0 = 0xFF; /*Upper Gl. Mask Long Low (Adr.F708h)*/
UGML1 = 0xFF; /*Upper Gl. Mask Long High (Adr.F709h)*/
/* 1 1 1 1 1 1 1 1 <UGML1 UGML0> 1 1 1 1 1 1 1 1 */
/* 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 */
LGML0 = 0xFF; /*Lower Gl. Mask Long Low (Adr.F70Ah)*/
LGML1 = 0xF8; /*Lower Gl. Mask Long High (Adr.7F0Bh)*/
/* 1 1 1 1 1 0 0 0 <LGML1 LGML0> 1 1 1 1 1 1 1 1 */
/* (Id.-Bits 1 1 1 */
/* 4 3 2 1 0 - - - 0 - 12) 2 1 0 9 8 7 6 5 */
•
If the Basic CAN feature shall be used (message object 15), also the "Upper Mask
of Last Message" and the "Lower Mask of Last Message" have to be initialized
according to the identifier bits to be used for acceptance filtering of message object
15 (application specific). Shall all frames be received in MO 15 that cannot be stored
in any other message object, all bits of the Mask of Last Message have to be set to
0 (= don't care):
C167CR:
UMLM = 0x0000; /* Upper Mask of Last Mess. (Adr.EF0Ch) */
/* 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 */