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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/14/05 20:29
Read: times


 
#103708 - Correct
Responding to: ???'s previous message
Ian Bell said:
I have had a quick look at the code and I think the problem could be in the spi code. You push 6 bytes onto the stack, then pop them off in a loop while transmitting spi - OK so far, pushes equal pops.


I commented on this exact problem here: http://www.8052.com/forum/read.phtml?id=103690 .

He's pushing data onto the stack, calling a routine to process it (send the data via SPI), but the SPI routine is actually popping the return address and sending it via SPI rather than the data... and he's then returning to a totally messed-up return address since the return address is no longer on the stack.

Regards,
Craig Steiner


List of 11 messages in thread
TopicAuthorDate
Stack pointer causing code to loop?            01/01/70 00:00      
   Try using a simulator            01/01/70 00:00      
      declaring variables            01/01/70 00:00      
         careful            01/01/70 00:00      
   push and pull            01/01/70 00:00      
      Correct            01/01/70 00:00      
         ah.. so if I change...            01/01/70 00:00      
            Uh, no            01/01/70 00:00      
               in same sub            01/01/70 00:00      
                  Try a Ring Buffer            01/01/70 00:00      
   code changed so push/pops in same sub            01/01/70 00:00      

Back to Subject List