General programming

Moderators: None (Apply to moderate this forum)
Number of threads: 1642
Number of posts: 2791

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
UART - 1 Master + Multiple slaves Posted by Devoney on 19 Mar 2012 at 11:46 AM
Hi All,

I am experiencing difficulties with package loss and data overlapping (mixing of packages from several units) with UART.

Scenario:
- Because of low power consumption, the slaves wake up (at random intervals), perform their tasks and send the data to the master. The communication is therefore iniated by the slave.
- The master receives the data and sends an acknowledgement to the slave. The slaves attempts to send the data again for 20 times while no acknowledge is received.
- Slaves all send to the master, and do not receive each others data.
- The master sends to all slaves that are listening on that moment, programmatically I filter which slave should actually parse the message (The first two characters are the ID for which the message is ment for).

So far so good. But... I have package loss because of great distances. To overcome the affect of package loss I let the slaves sent their request/data again when the server does not acknowledge the data. No acknowledgement means noise in the line of communication.

I am using XBee (Zigbee) units (1 coordinator, the other two are end devices).

I use 9600 baud, even parity, 8 data bits, 1 stop bit and XON XOFF handshaking. RTS and CTS are not available (by default) on the XBee module (arduino shield), so no hardware handshaking in my case.

Most important question: How to prevent data packages to get mixed up. By mixing up I mean, unit 1 sends, but before all the bytes were sent, unit 2 send in the middle of it.

Thanks in advance. Hopefully I made myself clear, I want to keep it a relatively short post.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.