cancel
Showing results for 
Search instead for 
Did you mean: 

Spurious interrupts

isaque
Associate II
Posted on August 20, 2004 at 09:46

Spurious interrupts

4 REPLIES 4
isaque
Associate II
Posted on June 28, 2004 at 14:52

ST72F264G2

Hello, I have a push-button on PC1, when its pressed the pin goes high (+5V). The pin is configured as input interrupt.

ld A, #$18 ; load A with XX01 1000

ld PCDDR, A ; configures port C[3..4] as output push-pull

ld A, #$1A ; load A with XX01 1010

ld PCOR, A ; port C Option Register

sim

ld A, #$c0 ; rising and falling edge

ld MISCR1, A

rim

When the button is pressed/released a LED should toggle ON/OFF, but sometimes it toggles without an action. How can I prevent it?

[ This message was edited by: ycks on 28-06-2004 18:23 ]
sjo
Associate II
Posted on June 28, 2004 at 19:09

As this pin has a pullup when in interrupt mode you would normally connect the other side of the button to gnd.

When the level goes low (falling edge) you would detect the button press. It also would be normal to have debounce in software (min 10ms), depending on whether you use external pullup resistor.

Regards

sjo
isaque
Associate II
Posted on June 30, 2004 at 15:57

Thanks, when button is pressed it goes Low (GND), my debounce routine has 66ms. Can it be caused by EMC disturbances?

alexanderczajor9
Associate II
Posted on August 20, 2004 at 09:46

It can indeed. Try an external pullup (i.e. 10k) to enhance robustness. Internal pullups can be quite weak (the spec says 80 kOhm to 250kOhm).