Attiny85v hardware interrupt unreliable

Guest #3612696
Rate this post
useful
not useful
Hi,

I'm currently building a 433MHz remote with two buttons. The remote is 
controlled by an Attiny85v(8MHz). Sadly it does not work very reliable, 
sometimes it works other times nothing happens.

Here some explanations on what I did and why:

Each of the buttons triggers a pin change interrupt which wakes the 
Attiny from sleep. After that I check which button was pressed and turn 
on or off the lights via 433MHz switches. But those buttons don't work 
very reliable. Sometimes they do what they should other times I need to 
press them for several seconds before something happens, sometimes 
nothing happens at all. I don't know why, either I have a bug in my code 
or in the circuit for the buttons.

I use a 2.2k resistor to pull the button pins (0 and 1) to GND. When 
pressing the button, the pins will be pulled HIGH. To avoid "bouncing" 
of the tactile switch I added an 0.01uf capacitor in parallel.

I tried to keep the code simple and added comments.I am currently 
building a 433MHz remote with two buttons. The remote is controlled by 
an Attiny85v(8MHz). Sadly it does not work very reliable, sometimes it 
works other times nothing happens.

Here some explanations on what I did and why:

Each of the buttons triggers a pin change interrupt which wakes the 
Attiny from sleep. After that I check which button was pressed and turn 
on or off the lights via 433MHz switches. But those buttons don't work 
very reliable. Sometimes the do what they should other times I need to 
press them for several seconds before something happens. I don't know 
why, either I have a bug in my code or in the circuit for the buttons.

I use a 2.2k resistor to pull the button pins (0 and 1) to GND. When 
pressing the button, the pins will be pulled HIGH. To avoid "bouncing" 
of the tactile switch I added an 0.01uf capacitor in parallel.

I attached the commented code and images of my circuit as well as the 
final board.
Attached files:

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now