??? 10/19/04 07:52 Read: times |
#79554 - RE: Just use SPI Responding to: ???'s previous message |
hi,
although the usage of SPI might be an idea I should indicate some notes: 1) Put the device into SLAVE mode. In this mode you can receive bit at any baud rate up to 1 machine cycle (1us at 12MHz clock). Some Atmel derivatives, for example AT89C51RD2, require for that the maximum SCK frequency allowed in slave mode must not be above 1/4 of peripheral clock. 2) Use the channel receive data strobe for synchronization of receiving the new byte (the first half of the 16-bit word). Maybe. But this signal is active high and what is the bad as well: it may ends at any level of CHAN_TX_CLK so SPI mode is hardly defined. 3) After receiving the first half of the word, keep receiving the next one. 52us is more than enough time to save byte and refresh the receiver buffer pointer to be ready to receive another portion of the frame. Well, datasheet of AT89S53 does not indicate next "feature" of SPI called Overrun Condition. Nevertheless I think this still presents: "An overrun condition occurs when the Master device tries to send several data Bytes and the Slave devise has not cleared the SPIF bit issuing from the previous data Byte transmitted. In this case, the receiver buffer contains the Byte sent after the SPIF bit was last cleared. A read of the SPDAT returns this Byte. All others Bytes are lost." It means that if the slave is not in time to read SPDAT before next bit transaction then it losts next byte. Unfortunately, Atmel`s SPI does not detect this condition and so there is no way to know that such error happened. Indeed 52us is good reserve but is it enough always? What if some other interrupts at same or high priority level "eat" this time. Maybe AT89S8253 may helps then with its double buffered SPI. Regards, Oleg |
Topic | Author | Date |
interface 16-bit Synchronous serial data | 01/01/70 00:00 | |
RE: interface 16-bit Synchronous serial data | 01/01/70 00:00 | |
RE: interface 16-bit Synchronous serial data | 01/01/70 00:00 | |
RE: interface 16-bit Synchronous serial data | 01/01/70 00:00 | |
RE: interface 16-bit Synchronous serial | 01/01/70 00:00 | |
RE: interface 16-bit Synchronous serial | 01/01/70 00:00 | |
RE: interface 16-bit Synchronous serial | 01/01/70 00:00 | |
RE: interface 16-bit Synchronous serial | 01/01/70 00:00 | |
RE: interface 16-bit Synchronous serial | 01/01/70 00:00 | |
RE: interface 16-bit Synchronous serial | 01/01/70 00:00 | |
Just use SPI | 01/01/70 00:00 | |
RE: Just use SPI | 01/01/70 00:00 | |
RE: Just use SPI | 01/01/70 00:00 | |
RE: Just use SPI | 01/01/70 00:00 | |
RE: Just use SPI![]() | 01/01/70 00:00 |