キーワード: can bus, microcontrollers, asynchronous serial, CAN, ds80c400,ds80c390, micro, microcontroller, crystal selection
関連製品 |
The bit rate is determined by the following equation:
Now, we calculate the reload and actual bit rate:
All useful frequencies will have an error of less than 0.005.
Example of unusable crystal for 1Mbps CAN bit rate:
reload = 36.864E6 / (2*1E6) = 18.432
actual bit rate = 36.864E6 / (2*18) = 1024000
error = (1024000 - 1000000) / 1000000 = 0.024
Example of acceptable crystal for 1Mbps CAN bit rate:
reload = 36E6 / (2*1E6) = 18
actual bit rate = 36E6 / (2*18) = 1000000
error = (1000000 - 1000000) / 1000000 = 0.0
(tSEG1 + tSEG2 + tSYNC_SEG) = 18 / BPR
Remembering that tSYNC_SEG is always 1, and choosing 1 for BPR gives:
(tSEG1 + tSEG2) = 17
The designer picks the appropriate TSEG values from this constraint.
The bit rate is determined by the following equations:
All useful frequencies will have an error of less than 0.025.
Example of unusable crystal for 115200 bit/s:
reload = 16E6 / (32 x 115200) = 4.340
actual = 16E6 / (32 x 4) = 125000
error = (125000 - 115200) / 115200 = 0.0851
Example of acceptable crystal for 115200 bit/s:
reload = 18E6 / (32 x 115200) = 4.883
actual = 18E6 / (32 x 5) = 112500
error = (112500 - 115200) / 115200 = 0.0234
Timer 1 in Divide-by-4 Mode
The bit rate is determined by the following equations:
All useful frequencies will have an error of less than 0.025
Example of unusable crystal:
reload = 20E6 / (64 x 115200) = 2.713
actual = 20E6 / (64 x 3) = 104167
error = (104167 - 115200) / 115200 = 0.096
Example of acceptable crystal:
reload = 22E6 / (64 x 115200) = 2.984
actual = 22E6 / (64 x 3) = 114583
error = (114583 - 115200) / 115200 = 0.0054
Timer 1 in Divide-by-12 Mode
All useful frequencies will have an error of less than 0.025
Example of unusable crystal for 115200 bit/s:
reload = 18E6 / (192 x 115200) = 0.814
actual = 18E6 / (192 x 1) = 93750
error = (93750 - 115200) / 115200 = 0.186
Example of acceptable crystal for 115200 bit/s:
reload = 22E6 / (192 x 115200) = 0.995
actual = 22E6 / (192 x 1) = 114583
error = (114583 - 115200) / 115200 = 0.0054
Note: These values assume that the designer is not using the system clock multiplier.
CRYSTAL | CAN ERROR (%) | SERIAL ERROR (%) |
18000000 | 0.00 | 2.34 |
22000000 | 0.00 | 0.54 |
26000000 | 0.00 | 0.76 |
30000000 | 0.00 | 1.73 |
34000000 | 0.00 | 2.48 |
36000000 | 0.00 | 2.34 |
40000000 | 0.00 | 1.36 |
44000000 | 0.00 | 0.54 |
48000000 | 0.00 | 0.16 |
52000000 | 0.00 | 0.76 |
54000000 | 0.00 | 2.34 |
56000000 | 0.00 | 1.27 |
60000000 | 0.00 | 1.73 |
64000000 | 0.00 | 2.12 |
66000000 | 0.00 | 0.54 |
68000000 | 0.00 | 2.48 |
72000000 | 0.00 | 2.34 |