interrupt problems with button

Status
Not open for further replies.
I am working on the same project as matlark. we are working with a PIC 16F887 on MPLAB IDE 8.0 software.

we are trying to display LEDs in rotation initially, then when a button is pushed two die values should display, after another button push the program should return to the LEDs rotating.

however the interrupt for the button seems to go unrecognized. I attached my program as well.
 

Attachments

  • dice w interupt.asm
    7.9 KB · Views: 120
i forgot to mention that i tried your(atomsoft) code and the LEDs rotated but the button did not change the state.
 
so instead of two die values you want 2 dice values lol ok maybe i can understand more now lol So you have LEDs representing some dice and want its to rotate the LEDs and when a button is pressed it stops on a random dice values and then waits and continues like its rolling dice?
Does this sound true?
 
Based on what I read;

the dice should be rotating on startup, when the button is pressed, they would stop on a random(As Random as it can get) value. It should remain on those values until the button is pressed again, where it would go back to rotation.

I looked through the code (quickly) and I didn't see a de-bounce, or did I miss it??


-BaC
 
Last edited:
sorry everyone. i was thinking of two values, one for each die. Anyways here is how the program should work:

LEDs rotate--> button press-->display dice-->button press again-->go back to LEDs just rotating. the rotation is just shifting of the LEDs thats all.

There is not a debounce as of yet.
 
im still here but had to work yesterday sorry um... we have to make another variable that has to be set when isr is done so when we go into isr again thats the first thing we check and if set skip and goto rotate and if not set then skip all other code and goto a infinite loop until a interrupt is brought up again like:

check IntVar if 0
show dice
if 1 then
rotate...
 
Funny, I didn't know there was programmers in Brooklyn, let alone good ones! Next you will tell me your from Bensonhurst..hehe jk

Have to say, I miss home! Cali is OK but it's no NY!

-BaC

 
Last edited:
Heh lol thanks Im from Bushwick in brooklyn.. I was thinking about cali too but i hear its too much $$$
 
It's really not much more than NYC.

Well they say, If you live in NY you get to hard, in Cali you get too soft. I have both so I should be just right.lol

-BaC
 
lol...

Sorry i havent been writing on this just bee working on something of my own lately. I might re-write this whole code to something similar just to get a fresh perspective since i know what needs to be done.
 
Yep, I tend to do that myself. Easier to write it from scratch than trying to read others code. Everyone has their own style and flow


-BaC
lol...

Sorry i havent been writing on this just bee working on something of my own lately. I might re-write this whole code to something similar just to get a fresh perspective since i know what needs to be done.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…