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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/16/09 05:31
Read: times


 
#161539 - How will you do that?
Responding to: ???'s previous message
Rishiraj Singh Ahuja said:
Am developing a project in which an 89C51 (A) sends a byte (from P3.1,(Txd)) to P3.0(Rxd) of an 89C2051 (B) (Serial comm. in Mode2, using timer1). I undertand that data is transmitted serially with LSB (least significant bit) first. Correct?

In that case if I load "01234567" in the SBUF of A it will appear as "76543210" in the SBUF of B. How do I convert the bits back to their original order? B needs the original byte to process it.

Just how do you propose to load SBUF with "01234567"? It only holds one character. If you send '0', it will send the '0' right away, provided you've set up the UART and timer/baud-rate-generator correctly. If you send the next character too soon, neither will arrive properly.

The character will arrive in precisely the order in which you transmit them, provided, of course, you do things correctly. If you don't, you needn't worry about the character order, as it will still be the same at both ends, but may be unintelligible.

Might seem like a trivial problem , but am foxed.

Rishi


If you spend a bit more time with the datasheet and "bible" as references, you'll see how all this works.

RE

List of 9 messages in thread
TopicAuthorDate
Decoding SBUF contents            01/01/70 00:00      
   How will you do that?            01/01/70 00:00      
      Refers to the order of the bits            01/01/70 00:00      
   Not the way UART works            01/01/70 00:00      
      Correct!            01/01/70 00:00      
         No It does not            01/01/70 00:00      
   Reveiving is the reverse process of Transmitting...            01/01/70 00:00      
      Thanks !            01/01/70 00:00      
         RE: totally on the wrong track            01/01/70 00:00      

Back to Subject List