Thanks for taking the time to respond.
Ok, I made that change to the header config. (I already had the correct PIC variant selected)
The include DT bits where in my original program (I cut/pasted a last minute 'just before bed' effort into my post above, where I'd obviously not put that bit in). Actually, now that I have put them back in, I'm getting even more compilation errors - see this screen scrape...
(it's a little blurry - but the image can be enlarged a bit more by clicking on the image after opening it the first time)
here's the code (by the way, which option is everyone choosing when they paste iup their code to have it in a box?!)...
@MyConfig1 = _XT_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF
@MyConfig2 = MyConfig & _MCLRE_ON & _BOR_OFF
@ __config MyConfig1 & MyConfig2
INCLUDE "DT_INTS-14.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP.bas" ; Include if using PBP interrupts
DEFINE OSC 4
DEFINE HSER_SPBRG 25
DEFINE HSER_TXSTA 24h
DEFINE HSER_CLROERR 1
ANSELH=0
ANSEL=0
CM1CON0 =0
CM2CON0 =0
CM2CON1 =0
adcon1=0
TRISB.6 = 1
TRISB.7 = 0
TRISC=%00000000 ; set all Port C pins as outputs
rcsta.7=1 'SPEN serial port enable bit
low portc.0
low portc.1
low portc.2
low portc.3
mybyte var byte
'::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler RX_INT, _Get_char, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
'::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::
@INT_ENABLE RX_INT
loop:
if mybyte="1" then
hserout ["got it!"]
mybyte=0
endif
if mybyte<>"1" then
hserout ["didn't get it!"]
mybyte=0
endif
goto loop
'---[USART RX Interrupt handler]----------------------------------------------------
Get_char:
hserin 100,noreceived,[mybyte] 'Get byte
noreceived: 'or if timeout return
@INT_RETURN
Bookmarks