2021-06-21 01:39 AM
Hi,
i have a simple question: how do i have to configurate the clock of my STM32F072RB to send or receive CAN-Messages with 500kBit/s. With 8MHz it seems to work only until 250kBit/s.
Best regards
2021-06-21 01:51 AM
Show us some pictures.
>With 8MHz it seems to work
You meant youre using an external HSE Xtal of 8Mhz as your clock source?
2021-06-21 01:59 AM
Hi,
thx for the fast answer. Im using the internal clock (HSI). I want to receive a CAN-signal simulated by a PCAN. Im changing the Parameters as i have (prescaler, Timesegments etc.). The same in the PCAN-configuration. It is working until a Baudrate of 250kBits/s. With 500kBits/s im not getting a signal.
2021-06-21 02:59 AM
@NDorn.1 The internal 8Mhz clock is not accurate enough for fast comms (fast canbus or usb), try the HSI48 as source clock, it would work better if accuracy is the problem.
How long is your canbus wire?
DO you have an external XTAL available?
2021-06-21 04:25 AM
ah ok good to know. Im new to setting up a CAN-communikation. I tried the HSI48 now but its still not working. Which output is for the CAN-Bus of them you can see in the clockconfig? I can see I2C, USART or USB for example.
my wire is not even 1m long. That shouldnt be a problem with higher frequencys in my mind.
Because im using a STM32f072RB-Nucleo board i have 2 external oscillators available. That should be the HSE and LSE.
2021-06-21 04:27 AM
Try to use the HSE, if still doesnt work i would try to modify the Time quanta bits to a more even values like 8 and 7