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.

problem with __interrupt void Port1_ISR (void) on MSP430FG4618

Hi,

I work on a MSP430GH4618, I find difficulties with SW1 and SW2. Indeed on the interrupt level “__interrupt void Port1_ISR (void)”, I cannot activate twice the same pushbutton successively for two different functions. For example I want support on S1 to reveal a menu then Second once on S1 to choose options among others in the menu.  it carries out the code which corresponds to 2nd supports. Some said that I must return to the main program before the second supports, and others said that I must use a timer. I don’t know how to make.

I am blocked help me please

My code is the following:

//*********************************************************************************

void main(void)

{

  volatile unsigned int i;

 

  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

  FLL_CTL0 |= XCAP14PF;                     // Configure load caps

 

  // LFXT1 startup delay

  do

  {

    IFG1 &= ~OFIFG;                         // Clear OSCFault flag

    for (i = 0x47FF; i > 0; i--);           // Time for flag to set

  }

  while (IFG1 & OFIFG);                     // OSCFault flag still set?

// Configuration du port P1

 

  P1OUT = 0;                            // All P1.x reset

  P1IES = 0x03;                         // P1.0, P1.1 hi/low edge

  P1DIR = 0xFC;                         // P1.0/1 = input (switches)

  P1IE |=BIT0+BIT1;

 

  // LCD_A

 

  LCDACTL = LCDON + LCD4MUX + LCDFREQ_128;  // 4mux LCD, ACLK/128

  LCDAPCTL0 = 0x7E;                         // Segments 4-27

  P5SEL = 0x1C;

  Test_LCD();

__bis_SR_register(LPM3_bits + GIE);   // Enter LPM3 w/ interrupt

}

//******************************************************************************

void Test_LCD(void)

{

}

//********************************************************************************

void bagage_1 (void)

{

}

//********************************************************************************

void yes(void)

{

}

//******************************************************************************

// PORT1 interrupt handler : traitement de l'interruption

//******************************************************************************

 

#pragma vector=PORT1_VECTOR

__interrupt void Port1_ISR (void)

{

  volatile unsigned int i, j;

 

     for (i = 10000; i > 0; i--);          // Button debounce delay

      j = 10000;                            // Initial delay

  

 // si S1 et !S2

        if ((!(P1IN & 0x01))&&(P1IN & 0x02))

        {

          yes();

          if(P1IN & 0x02) baggage_1();

        }

       

}

**Attention** This is a public forum