Interrupt to set flag, cann't see flag changed

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I changed your program to

using your own interrupt handler

set drive mode to resistive pull up

adapted to CY8CKIT-059 using switch and blue LED

Bob

View solution in original post

1 Reply