2013-09-28 03:45 AM
Hello,
I am trying to make a timer interrupt routine, which executes every 0.25us. The problem I am facing that the code length in the routine changes the duration for example running an instruction at 72MHz, the next time the routine execute is 0.35us. It seems the the timer starts counting after returning from the IRQ routine, instead of running just after overflow. I am using Auto-Reload register with value 18. Tell me what I am missing.Regards. #timer2 #keil #stm32f3032013-09-28 11:13 AM
2013-09-28 12:57 PM
2013-09-28 12:58 PM
2013-09-28 01:04 PM
Now you can see these two images. How is it possible that system has took a single (1/72MHz) 0.00000014 sec step and counter made so much progress. I am very much confused now. Please help me in making it possible for me to run it properly. Also you can see in the image UIF bit remains high even though I have cleared it. Only possible if counter gets overflowed. I am attaching my recent work as well.
________________ Attachments : Timer2_Beispiel.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0dP&d=%2Fa%2F0X0000000bbh%2FusEd2gVzNPI1HsUDJWSvyTzx2i_tLqjD4pALgJqmnWI&asPdf=false2013-09-28 03:26 PM
I'll have to take a look later.
I wouldn't get too hung up about the debugger, and how the core executes wrt an external free-running timer which is not under the control of the debugger, and continues ticking. The peripherals are not part of the core, and access to them is complicated. The debugger is invasive. If you want to qualify the timer either output a signal you can measure on a scope, or use the input capture and measure the period of some external known source. Also don't RMW (&=) the TIMx->SR, this is not how it works, just write the mask to it and don't read it.2013-09-28 06:23 PM
That project looks to be something totally different, an old F1 based one.