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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/17/03 15:09
Read: times


 
#52738 - RE: connecting two 8051
Responding to: ???'s previous message
in situations where i have had the uart being used for other purposes, i have implemented a synchronous link between two 8051's. i had to use several lines. clock, data, request and acknowledge (4 separate port pins.) i was in a hurry, otherwise i would have made the communication interrupt driven.

it is possible, not too complicated. all it requires is 50-100 lines of assembly code.

since you app is one way, i would just use a single pin from the sending micro to either be a request or a 'here is comes' signal, then use another line as a clock line for the third line, a data line.

put your data byte in the accumulator, shift a bit to the carry, put the carry bit on the data line, issue a clock pulse on the clock line, downcount a register which you have loaded with #8 and repeat the process until you have expired the register and sent all the bits. fairly trivial code. maybe 50 lines of well written assembler.

on the receive end, when you see the 'here it comes' signal, begin looking at the clock line. when you see a low to hi transition, read the data line into the carry, shift it into the accumulator, downcount and repeat until all 8 bits received, then save the byte. basically it is just a mirror image of the sender's code. another 50 lines.


good luck.

forrest









List of 11 messages in thread
TopicAuthorDate
connecting two 8051            01/01/70 00:00      
   RE: connecting two 8051            01/01/70 00:00      
      RE: connecting two 8051            01/01/70 00:00      
   RE: connecting two 8051            01/01/70 00:00      
   RE: connecting two 8051            01/01/70 00:00      
      RE: connecting two 8051            01/01/70 00:00      
         RE: connecting two 8051            01/01/70 00:00      
            RE: connecting two 8051            01/01/70 00:00      
   RE: connecting two 8051            01/01/70 00:00      
   Forget port pins, USE THE UART            01/01/70 00:00      
   RE: connecting two 8051            01/01/70 00:00      

Back to Subject List