2016-03-14 11:58 AM
Hello
I am using a Nucleo-F103RB board (STM32F103RB) to read two ADC values every 1 second and display these values on an LCD.
When the board is connected to the computer via the USB the ADC values are displayed every second as required; this happens under debug and also when the programme is allowed to run freely with the computer being used solely as the power supply. However, when I attempt to power the board using an external 3V3 power supply the ADC values are displayed every 9 seconds.
To power the board using an external 3.3 V power supply I have followed the suggestions made in the Nucleo User Manual (‘External power supply input: + 3V3’ section). I have:
1)
1) Supplied a 3.3 V supply to the 3V3 pin on CN6 (from a linear regulator); and
2)
2) Removed the 0 ohm resistors across both SB2 and SB12.
Note: the firmware is the same regardless of how the MCU is powered.
Am I right to suspect that the internal 8 MHz HSI clock is used to drive the system clock (SYSCLK) under the externally powered arrangement rather than the 72 MHz PLL clock? If so, can anyone suggest why the HSI clock is being used to drive SYSCLK rather than the PLL and how I can overcome this? Or is there another reason?
Thanks
Ron
2016-03-14 12:43 PM
Power supply is not acctually affecting clocks & PLL-s. Just check your initialisation code. Probably you have changed something. Check what clock are you using HSE or HSI. ARM clock system looks complex but in my opiniom is much easier than AVR one (and at least you cant brick your CPU)
2016-03-14 12:53 PM
The code in, and called from, SystemInit() doesn't provide very good fail-over support. It is probably using the HSE via the ST-LINK to clock the PLL, and that isn't working, so it defaults back to the HSI clock the processor started with.
Review your initialization code, in system_stm32f1xx.c, more thoroughly.2016-03-14 01:01 PM
Thanks for the suggestion, Piotr.
The only thing I have changed is the power supply and a couple of modifications to the board as suggested by the Nucleo's user manual. The two power supplies are both powering the same firmware; the firmware has not been changed. Ron2016-03-15 10:09 AM
the firmware has not been changed.
Ok, but you're going to have to do some analysis to understand why the clocking fails, because there are dynamic paths in the firmware that will alter the outcome, based on the conditions it encounters, or loops it times out of.I'd start with ''RCC_GetClocks'', and presenting the speeds as the board perceives them, and then decompose the RCC registers to understand what clocks and settings are, and compare that with what they should be if it were running at full speed, as expect by system initialization code.