Skip to main content
danielblesener9
Associate III
March 19, 2013
Question

SPI1_IRQHandler not firing

  • March 19, 2013
  • 2 replies
  • 1135 views
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 topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    March 19, 2013
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    danielblesener9
    Associate III
    March 20, 2013
    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!