Skip to main content
ASeyo
Associate II
Jul 19, 2019 1:40 PM UTC
Solved

STM32F1 system timer

Hi, I'm using STM32F103. I encountered a problem when using the system timer to generate a delay. The processor runs at 8MHz from reset, well I think, and I'm using that clock to generate a 1Ms delay. So, I've to load the SysTick LOAD register with 8000-1.

But it does't work as I expected. I assumed it would generate 1Ms but actually it generates a 0.1Ms. I literally don't know WHY. My code and the simulated output are below in the picture. Thanks in advance!0690X000009YvdxQAC.png0690X000009YvdsQAC.png

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Jul 19, 2019 4:38 PM UTC

Sure there's not code in SystemInit() setting the PLL to 72 MHz?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Jul 19, 2019 4:38 PM UTC

Sure there's not code in SystemInit() setting the PLL to 72 MHz?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
ASeyo
ASeyoAuthor
Associate II
Jul 23, 2019 6:42 AM UTC

Maybe you are right. I have no idea on how to change the PLL configuration in SystemInit(). I just write some code whenever I need to configure the PLL .