Page 1 of 1

Use ISRRX and ISRTimer in the same program

Posted: Thu Jun 26, 2014 2:01 pm
by Coccoliso
Hello,
is there a way to use modules Timer and ISRRX in the same code ?
The problem is to read the USART while running a state display routine cyclically called by timer.

Thanks.

Re: Use ISRRX and ISRTimer in the same program

Posted: Thu Jun 26, 2014 2:56 pm
by Jerry Messina
The easiest way is to use different interrupt priorities for the two modules.

By default, they both use the same priority (ipHigh). By changing the timer to use the low-priority interrupt, the USART will be able to interrupt it.

Code: Select all

#option RX_PRIORITY = ipHigh
#option TIMER_PRIORITY = ipLow

include "ISRRX.bas"
include "ISRTimer.bas"

Re: Use ISRRX and ISRTimer in the same program

Posted: Thu Jun 26, 2014 3:09 pm
by Coccoliso
Plain and simple :wink: .