...to hear how my friend rob is spending a lot of time in the gym. My character is already fucked, so why waste time in the gym? It's spent way more productively with soldering iron in one hand and a datasheet printout in the other ;-)

Latest example: I talked to rob earlier this evening (about 3.5hrs ago), and he asked me how hard it would be to make a Hardcore Gym Timer, so that he can keep his "8 second blast/12 second slow" training regime precisely.

Easy, says I, already mentally thinking about how much user interface this thing needs. rob mentions some controlling thingie to show a countdown on some display, but while I have two small LCD modules at home ready for projects, they're a) spoken for and b) too much hassle to setup ("Look Ma, no effort!") just for counting down. (The controlling thingie would be a PIC microprocessor, of course.)

When in doubt, use LEDs. Three of them, blinking suitably, suggests I. rob agrees and I go scrounge up bits. As usual something is lacking: battery holders! I have some button cell batteries, pic micros and sockets and LEDs and resistors and wire and a "housing", but no battery holders.

When in doubt, use brute force and a hot soldering iron: I simply soldered some wires straight onto the batteries (which of course fucks them up somewhat, but I worked quite fast and even if they last only half their usual life time it'll be enough). Messy but sufficient.

 2007_07_07-robs-timer-innards.jpg  2007_07_07-robs-timer-rear.jpg

The housing is an old plastic case of a DAT backup tape, we have three leds (green, orange and yellow), one on-off switch and one reset button. Oh, and one PIC 12F629 being bored and vastly underworked (because I didn't have any simpler/cheaper pic at home; I admit that I did check the price list to see which pic was the cheapest to sacrifice...).

 2007_07_07-robs-timer-front.jpg

Orange blinks at 1Hz for 4 seconds, at 2Hz for 2 seconds and the last two seconds at 4Hz together the Yellow Warning LED; then Green blinks at 1Hz for 8 seconds, at 2Hz for 2 seconds and the last 2seconds...you get the picture.

Of course I soldered things up wrongly first (stupid datasheet: Vss is ground, Vdd is juice and I always mix these up), and apart from the DIL socket it's pretty much ugly "dead bug" style. The pic is socketed because a) gpsim doesn't grok the 12f629, so testing with the simulator is out and a few code-flash-test cycles were necessary, and b) so that I can mod things easily if/when rob wants extra bells and whistles (yes, I know about in-circuit-programming but I'm too lazy to set that up).

Also, the builtin 4MHz oscillator is quite a bit off, so I used brute force and ignorance and simply made some delays longer to get the timing to match up somewhat. I hope rob won't mind 1/10 of a second here or there!

For other PICheads and solder sniffers here's the (very boring and unsophisticated) source code, with the (sophisticated and unboring) delay gadgets.

[ published on Sat 07.07.2007 00:55 | filed in interests/tinkering | ]
Debian Silver Server
© Alexander Zangerl