??? 10/31/11 15:44 Read: times |
#184486 - But how to combine that loop with a real program? Responding to: ???'s previous message |
Konstantinos L. Angelis said:
If the soft Slave_SPI accept/respond loop is written in hand optimized assembly, a speed about 100Kbps is achivable, even with a 12MHz (x1) AT89S52. For the BASCOM SPI slave interface, response must be slower, maybe up to 10Kbps. For experimenting if the OP adds a validation routine to data/responses between Master and Slave devices then a secure channel to exchange data can be implemented.
You are ignoring two things. 1) Your hand-optimized assembly requiers zero (!) interrupts enabled. 2) The processor must be fast enough to detect the slave-select activation, to enter that hand-optimized assembly loop. This may often require that you run that loop inside the ISR, with slave-select as an external interrupt. Your main loop will probably not be fast enough to detect the slave select before you have already missed the first data bit. The issue isn't how fast your assembly loops can operate. The issue is how to handle communication that you can't know when it starts (since we are talking about the slave) while still being able to have the processor do something else - at least while SPI isn't pushing data. Remember also that SPI is two-way. Some protocols only sends simplex and then potentially switch direction for an answer. But SPI is always full duplex. Your hand-optimized assembly might have a big problem knowing what to do when it's time to send back an response, since it has been busy cheking bits and not spent any time analyzing the contents of already received words. |
Topic | Author | Date |
SPI Slave in 89S52 | 01/01/70 00:00 | |
Get real processor | 01/01/70 00:00 | |
Topic Author Date | 01/01/70 00:00 | |
Big problem | 01/01/70 00:00 | |
Look for a different model | 01/01/70 00:00 | |
Try 8051 BASCOM | 01/01/70 00:00 | |
at what speed | 01/01/70 00:00 | |
Interpreters have an easier life. | 01/01/70 00:00 | |
Soft SPI speed | 01/01/70 00:00 | |
But how to combine that loop with a real program? | 01/01/70 00:00 | |
and more | 01/01/70 00:00 | |
Software master trivial - slave is not | 01/01/70 00:00 | |
SPI analysis is made, results? | 01/01/70 00:00 | |
There _may_ be a solution - but maybe not acceptable | 01/01/70 00:00 | |
sure, and so what? | 01/01/70 00:00 | |
SPI at 100Kbps | 01/01/70 00:00 | |
Still gives puny transfer rate with significant limitations | 01/01/70 00:00 | |
the answer is | 01/01/70 00:00 | |
Fully Interlocked Handshaking. | 01/01/70 00:00 | |
Quite common | 01/01/70 00:00 |