gan kf

MC908SAW32 SCI problem

Discussion created by gan kf on Feb 14, 2007
Latest reply on Feb 15, 2007 by gan kf
Hi,
 
I'm a beginner to 908saw32. I wish to use interrupt for transmit and receive data through SCI and
I'm using half duplex (2 wire) max485.
 
SCI initialization
 
SCI1BDH = $00
SCI1BDL = $80        
SCI1C2 = $6C (Enable TC,RIE,RE,TE)
 
ISR for the transmit interrupt:
 
SCI1_TX       PSHA
              PSHH
              PSHX
              LDA       SCI1S1          ;clear TC
              LDA       TX_BUF
              BEQ       TX_QUIT
             STA       SCI1D           ;clear TC and send byte
             CLRA
             STA       TX_BUF
             BRA       TX_QUIT
 
TX_QUIT       LDA       #%00101100     ;Disable transmit interrupt
             STA       SCI1C2
             BCLR      MAX485,PORTC   
             PULX
             PULH
             PULA
             RTI

I try to send ascii character a,b,c,d,e,f,g in sequence to hyperterminal, but there is data lost for the transmission. For example, i get a,f,g,b.....

Is there anything wrong with this code??
Plz help....

 

Outcomes