[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: My current project



On Mon, May 07, 2007 at 05:03:52PM +0000, Levente wrote:
> I'd like to give you a summary about my ongoing project. I am designing a bus
> system with RS422/RS232 interfaces. It is going to be a general purpose packet
> forwarding system built up by cheap devices.
> ...
> http://web.interware.hu/lekovacs/lbus/index.html

Things that I have found to be good in RS232 protocols:

1. A data length field makes things easier (as Dave suggested).

2. A start flag that looks as little like noise as possible.  

eg. maybe 0x5A - look at the bit pattern (including start and stop bits) 
and see if it might look like noise you might find on your serial line.  
Using 0xFF would be very bad, for example, because any single-bit-long 
noise spike is going to look like a start flag and then your firmware 
has to waste time/effort deciding that this is not actually a packet. 
(or have I got that backwards? - maybe I meant 0x00 was bad)
0x7E is not bad, but could it be better?

3. Does your CRC cover the packet header as well as the data?  I hate 
not knowing if the header is to be trusted!

4. Consider using a fletcher/adler checksum instead of CRC.  If it suits 
your application it has the advantage of being cheaper to calculate.  
This is particularly relevant if you end up talking to an 8-bit micro 
with few resources.

Karl.


PS: Lastly, and not very seriously, consider using an unambiguous date 
format in your documents "Updated on: 06.05.2007" can be interpreted in 
two different common ways.  It is good to have unambiguous documentation  
:-)


_______________________________________________
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user