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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/01/01 02:35
Read: times


 
#17112 - RE: Serial communications
I confuse with your program!
I made a lot of serial program using 8051, and all it's work. In my program SCON regiter have to put data #50h not #52h (you set the TI bit/Transmit interrupt flag) so you never know you have finish send a data. Every time you send a data to sbuf (tx) you have to check TI bit register,it's set or not.
..
jnb ti,$
clr ti
...

ti bit set every time finished send a data to sbuf.after finished send data. you have to clr the ti bit.Now you can show the data to LCD.
example:
mov PCON,#80h
mov scon,#50h;8bit,N
mov tmod,#21h
mov TH1,#FDh;9600x2 bps
setb tr1; start the timer 1
jnb ri,$
clr ri
mov a,sbuf; get data from serial buffer
call WRITE
mov sbuf,a; send back data to serial buf
jnb ti,$
clr ti
....





List of 10 messages in thread
TopicAuthorDate
Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications Attn: Andi            01/01/70 00:00      
RE: Serial communications Attn: Andi            01/01/70 00:00      
Serial communications - Gerald Johnson            01/01/70 00:00      

Back to Subject List