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

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.