View previous topic :: View next topic |
Author |
Message |
deneme123
Joined: 05 Dec 2006 Posts: 3
|
problem with RB |
Posted: Tue Dec 05, 2006 6:38 am |
|
|
I am using 18f452 and I use 2*16 LCD which is mounted to port D upper and 4 bit
and I have a function when port b on change interrupt occurs which is mounted to my keypad
The problem is when I push a button and dont give up the interrupt occurs much more then one times and it takes intterrupt consecutively while I was pushing button when I give up pushing it run normal |
|
|
Ttelmah Guest
|
|
Posted: Tue Dec 05, 2006 6:56 am |
|
|
Are you reading portB, in your interrupt handler?.
You absolutely _must_ do this. The RB interrupt occurs, whenever the state of one of the lines, does not match the 'latched' version inside the chip. The value is latched whenever you read the port. If the latched version corresponds to the buttons being released, and the port is not read, then the interrupt will occur continuously while the button is pressed. If you read the port, it'll stop, and occur again, when the button is released. You may get several trigers though from any normal button, due to contact noise, being seen as several presses...
Best Wishes |
|
|
deneme123
Joined: 05 Dec 2006 Posts: 3
|
|
Posted: Tue Dec 05, 2006 7:21 am |
|
|
thanks a lot you solve my problem |
|
|
|