EmbDev.net

Forum: µC & Digital Electronics Attiny85v hardware interrupt unreliable


Author: Chris (Guest)
Posted on:
Attached files:

Rate this post
0 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.

Author: Christoph G. (chriska)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Sorry for the double text and missing code, I can't edit the post 
anymore.

I attached the code, you can also find it here: 
http://pastebin.com/hzw0j3FW

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.