SPI1_IRQHandler not firing
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-03-19 10:30 AM
Posted on March 19, 2013 at 18:30
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 help
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-03-19 10:41 AM
Posted on March 19, 2013 at 18:41
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?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-03-20 5:46 AM
Posted on March 20, 2013 at 13:46
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!