Hello,
My task is very simple. I wish to send out a string for few sci baud rate (1200,2400, 4800, 9600, 119200). The problem is that only the first baud rate(119200) will be send out correctly, for the other baud rate, i get junk character.
Here is my code:
FIND_ETH_BR CLR SCI1BDH
MOV #%00100000,SCI1BDL ; baud rate 384000
CLRA
STA SCI1C1 ;SCI Control Register 1
STA SCI1C3 ;SCI Control Register 3
FIND_ETH_BR1
LDA SCI1BDL ;Change baud rate (divide by 2)
LDX SCI1BDH
LSLA
ROLX
STX SCI1BDH
STA SCI1BDL
CBEQX #$08,FIND_ETH_BRQ
LDA #%00101100 ;Enable RIE , TIE
STA SCI1C2 ;SCI Control Register 2
LDA SCI1S1 ;Clear byte
JSR Send_String
BRA FIND_ETH_BR1
FIND_ETH_BRQ RTS
Is there anything wrong with my code??
Thanks.
Rgds,
Gan