SPI Interrrupts

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI Interrrupts

Jump to solution
3,597 Views
v_dave
Contributor IV
Hello All,
 
My project uses the 56F8323 and Codewarrior for the DSC56F00\E. 
 
I am trying to setup the SPI port to be fully interrupt driven.  Using the PE SPI Bean it seems pretty straight forward.  In fact right now I have an Interrupt drivien transmit routine.  I need to go to the next level to finish my transimission sequence.  I need to know when the shift register is actually done sending the data.  I don't see an Event in the Bean.  I also have reviewed chapter 14 in the Peripheral User Manul and I don't see a flag or an Interrupt that lets you know when the shift register is complete. 
 
My issue is the particular SPI device I am talking to does not latch the data until the SS pin is raised.  so right now I have to start a timer loop that waits an estimated amount of time for the shift register to be done then raise the SS line manually.
 
I would like to have an INT (or at least be able to poll a flag) that tells me the shift register is done then raise the SS line.
 
Any ideas?
 
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,077 Views
rocco
Senior Contributor II
Hi Dave,

Since the SPI transmit and receive are synchronous to each other, one possible approach is to use the SPI's receiver interrupt as an indication that shifting has completed.

View solution in original post

0 Kudos
Reply
3 Replies
1,078 Views
rocco
Senior Contributor II
Hi Dave,

Since the SPI transmit and receive are synchronous to each other, one possible approach is to use the SPI's receiver interrupt as an indication that shifting has completed.
0 Kudos
Reply
1,077 Views
v_dave
Contributor IV
Hello,
 
Thanks for the quick reposnse. 
 
After reading your tip I rered the Peripheral User Manual and found in section 14.1.1 a small mention of using the Recieve interrupt as the TX Complete flag. 
 
This looks like a good solution.
 
 
0 Kudos
Reply
1,077 Views
bob_s
Contributor III
The receive interrupts works for me with one exception which is at best confusing.  If I send a zero value out the transmit port which is valid for my SPI slave, the receive interrupt on 8323 master does not occur.  Any explanations for this behavior?
0 Kudos
Reply