oky I want to know which input is pressed so I decide what to do ?
oky I want to know which input is pressed so I decide what to do ?
So, you do not need a "change" on the pins.
You have buttons and they can only be pressed, right?
"Change" means =>
If the button is pressed, there is a change. While the button is being pressed, there is no change.
If the button is released, there is also a change.
Are you sure you need interrupt to do this? any particular reason? Many people can solve their issues without using interrupt; simple pin readings can be more then good enough. This may be true in your case, may be.
You may want to check the status of a port for all six pins.
Last edited by sayzer; - 19th February 2008 at 16:52.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Hi Sayzer,
Looks like he wants an assembly interrupt to jump out of any running process.
looks like a job for instant interrupts."beacuse our system entering in multiple sub routines so using polling way in main code not visible when our programm entering in another subroutine"
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Thanks
I think sayzer understand what I mean, but I think without interrupt we can't know what button is presesd due to busy of my porgramm in other sub routines than main code
It sounds like you have more inputs than you have PORTB interrupt pins - or maybe your switches aren't connected to PORTB at all.
In that case, you could write an interrupt routine on a timer. The interrupt would read all ports connected to the buttons into variables, then return from the ISR.
Your main program can then (bitwise) AND the variables with a mask to pick out
which button was pushed.
Charles Linquist
iugmoh, Why not use 1 interrupt pin with a pullup resistor tied to as many diodes as you have switches. Then have 1 port change interrupt read the switch inputs and give the results? Why make it so complicated? Just a thought......
Dave Purola,
N8NTA
Bookmarks