Serial I/O synchronization for 8051

Status
Not open for further replies.

mik3ca

New member
Since the PJRC site has a section dedicated to the 8051 microcontroller, I thought this would be a good place to post such a question.

I'm currently making two of my own devices which are supposed to talk to each other wirelessly.

The funny thing is if I start both devices at the right time, then the communication is smooth. But if the start timing is off enough, then I get no communication.

The way the wireless connection is done is through the AT89S serial port connected to HM-TRP radio modules.

I made myself a 3rd device which allows me to see the wireless traffic on my PC.

So what I think I need to achieve here is a way to literally synchronize the serial ports on both microcontrollers so that the correct bytes are received on each at the correct times.

As for the timing components, I fitted the crystals and the 5pF NPO (5% tolerance) capacitors very close to the XTAL pins of the micro.

I remember somewhere that the guy running PJRC made a program involving access to port P3.0 to auto-set the baud rate of the serial port so I might need something like that?

Anyone got any idea how I can synchronize the wireless devices so that when the master sends a byte at any time, the slave receives the full byte (not 7 or less bits because of what I think is clock drift)?

I know I'm rambling now, but I need to get an answer
 
It does? I didn't even realize it. Ah, I guess you mean this: https://www.pjrc.com/tech/8051/index.html
You might also note the bottom of that page: Last updated: February 24, 2005

I don't know what Paul of PJRC has done since then along those lines. I'm just a Teensy customer. Personally I last worked with 8051 devices about 20 years ago so I'm afraid I'm not much help. This forum is generally about the Teensy line of boards that PJRC sells (mostly 32-bit ARM-based with a few legacy 8-bit Atmel devices), and the forum started around 2012 if I recall.
 
Status
Not open for further replies.
Back
Top