Hi CAlex,
I see you have disabled the timer interrupt call in your code.
Do you mean if you use interrupt to call a function to set the changes of the output signal as indicator(observe on the oscilloscope) then there is no issue? But if you use while loop then there will be issue?
If I am correct for the below:
- Your polling method is using a while(1) loop.
- Everytime the clock signal edge(low->high) happened, there will be changes on the timer register which you will check within the while loop. Your output signal indicatoer will go high when it happened.
- Everytime you call the myfunction(), it is going into a for loop to perform counting. which creates a short delay that meant for the output signal indicator to go low again.
- your output indicator signal is taking longer time than usual to change from high to low.
- It looks like sometimes it is taking a longer time when running the while loop.
Thanks.
Regards,
Aik Eu