This probably does not qualify as a project but here goes anyway...
Earlier today I picked up a couple of PCF8574A I2C controlled 8 bit IO-expander ICs. They where actually meant for another project but I thought I'll get to know them first so I spent the evening with my dear Netduino mini and came up with this IR remote controlled hd44708 LCD panel with the word "brightness" misspelled and all:
Mini_PCF8574A.JPG 59.44KB 108 downloads
The mini uses the I2C IO-expander IC to control a classic 2x16 character Hd44708 LCD which runs in 4 bit parallel mode thanks to the PCF8574A. The IC is used to create a 5 bit bus of which 4 are data (LCD pins d4..d7) while the 5th bit is used for clocking (LCD E pin). This makes the LCD run a lot faster compared to pure bit-banging.
The PCF8574A is what they call "quasi" bi-directional and actually does work in both directions. Basically it's a really simple and cheap way of getting another 8 fresh GPIOs and it's available in a breadboard friendly DIP16 package. It even has an interrupt pin that can be used to tell the micro that an input pin has toggled. When cranking up I2C to the IC's max of 100kHz, my Netduino mini can toggle the pins at ~1kHz.
Two PWM channels are used to control contrast and brightness respectively and the LCD backlight runs directly of the 3V3 PWM output since it only draws a sheer ~4.5mA.
I also recycled some code from another project to implement a NEC IR receiver using a 38kHz IR receiver and took a ridiculously cheap eBay remote control out of my junk box. Just stick the receiver down the breadboard, feed it 5V, connect the output to a digital input of the mini and you're good to go.
It all came out pretty mean and lean, the only passives are a couple of 4k7 I2C pull-up resistors and the whole thing runs off a 9V battery consuming ~30mA with the LCD in full bloom.
It doesn't really do much yet, it simply receives the IR commands and displays them on the LCD - power, next, prev, mute, vol and all that. Brightness can be adjusted on the remote though. The mini actually has quite a few pins available which can be used to control other stuff so I might put it to good use in some audio project to come.
Please let me know if anyone would like the code. I do have to check with Stefan first though, since I had to mess up his Toolbox hd44708 class. EDIT: Code is available below.
Tip of the day: Using an IR remote instead of push buttons and the like is just so much easier and more flexible plus it only takes a single pin to add 20+ buttons....and best of all, it's friggin' wireless!
EDIT: When come to think of it, I guess I have to publish the code because of Stefan's Apache 2 license, so here it is with misspelled word corrected and everything. It's quick and dirty and there are things started but unfinished so you have to take it for what it is. I guess I could write a nice and friendly wrapper class for the IC on popular demand but not now, because I really have to hit the sack
PCF8574A_v2.zip 10.16KB 168 downloads