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
46
V 1.0, 2004-02
This means that TSEG1 and TSEG2 should be programmed to the following values:
TSEG1 =
8;
TSEG2 =
5.
General rules for the SJW:
0
≤
SJW
≤
3;
SJW
≤
TSEG2
.
This means that SJW could be programmed to the maximum value of 3. But normally
such a big SJW is only necessary when the clock generation of the different nodes is
quite inaccurate, e.g. if ceramic resonators are used. So a SJW of 1 should be
enough.
With other baudrates and clock frequencies the calculation can be done in the same
way. On request three EXCEL tools (CP_167CR.XLS, CP_81C90.XLS,
CP_C515C.XLS) are available which calculate proposals for the different parameters
from the used frequency and baudrate.
6.4
Ways of Handling the CAN Module
6.4.1
The Initialization of the CAN Module on the C167CR / C515C
•
The initialization starts with setting bits INIT and CCE in the Control Register.
C167CR:
CSR
=
0x0041;
/*
Contr./Stat.Register(Adr.EF00h)
*/
/* 0 0 0 0 0 0 0 0 <STATUS CONTROL> 0 1 0 0 0 0 0 1
*/
/* - - - R T LEC 0 C - - E S I I
*/
/* X X C I I E N
*/
/* O O E E E I
*/
/* K K T
*/
C515C:
CR
=
0x41;
/*
Control Register (Adr. F700h)
*/
/* 0 1 0 0 0 0 0 1 */
/* T C - - E S I I */
/* E C I I E N */
/* S E E E I */
/* T T */