SPI Interrrupts

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

SPI Interrrupts

跳至解决方案
3,596 次查看
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?
 
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,076 次查看
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 项奖励
回复
3 回复数
1,077 次查看
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 项奖励
回复
1,076 次查看
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 项奖励
回复
1,076 次查看
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 项奖励
回复