CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Can UART interrupt a delay_ms() ??

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Arizona Chris



Joined: 20 Dec 2014
Posts: 69
Location: Arizona

View user's profile Send private message Visit poster's website

Can UART interrupt a delay_ms() ??
PostPosted: Thu Mar 22, 2018 8:39 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 23, 2018 12:00 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Fri Mar 23, 2018 6:22 am     Reply with quote

Thanks! Ill set up a test to confirm the interrupt works during a long delay.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group