does the timer keep running during interrupt service?

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Still working on that ultrasonic rangefinder that I've been posting about.

I am sending a 40kHz pulse out of one transducer, and have another one hooked up to ADC pin 0. I would like to write my program to start a timer, send an ultrasonic pulse, and stop the timer when the voltage from the receiving transducer surpasses a threshold.

If I run the ADC continuously while I am waiting for the receiver to get excited and check to see if it has surpassed the threshold voltage every time that a conversion complete interrupt is thrown, will this mess up the timer that I am running to see how long it is taking for the signal to get back to the receiver?

Thanks in advance, this forum is always really helpful!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The hardware will keep running while the ISR executes, so you won't miss cycles. So long as your ISR is shorter than the timer period (preferably much, much, much shorter) it will interrupt at regular, fixed intervals.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok, thanks!