2013-03-19 10:30 AM
I am very confused - this should be fairly straight forward.
I am operating in SPI_Direction_2Lines_FullDuplex mode. I am set for transmitting, and can see correct output of data on scope. I enabled the TXEIE interrupt. The compiler see's it as valid code, but it never gets there. I am disabling the intterupt in the compiler, and have tried turning the interrupt on after I start transmitting and before. Any ideas what this could be? Below is some code. chip_selectSPI1(); //Select slave if(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE)) //If done with previous transmit { SPI_I2S_SendData(SPI1, TEST); //Load transmit buffer SPI_I2S_ITConfig(SPI1, SPI_I2S_IT_TXE,ENABLE); //Enable interrupt }Any ideas? For now, all I want to get working is this interrupt, not BIMODE communication.Thanks for the help2013-03-19 10:41 AM
The compiler see's it as valid code, but it never gets there.
The compiler just confirm it's syntactically correct, and that's a pretty low hurdle, it says nothing about the viability or functional correctness. I can't see enough of the code to speak to that. Have you enabled the interrupt in the NVIC? How do you know it's not firing? Is it ending up in the Hard Fault handler?2013-03-20 05:46 AM
Thank you for the reply. Turns out it was a stupid mistake. I thought the function SPI_I2S_ITConfig(SPI1, SPI_I2S_IT_TXE,ENABLE); would initialize the interrupt as well. So no, I did not initialize the interrupt in the NVIC.
As always, you were helpful Clive!