Simple question, I'm sending a byte serially to my PIC12F1840 to the UART port, and will have an ISR routine perform a task with the received number. But in the main program, if I am running a delay_ms() say for 100 ms or so, will it interrupt that mid stream and grab the incoming byte? or will it have to wait until the delay is over and miss the byte coming in?
Thanks.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Fri Mar 23, 2018 12:00 am
Quote:
I am running a delay_ms() say for 100 ms or so, will it interrupt that mid
stream and grab the incoming byte?
Normally it will. If it can't, you'll get a warning from the compiler
saying "Interrupts disabled to prevent re-entrancy". This warning will
occur if you use delay statements both inside the isr and in the main code.
Arizona Chris
Joined: 20 Dec 2014 Posts: 69 Location: Arizona
Posted: Fri Mar 23, 2018 6:22 am
Thanks! Ill set up a test to confirm the interrupt works during a long delay.
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