Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here's an alternative protocol:</p> <pre><code>u8 Sync // A constant value which always marks the start of a packet u16 Length // Number of bytes in payload u8 Data[Length] // The payload u16 Crc // CRC </code></pre> <p>Use RS232/UART, as the PC (serial port) and the processor (UART) can already handle that with minimum fuss (just need a <a href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1798" rel="nofollow noreferrer">MAX232</a> chip or similar to do the level shifting).</p> <p>And using RS232/UART, you don't have to worry about master/slave if it's not relevant. Flow control is available if necessary.</p> <p>Suggested PC software: either write your own, or <a href="http://www.fuh-edv.de/docklight/" rel="nofollow noreferrer">Docklight</a> for simple monitoring and control (evaluation version is free).</p> <p>For greater error checking, simplest is parity checking, or if you need something more powerful, maybe <a href="http://en.wikipedia.org/wiki/Convolutional_code" rel="nofollow noreferrer">convolutional coding</a>.</p> <p>In any case, whatever you do: <strong>keep it simple!</strong></p> <p><strong>EDIT:</strong> Using RS232 with a PC is even easier than it used to be, as you can now get USB to RS232/TTL converters. One end goes into your PC's USB socket, and appears as a normal serial port; the other comes out to 5 V or 3.3 V signals that can be connected <em>directly</em> to your processor, with no level-shifting required.</p> <p>We've used <a href="http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm" rel="nofollow noreferrer">TTL-232R-3V3</a> from FDTI Chip, which works perfectly for this kind of application.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload