starlet
Junior Member level 2
89c51 uart source
hi friends
i have a problem in serial communication with at89c51. i want to send 8 bits of data 0-255, i first used serial mode 1 which works well 1-255 but for zero i used mode 3 (9 bit uart) but it caused a problem.
i am using odd parity in PC. and with 8 bits, 9600 baud rate, 11.0592MHZ in uc.
mov a,#161 (161 constant can be variable r0 )
mov c,p
cpl c ;for odd parity
mov tb8,c
mov sbuf,a
but still it works for 7 bits data <128 but it sometimes receives or some times not. i am confused
is there any problem in code? i am using visual basic, but i also tried Hyper terminal but when i transmitted 161 decimal it gives me 237 and many errors fomr >127 values.
need help. but please as soon as possible. i really need to know bug?
hi friends
i have a problem in serial communication with at89c51. i want to send 8 bits of data 0-255, i first used serial mode 1 which works well 1-255 but for zero i used mode 3 (9 bit uart) but it caused a problem.
i am using odd parity in PC. and with 8 bits, 9600 baud rate, 11.0592MHZ in uc.
mov a,#161 (161 constant can be variable r0 )
mov c,p
cpl c ;for odd parity
mov tb8,c
mov sbuf,a
but still it works for 7 bits data <128 but it sometimes receives or some times not. i am confused
is there any problem in code? i am using visual basic, but i also tried Hyper terminal but when i transmitted 161 decimal it gives me 237 and many errors fomr >127 values.
need help. but please as soon as possible. i really need to know bug?