Hello.. again...
Well, I'm trying to use Timer1 and USART interrupts using Darrel Ins. Interrupts.
If I disable RX and TX interrupts, Timer1 works really fine. However, if all of them are enable, rx-tx works (microcode serial comm.) but not timer1..
Any ideas?
Thank again!
Code:
ASM
INT_LIST macro ;IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _Timer1, PBP, yes
INT_Handler RX_INT, _GetChar, PBP, yes
INT_Handler TX_INT, _SendChar, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE TMR1_INT ; TMR1
@ INT_ENABLE RX_INT ;- enable the interrupt
@ INT_ENABLE TX_INT ;- enable the interrupt
.
.
.
Timer1:
TMR1L = load.lowbyte
TMR1H = load.highbyte
FLAG = 1
@ INT_RETURN
GetChar:
HSERIN 1, go, [cod]
received = 1
goto theend
go: received = 0
theend:
@ INT_RETURN
SendChar:
if received= 1 then hserout [cod]
received= 0
@ INT_RETURN
Bookmarks