2023-03-21 03:49 AM
Hello,
I'm counting a 10MHz oscillator(with external clock mode 1) for 1 second using the stm32f0 processor's TIM1. I get about 10 000 000 pulses.
Then the system has a starting point and I start the 1s counting process here. The timer counts a maximum of 16 bits. I make 152 full rounds (update overflow) and stop and reset the Timer with the remaining 38680(152*65535+38680 = 10000000) with capture compare interrupt. However, the system is constantly shifting from the starting point (up to 70 microseconds). As a result of the tests I made with the logic analyzer, there is a problem where I reset the Timer. How do you think I can fix it and do you have any suggestions? I've been trying for a long time but couldn't solve it. Thanks everyone in advance.
2023-03-23 01:34 AM
ICould you explain briefly ?
2023-03-23 01:38 AM
The goal is obtain 1 second with 10 MHz high accuracy crystal oscilator. Without any time shifting acording to starting point(When the timer starts).
Thanks
2023-03-23 06:13 AM
EOSCloopVal = ExactOSCCount / 0x10000 ;
EOSCOverVal =ExactOSCCount % 0x10000;
JW