[bascom] SV: RS485
Eric Le Baron wrote:
>Hi all,
>
>For my project I will have about 10 modules interconnected by rs485.
>Total cable length less than 100 metres and the baudrate 115K2.
>Each module will have its own address.
>3 modules will have a display and a keypad and must be able to quickly
>retrieve actual data from the 7 modules.
>This could be done on-demand or whenever the data of one of the modules
>changes.
>For the communication I will use the 9-bit format where the 9th bit will
>determine whether the byte represents an address or data.
>The packet length will be 64 bytes at most and the overall traffic on the
>network will be light.
>
>I've been reading Jan Axelson's book "Serial port complete" but I do not
>want to use a master/slave or token-passing protocol and she says that the
>collision detecting protocol is not suitable for rs485 ?!
>I'm hereby seeking for general advise, dos and donts.
>A possibility to upload the program over rs485 would be fantastic.
>
>Thanks,
>
>Eric Le Baron
>Wageningen
>The Netherlands
Why not take a look at the SNAP protocol. It is a free and open protocol
that can be used for peer to peer(or master/slave, or point to point)
microcontroller comunication.
As one of the originators of this protocol I know it works, and my friend
Christer is currently operating a small network in his apartment using SNAP
over Powerline, Radio, and RS485.
Ok that RS 485 were designed for master / slave communication, and
therefore aren't very suitable for peer to peer or collision detecting
protocols (the communication circuits have no Carrier detect, or "media
busy" signal) but, with a few components you could easily make your own.
Actually even with a CD signal there will allways be some small risk of
collision, so some form of data error detection and correction will often
be needed in peer to peer networks.
Hope this helps you a bit.
The good news is that there we have already developed a' SNAP program for
the Atmel 89C2051 in Bascom Basic.
You or anybody else are very welcome to use it freely.
It uses the SNAP protocol and 16bit CRC error detection in a peer to peer
network. Take a look at URL:
www.hth.com/snap/
were you will find Basic programs with full source code listing, schematics
in PDF format as well as the SNAP documentation.
Hope you find something useful.
Regards
Robert Zachrisson