3 baud rate – Rainbow Electronics ATmega64C1 User Manual
Page 175

175
7647A–AVR–02/08
ATmega32/64/M1/C1
The total number of TQ in a bit time has to be programmed at least from 8 to 25.
Figure 16-7. Sample and Transmission Point
Figure 16-8. General Structure of a Bit Period
16.4.3
Baud Rate
With no baud rate prescaler (BRP[5..0]=0) the sampling point comes one time quantum too
early. This leads to a fail according the ISO16845 Test plan. It is necessary to lengthen the
Phase Segment 1 by one time quantum and to shorten the Phase Segment 2 by one time quan-
tum to compensate.
The baud rate selection is made by T
bit
calculation:
Tbit
= Tsyns + Tprs + Tphs1 + Tphs2
1.
Tsyns = 1 x Tscl = (BRP[5..0]+ 1)/clk
IO
(= 1TQ)
2.
Tprs = (1 to 8) x Tscl = (PRS[2..0]+ 1) x Tscl
3.
Tphs1 = (1 to 8) x Tscl = (PHS1[2..0]+ 1) x Tscl
4.
Tphs2 = (1 to 8) x Tscl = (PHS2[2..0]
+ 1) x Tscl
Bit Timing
Sample
Point
Transmission
Point
Prescaler BRP
PRS (3-bit length)
SJW (2-bit length)
PHS1 (3-bit length)
PHS2 (3-bit length)
CLK
IO
Fcan (Tscl)
Time Quantum
Bit Rate Prescaler
CLK
IO
F
CAN
Data
Tscl (TQ)
1
/
CLK
IO
one nominal bit
Tsyns
(5)
Tphs2+Tsjw
(
4
)
Tphs1+Tsjw
(
3
)
Tbit
Tphs2
(
2
)
Tphs1
(
1
)
Tprs
Sample
Point
Transmission
Point
5. Synchronization Segment: SYNS
Tsyns=1
x
Tscl (
fixed
)
Notes: 1. Phase error < 0
2. Phase error > 0
3. Phase error > 0
4. Phase error < 0
or
or