Skip to main content
NDorn.1
Associate II
Jun 21, 2021 8:39 AM UTC
Question

Clock configuration using CubeIDE

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

This topic has been closed for replies.

5 replies

Javier1
Principal
Jun 21, 2021 8:51 AM UTC

Show us some pictures.

>With 8MHz it seems to work

You meant youre using an external HSE Xtal of 8Mhz as your clock source?

hit me up in https://www.linkedin.com/in/javiermuñoz/
NDorn.1
NDorn.1Author
Associate II
Jun 21, 2021 8:59 AM UTC

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. 0693W00000BbWCHQA3.png0693W00000BbW93QAF.png0693W00000BbWBiQAN.png

Javier1
Principal
Jun 21, 2021 9:59 AM UTC

@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?

hit me up in https://www.linkedin.com/in/javiermuñoz/
NDorn.1
NDorn.1Author
Associate II
Jun 21, 2021 11:25 AM UTC

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.

Javier1
Principal
Jun 21, 2021 11:27 AM UTC

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

hit me up in https://www.linkedin.com/in/javiermuñoz/