This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CortexM3 uS delay

I am quite new to CortexM3, so I am not sure what is the best approach to achieve microseconds delay. What I did on ARM7 and some 8-bit processors, is "waste time loops" in assembler which do some NOPs and tweak it with oscilloscope for certain osc freq. But with enabling PLL on CortexM3 I am wondering if I could achieve same with timers ? If I set PLL to get 120Mhz, will my timer work at that freq or at base freq of 20Mhz as osc ?

Thanks.

Parents
  • It's up to you to figure out what timers you can use.

    But notice that a single timer can solve many problems if you use it free-running instead of using the auto-reset feature.

    Then you can use it to create 1ms or 1s interrupts or whatever you need and at the same time do software delays with maybe 0.05 us resolution. If the ISR is ready to check which match register that produced the interrupt, then you can have that same timer create up to four periodic interrupts - each with different frequency.

    In the end, it's just a question of if you are willing to reprogram match registers in the ISR.

Reply
  • It's up to you to figure out what timers you can use.

    But notice that a single timer can solve many problems if you use it free-running instead of using the auto-reset feature.

    Then you can use it to create 1ms or 1s interrupts or whatever you need and at the same time do software delays with maybe 0.05 us resolution. If the ISR is ready to check which match register that produced the interrupt, then you can have that same timer create up to four periodic interrupts - each with different frequency.

    In the end, it's just a question of if you are willing to reprogram match registers in the ISR.

Children