cancel
Showing results for 
Search instead for 
Did you mean: 

Clock configuration using CubeIDE

NDorn.1
Associate II

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

5 REPLIES 5
Javier1
Principal

Show us some pictures.

>With 8MHz it seems to work

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

we dont need to firmware by ourselves, lets talk
NDorn.1
Associate II

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

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

we dont need to firmware by ourselves, lets talk
NDorn.1
Associate II

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.

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

we dont need to firmware by ourselves, lets talk