Hi,
I was wondering if anyone knew how the DelayMS call worked in reference to a interrupt on the USART. I have a main loop where I use the ReadSerial call then if no charcters are coming in I proceed to toggle some leds then delay 5 seconds. My question is after I drop into the DelayMS routine will a RX Interrupt pull me out to service the incoming charcters. Any insight would be greatly appreciated.
thanks
USART RX Interrupt
Moderators: David Barker, Jerry Messina
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: USART RX Interrupt
Hi Widgetman,
I understand you're coming from the viewpoint of using interrupts, although I was a little confused by your example:
In any case; if an interrupt was configured for USART then an incoming byte would interrupt the code while in the DelaymS call. When complete, it would return to where-ever it left off.
A caveat - the interrupt is disabled before the 5 second delay. Although you may land yourself buffer overruns or lost data with this tact. Just putting it out there
I understand you're coming from the viewpoint of using interrupts, although I was a little confused by your example:
I interpret that as a quick status flag check of RCIF, without the use of an interrupt driven event...Widgetman wrote:I have a main loop where I use the ReadSerial call then if no charcters are coming in I proceed to toggle some leds then delay 5 seconds.
In any case; if an interrupt was configured for USART then an incoming byte would interrupt the code while in the DelaymS call. When complete, it would return to where-ever it left off.
A caveat - the interrupt is disabled before the 5 second delay. Although you may land yourself buffer overruns or lost data with this tact. Just putting it out there
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.
Australian distributor for the Swordfish Compiler
Australian distributor for the Swordfish Compiler