I know this is an old thread but I am trying to get the DT_INTS to work with the 18F26k22, so far no luck with either RX1 or RX2,the program will not jump to the label in the ASM macro
Code:
INCLUDE "modedefs.bas"
INCLUDE"ALLDIGITAL.pbp"
INCLUDE "HomeAutomationVars.bas" 'Open with PBP editor
INCLUDE "DT_INTS-18.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
DEFINE PULSIN_MAX 1000
DEFINE HSER_RCSTA 90h 'Hser receive status init
DEFINE HSER_TXSTA 24h 'Hser transmit status init
DEFINE HSER_BAUD 9600 'Hser baud rate
DEFINE HSER_SPBRG 25
DEFINE HSER_CLROERR 1
DEFINE RX2_INT PIR4,RC2IF, PIE4,RC2IE
DEFINE TX2_INT PIR4,TX2IF, PIE4,TXIE
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 0
DEFINE DEBUG_BAUD 9600
' Set Debug mode: 0 = true, 1 = inverted
DEFINE DEBUG_MODE 1
x var word
Main:
debug "here",cr
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler RX_INT, _read_serial, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
T0CON = %10010010
@ INT_ENABLE RX_INT ; enable external (RX) interrupts
for x = 1 to 1000
pause 1
next x
Goto main
read_serial:
Debug "got it!!",cr
pause 1000
goto main
Is there a fuse bit that I need to set? I had no problems with an 18F1320
Mike
Bookmarks