cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 without Crystal for CAN, I2C and SPI

wbleymueller
Associate
Posted on November 15, 2016 at 11:00

Hello everyone,

I am planing a few Sensors and remote switches which communicate using the CAN Bus. I'd like to use the STM32L433CC MCU because of its easy solderability by hand for prototyping. The boards should be low power, a CPU Frequency of 26 MHz is probably sufficient for the tasks.

My question is now, will the CPU work without external clock source when using CAN, I2C and SPI only? So is the internal RC oscillator enough for such tasks?

Thanks, Willem

#hse #stm32l4 #can #cubemx
4 REPLIES 4
Kraal
Senior III
Posted on November 15, 2016 at 12:35

Hi Willem,

I2C and SPI have both a clock line, so both master and slave are in sync whatever their clock source are (i.e. internal RC oscillator or external crystal).

CAN on the other hand needs a precise clock source to be able to sample the bits at the exact sample point. For this case you will have to look in the device datasheet for the RC frequency tolerances, but I think it will not be good enough, especially with voltage and temperature drift. I would say that if this is a commercial / industrial product, you will have to use an external crystal (at least for CAN).

Posted on December 10, 2016 at 19:44

Check the datasheet for the frequency tolerance using MSI input clock from LSI or LSE. This way, a 32kHz precise clock source is small and probably lower power than MHz crystal on STM32L4

ST Renegade
Senior
Posted on December 10, 2016 at 21:35

I would highly recommend you to use external crystal for the CAN bus. There are plenty of application notes from Bosch and others how to calculate the requirements for clock tolerance etc. and it depends on many parameters, but at the end you will realize it's risky to use internal clock. So to be, go for external clock.

Good luck,

Renegade

shingadaddy
Senior
Posted on December 10, 2016 at 21:53

If its like the L476RG you can get by with a really easily available (AKA cheap) 32.768K crystal and use that to trim the internal MSI. Which is accurate enough for picky USB and maybe for CAN as well. Then you have a good RTC source if needed also.