Skip to main content
Graduate
April 17, 2025
Question

STM32G4 Interrupt Enables I2C

  • April 17, 2025
  • 1 reply
  • 280 views

Is it necessary to enable interrupts in I2C_CR1 if I only want to look at the flags but don't want to go into the interrupt service routine? For instance, I want to be able to look at the status of RXNE and see if it is set, but I don't actually want go into an interrupt routine. Can I just leave RXIE (the bit that enables the interrupt) as 0?

I am keeping RXIE as 0 for now, and I am still seeing RXNE get set when Rx data comes in. Is this normal?

    This topic has been closed for replies.

    1 reply

    Super User
    April 17, 2025

    > Is it necessary to enable interrupts in I2C_CR1 if I only want to look at the flags but don't want to go into the interrupt service routine?

    No.

    > For instance, I want to be able to look at the status of RXNE and see if it is set, but I don't actually want go into an interrupt routine. Can I just leave RXIE (the bit that enables the interrupt) as 0?

    Yes.

    > I am keeping RXIE as 0 for now, and I am still seeing RXNE get set when Rx data comes in. Is this normal?

    Yes.

     

     

    Nothing wrong with keeping interrupts disabled and looking at flags instead.