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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/09/00 12:25
Read: times


 
#3130 - RE: Problem with changing serial baud rate
Hi,

Your program is fine.

Try to change the code segment like the following.

CLR TR2
;stop timer2 to write RCAP2L
MOV DPTR,#D_BAUDRATE
MOVC A,@A+DPTR
MOV TH2,#0FFH
MOV TL2,A
MOV RCAP2L,A
SETB TR2 ;restart timer2
MOV V_BUFF,#S_OK
;== delay 100ms before return to allow time for the host to change its baud rate
MOV R5,#100
FRC_BAUDDLY: MOV R4,#154
DJNZ R4,$ ;308 cycles = 1 ms
DJNZ R5,FRC_BAUDDLY
RET
D_BAUDRATE: DB 0A0h ; 1200bps x=0

I hope it will work although I did not see your Timer2 settings.

By now,

George


List of 2 messages in thread
TopicAuthorDate
Problem with changing serial baud rate            01/01/70 00:00      
RE: Problem with changing serial baud rate            01/01/70 00:00      

Back to Subject List