Hello to everyone , I the the following code using assembly language in Atmel studio.
MAIN: LDI R20,HIGH(RAMEND)
LDI R20,(1<<INT0) | (1<<INT1)
HERE: JMP HERE
i2: LDI DDRB,0x02
I have built the circuit for this code in a breadboard. I have connected two switches. What it does is, when the first button is pressed it does i1 routine and so on. Everything works well except one thing.
I am experiencing bouncing in switch. Sometimes it takes two inputs at once. I don't want to use a capacitor to fix this. Can someone help me to write a delay program in the main code? I am expecting to make a 50ms delay.
Thank you very much for your time and attention.