cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4: Can bus timing and STM32CubeMX

roberto23
Associate II
Posted on August 23, 2015 at 10:47

Hi guys,

i'm try to understand can bus configuration. I need to know if what is in my mind is correct.

I'm using a STM32F4 discovery with the CAN1 configured on pin PD0 and PD1.

I see on the forum that the CAN frequency is set at 42Mhz with the basic configuration, in fact if i go to check in the clock configuration i see that frequency under the APB1 peripheral clocks is 42 Mhz.

If i go into the CAN1 configuration TAB, i have try to put this data:

Prescaler=16

TQ BS 1 = 14

TQ BS 2 = 6

SJW = 1

I see that the time for one bit is 8000ns what it means? 

from my calculation is: 1000000ns/8000ns = 125 kbps 

Is this correct?
2 REPLIES 2
Posted on August 23, 2015 at 10:58

42,000,000 / (16 * (1 + 14 + 6))

125,000

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
roberto23
Associate II
Posted on August 23, 2015 at 11:04

Thank you clive, very clear