We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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,#00HMOV P2,AMOV TMOD, #20HMOV TH1, #-3MOV SCON, #50HSETB TR1
REPEAT:JNB RI, REPEATMOV A,SBUFCLR RICJNE A,#"F",ONEMOV P2,#89HSJMP REPEAT
ONE:CJNE A,#"B",TWOMOV P2,#86HSJMP REPEAT
TWO:CJNE A,#"L",THREEMOV P2,#8AHSJMP REPEAT
THREE:CJNE A,#"R",FOURMOV P2,#85HSJMP REPEAT
FOUR:CJNE A,#"C",REPEATMOV P2,#00HSJMP REPEATRETEND