Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Serial I/O synchronization for 8051

  1. #1
    Junior Member
    Join Date
    Sep 2019
    Posts
    1

    Serial I/O synchronization for 8051

    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

  2. #2
    Senior Member
    Join Date
    Oct 2012
    Location
    Portland OR
    Posts
    676
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •