2017-02-22 01:05 PM
Hi,
I'm working on a stm32F101CBT6.
The board has a 16 MHz HSE (connected to PD0.PD1) and a 32.768 KHz LSE (connected to PC14/PC15).
The board will use SPI1, SPI2, USART1, USART2, I2C1 and a few GPIOs.
I've worked with ST microcontrollers before, but never had to configure the clocks, so I'll be probably asking some naive questions, please be gentle... I do know that external oscillators are much more precise than the internal ones.
When creating a new project with CubeMX, it defaults to HSI and LSI.
If I enable MCO (PA8) and listen with an analyzer - I get 8 MHz. That seems correct.
1. If I configure the clock configuration, via CubeMX, to use HSE with 16 MHz (the board schema says 16 MHz) - I see on MCO 16.67 MHz. Is that correct?
2. What is the logic, the aim of playing with the PLL, and - should I use it?
My common sense says I should aim for the highest frequency in the SYSCLK and the buses.
I've attached my CubeMX project file, if it helps.
Thanks
#hse-hsi-pll-rccSolved! Go to Solution.
2017-02-23 05:30 AM
Read out the time between first and say 100th leading edge.
JW
2017-02-23 04:42 PM
Abracom ABMM2 from 2005, looks to be 16.0 MHz, I'd use a calibrated scope. Alternately divide it down, compare count on 1 Hz RTC clocking from an external 32.768 KHz source.
I've typically benched STM32F4 using a 32-bit counter, and a 1PPS signal on a channel to do capture-compare.