2023-10-13 11:18 AM
I have a timer with an interrupt every 1ms to create time stamps for my later algorithm developement. I flag for the adc to sample once every 5 seconds, but I see that the ADC bleeds over or it changes multiple times before stopping. Is there anyway to stop this? I only want one sample.
Is APB1 Timer clocks or APB1 peripheral clocks the clock that determines the speed of my timer? I am counting internally, I want to scale and set up count accordingly to get an interrupt every 1 ms. I would very much appreciate an explanation as I am new.
2023-10-13 12:35 PM
If the timer is in APB1, the relevant clock is the APB1 Timer clock. Different timers are on different buses. Look at the CubeMX clock page for a graphical explanation of how clocks are configured in your system.
The most common error in ADC accuracy is caused by low sampling time. Increase it to max if you want the most accurate results. This and other general ADC accuracy is addressed here: