|
| From: | Dig Kleppe |
| Subject: | Re: [avr-gcc-list] Learning about using SPI |
| Date: | Sun, 25 Feb 2007 11:07:53 +0100 |
| User-agent: | Mozilla Thunderbird 1.0.7 (Windows/20050923) |
|
Joerg Wunsch wrote: Juergen Harms <address@hidden> wrote: I disagree with Joerg ( first time i think) I implemented a system with 5 slave micros. ( witch are also programmed by SPI ). It took a while before i solved the problems Joerg meant: The master asks a byte: the slave must have this byte ready. I use the following trick: Every transmission starts with a fixed dummy byte. The slave has this byte already in the SPDR. On interrupt the slave puts the next byte of the response message in a buffer which is placed next time in the SPDR. This must happen fast: you have half the bit time to do this. If someone is interested i can supply the source. I use a kind of protocol : the size of mastermssg and response of the slave mssg can be different, also i added a CRC. Dig Kleppe |
| [Prev in Thread] | Current Thread | [Next in Thread] |