Re: USART TX Interrupt problem. (DT_INTS)
Henrik, Yes I understand now. However if you are going to use this routine:
'-- Interrupt service rotuine for USART TX Interrupt ---------------
USART_TX:
TXReg = String_1[TxPointer] ' Load character from array into USART TX register
If String_1[TxPointer] = 0 then ' If that character was a NULL we're done so we.....
@ INT_DISABLE TX_INT ; ...disable the any further USART TX interrupts.
ELSE ' If the character was not a CR we.....
TxPointer = TxPointer + 1 ' ...increase the pointer, prepare to send the next character.
ENDIF ' As soon as the TX-reg is empty the interrupt will fire again. (~1ms at 9600baud)
@ INT_RETURN
I would check for the end of the string before I send the a character, That way you won't be sending the null character from the end of the array. You will get an interrupt when the last character is sent and at that time you don't want to be sending any more, just disable the interrupt and leave.... just change the routine to read:
'-- Interrupt service rotuine for USART TX Interrupt ---------------
USART_TX:
If String_1[TxPointer] = 0 then ' If that character was a NULL we're done so we.....
@ INT_DISABLE TX_INT ; ...disable the any further USART TX interrupts.
ELSE ' If the character was not a CR we.....
TXReg = String_1[TxPointer] ' Load character from array into USART TX register
TxPointer = TxPointer + 1 ' ...increase the pointer, prepare to send the next character.
ENDIF ' As soon as the TX-reg is empty the interrupt will fire again. (~1ms at 9600baud)
@ INT_RETURN
Dave Purola,
N8NTA
EN82fn
Bookmarks