Richard, thank you for the respose,
PBP version is 4.0.0.0
Henrick, I altered the code to include a hserin but still no luck
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
OSCCON = %11010010 'Internal oscillator is set to 4MHz $D2
'OSCTUNE = %10000000 'HFINTOSC selected; PLL disabled; Factory calibrated frequency
ADCON0.0 = 0 'Disable ADC
DEFINE OSC 4
' 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
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
' Set Debug mode: 0 = true, 1 = inverted
DEFINE DEBUG_MODE 1
Main:
debug "here",cr
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler RX1_INT, _read_serial, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
T0CON = %10010010
@ INT_ENABLE RX1_INT ; enable external (RX) interrupts
for x = 1 to 1000
pause 1
next x
Goto main
read_serial:
Debug "got it!!",cr
hserin 250, timeup, [x]
pause 1000
@ INT_RETURN
timeup:
debug "no rs232",cr
goto main
This is the include file in the pbp folder
Code:
INCLUDE "P18F26K22.INC" ; MPASM Header
__CONFIG _CONFIG1H, _FOSC_INTIO67_1H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
NOLIST
Mike
Bookmarks