Hi Ben,
I only took a quick peek at your code, my findings were...
You should have all of your interruptcode between the DISABLE-ENABLE. The interrupthandler should end with RESUME. My suggestion is that you change it to .......
Code:
DISABLE 'Disable interrupts for duration of service routine
service: 'Interrupt service routine
IF PIR1.5=1 THEN 'If PIR1.5 is high, then we have
'a serial data interrupt
PIR1.5=0
HSERIN 10,timeout,[bin ID,bin MODE,bin dist,bin SPEED,bin DIR,bin REQUEST]
'We are expecting 6 bytes input.
ENDIF
timeout:
IF INTCON.1=1 THEN 'If INTCON.1 is high, then this
'is a timer0 interrupt
INTCON.1=0
timer_counter=timer_counter+1
ENDIF
RESUME
ENABLE
Perhaps this is enough to get you going.
/Ingvar
Bookmarks