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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/17/04 21:06
Read: times


 
#64968 - RE: Changing serial protocol in BASIC-52
Responding to: ???'s previous message
hi,
device which has a fixed protocol of 4800bd,1stop bit, 7 data bits, Even parity and 2 Stop bits

So one or two stop bits? I think do you meant 1start bit? So no problems: use standard UART of 51: it detects start bit, receives 8 bits of data (yeah, last one is first stop bit) and then stop bit. Some notes:
- check last bit for is it "1": you know now that it is first stop bit;
- use modern C51 which provides "Frame Error" bit: by it you may use hardware detection of second stop bit here. If such part is not available for you then switch UART to "9-bits mode" and set RB8 bit of SCON register: this way C51 still be able to detect second stop bit itself;
- parity bit may be detected by software; it is not hard: you need to load received and masked value (remember that it is 7 bits wide only!) to ACC and then check P-flag of PSW.

Regards,
Oleg

List of 11 messages in thread
TopicAuthorDate
Changing serial protocol in BASIC-52            01/01/70 00:00      
   RE: Changing serial protocol in BASIC-52            01/01/70 00:00      
      RE: Changing serial protocol in BASIC-52            01/01/70 00:00      
         RE: Changing serial protocol in BASIC-52            01/01/70 00:00      
   RE: Changing serial protocol in BASIC-52            01/01/70 00:00      
      RE: Changing serial protocol in BASIC-52            01/01/70 00:00      
         RE: Changing serial protocol in BASIC-52            01/01/70 00:00      
      RE: Changing serial protocol in BASIC-52            01/01/70 00:00      
         Stop Bits - dont worry!            01/01/70 00:00      
            RE: Stop Bits - dont worry!            01/01/70 00:00      
      RE: Changing serial protocol in BASIC-52            01/01/70 00:00      

Back to Subject List