Got a simple application where I am doing nothing but monitoring a signal and then sending the calculated frequency via serial. My frequency range is between 1 and 2 hz so very slow relatively speaking.
My question is the event I am watching has some ring to it so to keep from picking up multiple events per event, I merely use a delay_ms(400) to add some time to allow the signal to stabilize. My question is do interrupts like RTCC continue to work while a long delay_ms() call is made? should I break that into say a 10 ms delay and a for loop to get the time?
Comments on this topic welcome.
16F876 running 4mhz mplab 8.91 CCS version 5.064
Ttelmah
Joined: 11 Mar 2010 Posts: 19536
Posted: Mon Mar 12, 2018 3:18 pm
Interrupts are serviced.
If you look in the manual:
Quote:
The delay time may be longer than requested if an interrupt is serviced during the delay. The time spent in the ISR does not count toward the delay time.
So if your interrupts use a lot of time, you may end up taking longer than 400mSec.
beaker404
Joined: 24 Jul 2012 Posts: 163
Posted: Mon Mar 12, 2018 3:22 pm
Thanks, my interrupt is very small, only index a variable and return is all. So I should be ok.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum