1 Reply Latest reply on May 8, 2018 5:45 AM by bob.marlowe

    Interrupt to set flag, cann't see flag changed

    chris.olesen_3264186

      I am making an project where I would implement a start button.

      My plan was to initialize everything and the enter a while loop waiting until the button was press with code like this:

       

       

      bool START=false;

      main()

      {

      Init all

       

      while(!START)

      { }


      Program

      }

       

      And then having a interrupt changing START=true; 

       

      The problem is I can see the interrupt routine is called, but the program doesn't leave the while loop.
      I have tried to turn on a LED in the interrupt routine and the read the output pin afterward but that doesn't work either.

       

      I have isolated the problem to this archive, where i have placed an LED in port 1[7] to GND and uses Port 15[5] as button by pulling it low.

      pressing the button should turn on the LED.

       

      Any working solution for a button will be appriciated, but a fix or reason to the problem would be nice too