Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Per Westermark
10/30/11 16:01
Read: 460 times
Sweden


 
#184461 - Big problem
Responding to: Alexandre Marques's previous message
You shouldn't look for code for the simple reason that it isn't really possible to post a generic solution in software.

One solution is to stop everything else the processor is doing (including anything that generates interrupts) while communicating. But that requires the master to hold the slave-select line for long enough before the data starts to arrive, that the slave have time to react and deactivate everything else. Even when the slave does nothing but busy-looping, checking for SPI state, you must keep down the communication speed, taking into account the slowest code path in your polling loop.

Another solution is to run the master so slow, that you can have a timer interrupt poll data, clock and slave-select lines often enough to catch the communication.

But whatever you do, it will hurt.

List of 20 messages in thread
TopicAuthorDate
SPI Slave in 89S52      Alexandre Marques      10/30/11 13:35      
   Get real processor      Per Westermark      10/30/11 14:29      
      Topic Author Date      Alexandre Marques      10/30/11 14:46      
         Big problem      Per Westermark      10/30/11 16:01      
         Look for a different model      David Prentice      10/30/11 18:31      
         Try 8051 BASCOM      KONSTANTINOS L. ANGELIS      10/31/11 05:37      
            at what speed      Erik Malund      10/31/11 07:06      
               Interpreters have an easier life.      Per Westermark      10/31/11 08:54      
               Soft SPI speed      KONSTANTINOS L. ANGELIS      10/31/11 09:31      
                  But how to combine that loop with a real program?      Per Westermark      10/31/11 09:44      
                     and more      Erik Malund      10/31/11 09:51      
                        Software master trivial - slave is not      Per Westermark      10/31/11 10:52      
                           SPI analysis is made, results?      KONSTANTINOS L. ANGELIS      10/31/11 14:43      
                              There _may_ be a solution - but maybe not acceptable      Per Westermark      10/31/11 16:05      
                  sure, and so what?      Erik Malund      10/31/11 09:47      
                     SPI at 100Kbps      KONSTANTINOS L. ANGELIS      10/31/11 16:51      
                        Still gives puny transfer rate with significant limitations      Per Westermark      11/01/11 01:05      
                           the answer is      Erik Malund      11/01/11 06:37      
   Fully Interlocked Handshaking.      Michael Karas      11/01/11 08:01      
      Quite common      Per Westermark      11/01/11 08:52      

Back to Subject List