PIC Basic PRO 16F877 USART Interrupt TX
Hi
I have started a new thread, can anybody tell me why the Code Below will not Output Serial under TX Interrupts.
Regards Henry
**********
define HSER_TXSTA 20h
define HSER_BAUD 9600
DEFINE HSER_SPBRG 25
StrOut VAR BYTE[20]
I VAR WORD
ENABLE
strout(0) = "H"
strout(1) = "e"
strout(2) = "n"
strout(3) = "r"
strout(4) = "y"
strout(5) = 13
strout(6) = 10
strout(7) = 0
I = 0
ON INTERRUPT GOTO INTERRUPT_HANDLER
INTCON = %10010000
'PIE1.5 = 1 ' enable interrupt on usart receive
PIE1.4 = 1 ' enable interrupt on usart transmit
ENABLE INTERRUPT
HSerout [strout(0)] 'Out Put 1 Character
Main_Loop:
NOP
NOP
NOP
GOTO Main_Loop
END
SerialOut:
For i = 0 TO 20
IF strout(i) = 0 Then
i = 20
Else
HSerout [strout(i)]
EndIF
Next i
Return
DISABLE INTERRUPT
INTERRUPT_HANDLER:
GOSUB SerialOut
'PIR1.5 = 0 'Receive
PIR1.4 = 0 'Transmit
RESUME
ENABLE INTERRUPT
No Change Still See "H" Only
Hi Dave
Thanks for your Reply, but made no difference in Execution Still Refuses to Interrupt. The calling of Sub Routine has a Time Penalty which I guess is why its consider a No No
Regards Henry