I'm working on a project to help me learn assembly language and I'm stuck on something. Looking for suggestions:
The program is pretty much an LED display that has several patterns it can display by scrolling through them using a push button switch interrupt.
Program flow:
1. Initialize
2. Go into infinite loop displaying light pattern 1
3. When button is pressed, first a switch bounce delay, then the program jumps to an infinite loop displaying light pattern 2, and so fourth...
I would like to set up an interrupt so that I don't have to constantly scan my button input port, but I can't think of a good way to do it.
Basically the program will stay in light pattern 1 forever UNTIL the push button is pressed, then I want it to go to a button bounce delay, and then go to the next pattern and stay there forever until the button is pressed again, then to pattern 3, pattern 4, etc...
There are some things I don't understand just yet in assembly, like if I could use some kind of lookup table here, and how I'd do it. I'd love to be able to tell the program "when you detect an interrupt, go to the next pattern" but another problem is that since an interrupt can be set from anywhere in the program, the interrupt wouldn't know what pattern it left from, so no way of knowing where to go next.
Like I said, I think I'm missing some crucial piece of information here, so help would be appreciated at this point.
The program is pretty much an LED display that has several patterns it can display by scrolling through them using a push button switch interrupt.
Program flow:
1. Initialize
2. Go into infinite loop displaying light pattern 1
3. When button is pressed, first a switch bounce delay, then the program jumps to an infinite loop displaying light pattern 2, and so fourth...
I would like to set up an interrupt so that I don't have to constantly scan my button input port, but I can't think of a good way to do it.
Basically the program will stay in light pattern 1 forever UNTIL the push button is pressed, then I want it to go to a button bounce delay, and then go to the next pattern and stay there forever until the button is pressed again, then to pattern 3, pattern 4, etc...
There are some things I don't understand just yet in assembly, like if I could use some kind of lookup table here, and how I'd do it. I'd love to be able to tell the program "when you detect an interrupt, go to the next pattern" but another problem is that since an interrupt can be set from anywhere in the program, the interrupt wouldn't know what pattern it left from, so no way of knowing where to go next.
Like I said, I think I'm missing some crucial piece of information here, so help would be appreciated at this point.