This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Serial Data reading is not working

Hi everyone i am working on a control car project by using Atmel At89S51 8051 mircocontroller. By coding with assembly langugage , i figured out the MOV A,SBUF is not reading anything and send to Accumulator. Baud rate is 9600 with same as HC-05 bluetooth chip. Down there is my code, i ran debug from uKeil, by typing SBUF value it doesnt read and send to accumlator, i enabled RI too but it still didnt accept anything but keep in 00H

ORG 00H

MOV A,#00H
MOV P2,A
MOV TMOD, #20H
MOV TH1, #-3
MOV SCON, #50H
SETB TR1

REPEAT:
JNB RI, REPEAT
MOV A,SBUF
CLR RI
CJNE A,#"F",ONE
MOV P2,#89H
SJMP REPEAT

ONE:
CJNE A,#"B",TWO
MOV P2,#86H
SJMP REPEAT

TWO:
CJNE A,#"L",THREE
MOV P2,#8AH
SJMP REPEAT

THREE:
CJNE A,#"R",FOUR
MOV P2,#85H
SJMP REPEAT

FOUR:
CJNE A,#"C",REPEAT
MOV P2,#00H
SJMP REPEAT
RET
END