Home | Contact | Projects | Post Mortem | Publications | Pictures | Private | Blog


usbtiny-ir-lcd-switch


Software:20100416-7ae8ce3 based on usbtiny 1.4
git:soon
Board:Circuit, Layout, Parts layout
Reference:Dick Streefland's usbtiny

Atmel has a neat microcontroller series called AVR, which is especially suited to use for hobby projects due to pricing, availability, ease of use and reprogramming (all have flash), and open source toolchains (which I'm working on for openSUSE). For this microcontroller Dick Streefland has created a software based USB protocol implementation called usbtiny, including an application to receive IR remote signals with an igorplug-usb compatible protocol.

I have stripped down the code so that I was able to add detection of a single programmable IR signal. When the signal is detected, an output pin triggers a power button press for 250ms. That way e.g. media center PCs can be switched on remotely. The current state of the project is available for download, the git repository is probably following soon. I suggest using gcc 4.3.3 for cross compiling (available for Debian, or from the openSUSE project), because the code is pretty fragile on compiler changes due to manually coded preambles. usbtiny version 1.5 should improve that (see below).

Two python scripts are included, one for reading raw ir values and checking for minimum/maximum intervals (train.pl) and one for programming those values (prog_switch.py). The latter takes a raw layout, there is a script to reformat and "soften" the values (do_prog_eeprom_ffwd.sh) - all of which isn't really polished yet. I would rather include the reformating in prog_switch.py, but my Python isn't really good enough for that without major pain (and I couldn't get the Perl libusb bindings running).


My changes were based on version 1.4 of Dick's project, however, in the meantime Dick released version 1.5. These changes have not been incorporated yet.

Also, Dick and I currently disagree on the maximum number of cycles that interrupts may be disabled - and it's not completely clear who is missing what in the calculations :-) Currently I stick with my more conservative numbers. An excerpt of the discussion can be found here, so please comment if you think you have found a solution for us.

The current implementation just barly fits into an AVR Tiny 2313 (which has 2048 bytes flash, 128 bytes RAM, and 128 bytes EEPROM) when all features are enabled: it uses 2044 bytes Flash, 123 bytes RAM, 70 bytes EEPROM... Pretty dense, eh?

During this project I decided to revive my passing knowledge about board layouting and etching. For layouting I have used kicad, IMHO the first open source layouting software that is actually usable, so I don't have to use proprietory software like Eagle (which is pretty ok by itself). I'm using the classical approach, printing to film via a color laser printer (they have higher toner coverage than b&w printers), exposing boards with light-sensitive resist to UV-A, and finally etching the result with half-concentrated hydrochloric acid and little(!) concentrated hydrogen peroxide. I won't give details here, because the resulting acid mix may be harmful (even producing chloric gas if not handled right) and should be left to people that have at least a little understanding how the chemicals might react. Google for it if you think you're fluent enough in inorganic chemistry.

The result looks pretty good, the 8/10 mil raster shows excellent sharpness and only very little undercut. Especially considering that the material and chemicals have been laying around here unused for - what? - 20 years...

There's only a small gap in one of the circuit paths, looking like the base material had been damaged (the film is 100% ok in this region). Anyway, the resulting board is working just fine when this gap is closed :-)