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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/15/05 13:03
Read: times


 
#87502 - The problem may be....
Responding to: ???'s previous message


SENDSPI:
; sends the value in ACC out the SPI port. also
; receives simultaneously into SPIDAT. SPI interrupt
; is triggered when transfer is complete.

CLR SS ; must pull slave's SS pin low first
MOV SPIDAT,OUTPUT ; trigger data transfer
;
; you must wait for the transfer to complete!
; I don't have the datasheet handy, so I can't give a
; complete answer!
;
SETB SS ;this gets set AFTER the transfer has completed!
RET



With SPI, the SS (or CS) signal must be active for the whole transaction. Since you have hardware SPI to shift the data bits out, you must poll a status bit for this hardware to tell you when the data has actually been sent, then put SS high.

I think this might go some way to solving your problem



List of 7 messages in thread
TopicAuthorDate
acdu812 and spi. program question            01/01/70 00:00      
   Try            01/01/70 00:00      
   CS in SPI            01/01/70 00:00      
   thanks.. but....            01/01/70 00:00      
   Sorry            01/01/70 00:00      
   The problem may be....            01/01/70 00:00      
      re:SPI on ADuC812            01/01/70 00:00      

Back to Subject List