Skip to main content
roberto23
Associate
August 23, 2015
Question

STM32F4: Can bus timing and STM32CubeMX

  • August 23, 2015
  • 2 replies
  • 2007 views
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?
    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    August 23, 2015
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    roberto23
    roberto23Author
    Associate
    August 23, 2015
    Posted on August 23, 2015 at 11:04

    Thank you clive, very clear