-
The firmware is all
06/13/2016 at 06:30 • 0 commentsThe hardware is really the high point of this project. It's all quite pedestrian. It's a boost converter powering an ATTiny45. The tiny has to exercise the LED, watch for button activations, and sleep to minimize power usage when it's not doing anything.
For power management, the good news is that we can use the pin change interrupt to watch for button pushes. This allows us to drop the tiny into power down mode, which is the absolute lowest power usage possible. It won't be absolutely zero draw, since the boost converter will need to keep the 3 volts available, but the NCP1402 is fairly efficient at low power (battle tested in the crazy clock).
I've never done IR before, so it'll be interesting how best to supply a library and firmware "base" for this project. I envision a method that's called with the button number. The button push will wake up the controller, then it will call the method in question, which will decide what to do. An IR library (TBD) will be available to transmit with the LED. The user's method will be able to poll the button to see if it's still being pushed down and either auto-repeat the IR or not and when the button is released, the method can return, which will put the controller back to sleep.
-
Which AVR to choose?
06/07/2016 at 14:25 • 0 commentsThe boost converter portion of the project will be quite straightforward - it'll be a copy of the boost converter in the Crazy Clock based on the NCP1402. It'll be powered by a single off-board AA or AAA battery (at the discretion of the builder).
Next is which AVR to choose, and that choice comes down to the ATTinyx4 or ATTinyx5. And which of those to choose comes down to how many buttons are desired.
We lose 3 pins of the controller to power and !RESET (while you can turn !RESET into a GPIO pin, that means you can't program the chip conveniently after you do so). We lose another pin to the IR LED. We're left with either 4 or 10 pins left.
A joystick (up, down, left, right, and center) is 5 pins, but one workaround for that is to chord up and down to get an extra button. While adjacent directions can be chorded on a joystick, opposite ones cannot, so there's no ambiguity.
But is a joystick enough? We could use a button matrix to multiply the available buttons, but we would need more than 4 pins to do that (a 2x2 matrix is no better than just four individual wires). With the x4 chip, we could use up to a 5x5 matrix to get 25 different buttons.
None of this precludes in-system programming. As long as you don't push a button during programming, those lines would still be disconnected while programming was taking place.
Which direction should we go? A larger button matrix or a minimal joystick remote?