2015-03-29 6:46 PM
I'm developing a project in wich main clock accuracy isn't particurlaly important. I do need to measure time acurately, but I can use the RTC with an external 32.768 KHz crystal for that.
I was wondering about the possibility of using the internal HSI for this particular project, but I am a little concerned about what would be the disadvantages (specially since it seems everyone uses a crystal). Accurancy is an obvious one, but as I said, I'm not concerned about that. What about other disadvantages, are there any? In my particular case I'm interested in power consumption as well. Thanks in advcance, respectfully, Andrew. #hse-hsi-clock-crystal2015-03-30 12:17 AM
In a few projects I have put the crystal on the PCBs. However, the software projects that I copied to get started used HSI. I haven't bothered to switch... So.. Not everybody is using HSE.
I haven't looked into power issues. But I'd guess that it is easier to optimize the HSI clock for power than the HSE: the latter has to work with ''unknown'' crystals.2015-03-30 7:16 AM
I am pretty sure using a crystal for either HSE or LSE will increase your power consumption slightly, and gain stability/accuracy since RC oscillators tend to change with temperature. Also it would depend on peripherals that you are using, some peripherals need an accurate clock. If you are not in need of the accuracy and want to lower the BOM cost, I would try using the internal oscillator.
I also believe that all the internal clocks have a faster startup time than the external oscillator options.Thanks,George2015-03-30 7:55 AM
For USART/SPI the HSI will be fine. For CAN/USB/Ethernet you want the accuracy afforded by the HSE. For Ethernet you could also go with a single 25 or 50 MHz oscillator for the entire design.
2015-03-30 6:47 PM
I have a lot of ST32F4xx boards. The one I'm using a lot now, when on the HSI clock yields a baud rate that's too much in error. Just jibberish on the dumb terminal.
2015-03-30 8:12 PM
And what does the HSI and PLL look like when scoped on MCO(1)? Or the bit timing on the serial data?
2015-03-30 11:15 PM
2015-11-02 9:13 AM
Before executing the jump-to-application instruction the bootloader in several STM chips tries to reset the HSI calibration register to its reset value, and resets the register to ''all zeroes''.... Except... that's not the reset value. The reset value is 0b10000, halfway in the 5-bit range 0b00000 - 0b11111. (IIRC, that calibrates the HSI to about -8%)
So, that's the case when I've seen the ''all gibberish'' on UART when using HSI.... Are you using the bootloader?2015-11-02 10:11 AM
Most use cases don't have the System Loader (bootloader) touch the device at all. Pulling BOOT0 High and jumping to app code is highly atypical.
The biggest thing to watch for is code in/called-by SystemInit() nuking registers or making assumptions about the entry state. It's gotten better, but if you have a loader/app configuration, you need to be more conscious of the hand over conditions/expectations. If you already have the HSE/PLL functioning, there's no real point to tear-down everything and wait for them to start/lock all over again. Serial data can deal with woeful levels of bit timing error, but as baud rates increase wrt to APB clock, you're starting with a lot rougher granularity.2015-11-03 12:33 AM