Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/29/04 11:44
Read: times


 
#79997 - RE: serial intrrupt
Responding to: ???'s previous message
Hello my name is Julián, please excuse me for my poor english.
Try to check your serial initialization in order to be sure that you didn't set the TI flag in SCON register, because if you set it, the micro will interrupt to serial vector EVERYTIME. An example of mode 1 initialization procedure could be :

SETB IE.4 ; To enable serial int.
SETB IP.4 ; High priority (if you need)
MOV SCON,#50H ; TI disable, Serial Reception,
; Mode 1

If you transmit using pooling way, you have to exit the serial interrupt if TI is high, you can use this code :

UARTint:
JBC RI,UARTintrx ; Is reception ?
; If RI set, clears RI
RETI ; Exit Interrupt

UARTintrx: ; Interrupt routine code

And to transmit :

MOV SBUF,A ; Transmit Acumulator
JNB TI,$ ; Wait until TI is high
CLR TI ; Clear TI
RET

In this way, TI is high only when the UART is transmiting a character.

I hope could be useful. Have a nice day.

List of 8 messages in thread
TopicAuthorDate
serial intrrupt            01/01/70 00:00      
   RE: serial intrrupt            01/01/70 00:00      
   RE: serial intrrupt            01/01/70 00:00      
      RE: serial intrrupt            01/01/70 00:00      
         RE: serial intrrupt            01/01/70 00:00      
   RE: serial intrrupt            01/01/70 00:00      
   RE: Quotes?            01/01/70 00:00      
   RE: serial intrrupt            01/01/70 00:00      

Back to Subject List