2020-02-27 09:57 AM
2020-02-27 10:00 AM
CAN BIT RATE = (APBCLOCK / PRESCALER) / (SJW + TS1 + TS2)
2020-02-27 10:01 AM
can u explain each terms?
2020-02-27 10:02 AM
at 48 mhz clock frequency,baudrate=50 kbps
2020-02-27 10:17 AM
I'm sure the definitions are in the Reference Manual
SJW, TS1 and TS2 are the bit timing quanta, they have ranges as described in the manual. You sum these together to understand how many clock ticks you will need.
The CAN peripheral is clocked by the APB (Peripheral Bus) to which it is attached. Presumably 48 or 24 MHz depending on the dividers you have selected.
48,000,000 / 50,000 = 960
960 / 60 = 16
If you set the Prescaler to 60, the sum of SJW+TS1+TS2 needs to be 16, find a combination that fits.. Say 1, 7 and 8 ?
2020-02-27 06:46 PM
ok
2020-02-27 06:54 PM
how did you choose 1,7,8?
sjw=1,ts1=7,ts2=8?
2020-02-27 09:56 PM
2020-02-28 12:00 AM
[OT] It's nice how in explanation of a ST's chip you refer to a document to be found at NXP, which refers to "Motorola CAN" in a Freescale chip... ;)
(Sorry for the OT, I couldn't resist. No, no need to explain.)
JW
2020-02-29 03:47 AM
That actually contains CAN SPECIFICATION.
Or do you find a lot of differences compared to the Bosch-spec?