CAN-PCC Software Manual Rev. 1.4
10
5.1.2 CANPC_initialize_chip
By means of this function the bit timing of the CAN controller is defined. The parameters
presc
,
sjw
,
tseg1
and
tseg2
are transferred into the bit-timing register of the CAN controller. The values
of these parameters describe the bit timing of the CAN protocol.
The bitrate is calculated with the following formula, however, further marginal conditions have to be
considered (for this refer to the data sheet of CAN controller 87C592)
f
crystal
Bitrate = ----------------------------------------------
2 * presc * ( 1 + tseg1 + tseg2 )
Clock frequency f
=16 MHz
crystal
Examples for bitrate setting:
Bitrate
[kbit/s]
Index
Controller register Prescaler
Time
Time
Sample
presc
tseg1
tseg2
SAM
Sync
jump with
sjw
segment
segment
mode
1
2
BTR0
BTR1
[HEX]
[HEX]
1000
0
00
14
1
1
5
2
0
666.6
1
00
18
1
1
9
2
0
500
2
00
1C
1
1
13
2
0
333.3
3
01
18
2
1
9
2
0
250
4
01
1C
2
1
13
2
0
166
5
02
1C
3
1
13
2
0
125
6
03
1C
4
1
13
2
0
100
7
43
1C
4
2
16
3
0
66.6
8
45
2F
6
2
16
3
0
50
9
47
1C
8
2
16
3
0
33.3
10
4B
2F
12
2
16
3
0
20
11
53
1C
20
2
16
3
0
12.5
12
5F
2F
32
2
16
3
0
10
13
67
1C
40
2
16
3
0
Table 5.1.1:
Parameters for setting the bitrate
Summary of Contents for CAN - PCC
Page 7: ...CAN PCC Hardware Manual Rev 1 2 2...
Page 15: ...CAN PCC Hardware Manual Rev 1 2 10...
Page 17: ...CAN PCC Hardware Manual Rev 1 2 12...
Page 19: ...CAN PCC Hardware Manual Rev 1 2 14...
Page 23: ...CAN PCC Hardware Manual Rev 1 2 18...
Page 26: ...CAN PCC Hardware Manual Rev 1 2 21 Circuit Diagrams 4 2 Circuit Diagrams...
Page 27: ...CAN PCC Software Manual Rev 1 4 CAN PCC Windows 3 11 API Software Manual...
Page 31: ...CAN PCC Software Manual Rev 1 4 2...