This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430G2553: Interrupt on first edge of a signal (pwm or others)

Part Number: MSP430G2553

Hi all,

I'm working on a software in which i'll have a 2 master and one slave I2C communication (software i2c on the msp).

In order to deal with the possible conflicts between both masters, the MSP is waiting for the other master to send the start condition (interrupt Hi/Lo): then a timer is started in order to allow the other master to finish the communciation which won't be longer than 1s.

Seems quite simple, however i'm struggling with the interrupt: indeed i keep on falling in the TI_TRAP and there is no way to enter the interrupt twice.

My code isn"t the one below, but all the interrupt related settings are in:

main(){

  P1IE |= BIT1; // P1.3 interrupt enabled
  P1IFG &= ~BIT1; // P1.3 IFG cleared
P1IES |= BIT1
__enable_interrupt();

 while (1)
  {

    __bis_SR_register(CPUOFF + GIE);        // Enter LPM0 w/ interrupts
  }
}
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
    {
    __bis_SR_register(BIT0&GIE); // LPM0 with interrupts disabled
 ///////////If the signal is a pwm one will the next "interrupts" be stored in a kind of queue?/////////////// 
        P1IFG &= ~BIT1; // P1.1 IFG cleared

        _delay_cycles(3200000); //so the other master finishes what it has to
        Function_READ();
                          __bis_SR_register(BIT1&GIE); // LPM0 with interrupts enabled

    }

Indeed we are waiting for the SDA line to go low. Is there something i forgot or have mistaken, what makes my software fall in the __TI_TRAP_sthg? I forgot to mention that we enter the interrupt once.

Thanks in advance,

Daniel

**Attention** This is a public forum