burgerfeet
New Member
Hi everybody,
I am in desperate need of help with my interrput routine. Any pointers would be sincerely appreciated.
The code below reads the RX buffer and then executes a call based on the value of the character stored in the buffer.
org 0x0004
bsf PORTC,0
movf RCREG,0
movwf rx_command
; A - Realtime acquistion mode
movlw 0x41
subwf rx_command,0
btfss STATUS,Z
goto $+3
call adc_routine
goto exit_interrupt
; U - Upload Memory
movlw 0x55
subwf rx_command,0
btfss STATUS,Z
goto exit_interrupt
call sequential_read
exit_interrupt
retfie
The code works perfectly using OSHON PIC simulator. When I run the code in the PIC, it appears to hang, with no execution of the interrupt code. If I just call either routine from the interrupt it works fine.
The full code compiles to a 3K hex file with 400 out of the 8000 code memory addresses used. I was thinking that I am having paging errors. I will post the whole code if necessary but ir appears all messy when I paste it into the post editing box.
Many thanks in advance.
Andrew
I am in desperate need of help with my interrput routine. Any pointers would be sincerely appreciated.
The code below reads the RX buffer and then executes a call based on the value of the character stored in the buffer.
org 0x0004
bsf PORTC,0
movf RCREG,0
movwf rx_command
; A - Realtime acquistion mode
movlw 0x41
subwf rx_command,0
btfss STATUS,Z
goto $+3
call adc_routine
goto exit_interrupt
; U - Upload Memory
movlw 0x55
subwf rx_command,0
btfss STATUS,Z
goto exit_interrupt
call sequential_read
exit_interrupt
retfie
The code works perfectly using OSHON PIC simulator. When I run the code in the PIC, it appears to hang, with no execution of the interrupt code. If I just call either routine from the interrupt it works fine.
The full code compiles to a 3K hex file with 400 out of the 8000 code memory addresses used. I was thinking that I am having paging errors. I will post the whole code if necessary but ir appears all messy when I paste it into the post editing box.
Many thanks in advance.
Andrew
Last edited: