What does this do on PortD.0?
Code:
define OSC 20
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 10 ' 115200 Baud @ 20MHz, -1,36%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
TRISC.2=0 : TRISC.1=0 : TRISB.5=0 : TRISD.0 = 0 : CCP1CON=12 : CCP2CON=12
CCP3CON=12 : INTCON=$c0 : LOAD=64386 : TMR1H=LOAD.HIGHBYTE
TMR1L=LOAD.LOWBYTE : T1CON=1 : PIE1.0 = 1 : PR2 = 49 : PORTD.0 = 0 : T2CON = 4
ASM
INT_LIST macro ;IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _Timer1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE TMR1_INT ; Habilita interrupção do TMR1
MAIN: GOTO MAIN
Timer1: TMR1H = load.highbyte : TMR1L = load.lowbyte
if portd.0 = 0 then
portd.0 = 1
else
portd.0 = 0
endif
@ INT_RETURN
END
My point is that it looks like your program 'flow' is jacked up and needs to be reworked.
Bookmarks