The Artima Developer Community
Sponsored Link

Python Buzz Forum
attiny461-atx

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Aaron Brady

Posts: 576
Nickname: insommeuk
Registered: Aug, 2003

Aaron Brady is lead developer for Crestsource
attiny461-atx Posted: May 15, 2016 11:26 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Aaron Brady.
Original Post: attiny461-atx
Feed Title: insom.me.uk
Feed URL: http://feeds2.feedburner.com/insommeuk
Feed Description: Posts related to using Python. Some tricks and tips, observations, hacks, and the Brand New Things.
Latest Python Buzz Posts
Latest Python Buzz Posts by Aaron Brady
Latest Posts From insom.me.uk

Advertisement

As with many of my projects, this one deserves more of a write-up than I have time to give it right now. I wanted to get it up on GitHub so that anyone else looking for an example of using the timer interrupts / ISRs on the ATtiny461 can find it.

The algorithm is basically:

  • If the power is off, turn it on when the button is pressed.
  • If the power is on, don’t turn off on a single press.
  • If the power is on and the button is held for 6 seconds, turn the power off.
  • If the button is held after the power has been turned off, don’t turn on until it’s released first.

Hopefully the code is commented enough to be useful: set up the prescaler and the ports, then enable interrupts and do everything else in the ISR.

The Makefile is from Markus Conrad’s project, and was invaluable for getting things up and running. I used a BusPirate for programming, though I’ve gotten a real AVR programmer in the mean time, so I’d like to revisit and finish this.

Read: attiny461-atx

Topic: Learn to Solder Badges Previous Topic   Next Topic Topic: 22

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use