cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F042: External clock and clock output

harald
Associate III

As described before (https://community.st.com/s/question/0D50X00009sWdDqSAK/stm32f042-bootloader-activation) I want to use 2 STM32F042 as CAN controller. So far I planned to use the internal HSI RC oscillator, but a +-5% tolerance seems critical for CAN clock accuracy. Using a crystal is not possible due to size and cost limitations.

I can create a 8Mhz signal from host CPU and use this as system clock. I would even like to use clock output of one STM32 as clock input of the other to avoid having my host CPU need to drive both inputs.

Is that possible? How do I configure this? When trying to enter this in CubeMX, I get errors: When entering "8" in Input frequency it is getting overwritten with 0.0000080, when writing 8000000 I can't leave the clock fonfiguration tab.

In neither cases I can select a clock output.

Any recommendations?

Thanks, Harald

0690X000006CHJZQA4.png

0690X000006CHJeQAO.png

3 REPLIES 3
T J
Lead

It is recommended that you limit the length of any clock signals.

Generally engineers will use a crystal locally.

However, it is not uncommon to do it, Ethernet has a 25MHz signal that runs around the board sometimes...

Normally if you wanted to distribute a high frequency signal, you would use a resistor in series at the source, so now its a low power signal, I have 100R for this and it works well, if you need two clock traces, then use 2x 100R to give you two high impedance traces for two separate inputs.

it is not good practice to run the out 8MHz from this F042 to another processor..

in the cube,

On the "pin out" tab, what options for Osc ? select crystal, take 8Mhz to input,

From the output, use resistor to cascade the output off to the next processor... very dodgy, noisy (radiating) and you will have spurious clock moments "spikes affecting you" which may or may not satisfy the clock requirements of this and the next processor...

Could use a buffer or inverter and split that between the two, not sure daisy chaining brings value. Perhaps slews current consumption slightly.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Geoffrey1
Associate III

You could distributed a lower speed clock and use the CRS function to synchronize the on board oscillator. I use CRS for USB clock generation, but it also can take the CRS_SYNC signal from some of the GPIO pins.