2007-11-28 08:47 PM
2011-05-17 12:48 AM
Solved! Just a question of the spi-protocol. Its master-controlled and bidirectional. Of course i read something if i write data, with every clock, a bit is written on mosi and a bit read from miso. Deductive the interrupt is occured.
[ This message was edited by: soundso on 29-11-2007 10:18 ]2011-05-17 12:48 AM
Help! I trying to use the spi with interrupts but it doesn't work in the right way. First i had the problem that the interrupt handler was continuous called and after some tests it seems like that it happen because the RxBuffer is never empty (RxFifoNotEmpty-Flag is always set). In the following code, the inside of the while is always executed and return a 0xFF in normal mode and the sended value in loopback-mode. Anybody knows the problem and how to fix? What is wrong?
My main loop after initialisation: while(1){ SSP_SendData(SSP0, 0xAA); while(SSP_GetFlagStatus(SSP0, SSP_FLAG_RxFifoNotEmpty)==SET){ // Always executed! data = SSP_ReceiveData(SSP0); SSP_ClearFlag(SSP0, SSP_FLAG_RxFifoNotEmpty); //Necessary??? }; }; I use a str9-dongle with str912fa and the related software lib. [ This message was edited by: soundso on 28-11-2007 17:49 ]