Hello
I again
Want change my code to use Darrel Interupts like this:
My questions is, when it jump to a serial communication interrupt service routine, after the first Hserin, can i wait of a second Hserin in the Interrupt routine?
Thanks for help
Best regard
Pedro
' Initialize USART
TRISC = %10111111 ' Set TX (PortC.6) to out, rest in
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 103 ' 2400 Baud @ 16MHz, 0.17%
''DEFINE HSER_SPBRG 25 ' 9600 Baud @ 16MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
'
INCLUDE "modedefs.bas"
INCLUDE "DT_INTS-18.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ' Include if using PBP interrupts
'
ASM
INT_LIST macro
INT_Handler RX_INT, _IntRx, PBP, yes
endm
INT_CREATE
ENDASM
@ INT_ENABLE RX_INT
Main:
low transmite 'MAX 487 in reception mode
make anything
Goto main
end
intrx:
HSERIN 850,rxfail,[wait ("P"), dec2 func, dec3 board, dec3 dumy]
If (func = 20) and (machine = board) then 'is the data for this board?
low transmite 'MAX 487 in reception mode
'second Hserin in this ISR, ???? can that work?
HSERIN 250,rxfail,[wait ("G"),hex2 rtchr,hex2 rtcmin,hex2 rtcyear,hex2 rtcmonth,hex2
rtcdate,hex4 obrs,hex2 rtcday,hex2 daylight]
rtcsec = $00
Gosub settime
high transmite 'set MAX 487 in transmit mode
Hserout ["dumi",";",hex2 rtchr,";",hex2 rtcmin,";",hex2 rtcyear,";",hex2 rtcmonth,";",hex2
rtcdate,";",hex4 obrs,";",hex2 rtcday,13,10]
low transmite 'set MAX 487 in reception mode again
goto RXfail
Endif
RXfail:
@ INT_RETURN
Bookmarks