Thursday, 11 February 2010

Eye-Too-See

Slightly wet day today ... what better excuse is needed for some hacking. Like I needed one.

I started looking at the I2C controller today. Originally the idea was to try and get some sort of sound out of the board (it's one of the parts needed), but then I thought that was a bit too ambitious. So I settled for trying to blink the LED connected to the power controller/audio chip.

After a bit of a false start it just worked. Damn, there's a surprise, not used to things `just working'. The manual describes programming the I2C controller a few times, and only the one with the detailed flow-chart of a sort of state-machine is the one that works. Took a little while to work out how to read back data from a master, but it was reasonably straight forward given the description of the protocol in the TPS65950 manual.

Since the LED is connected through a PWM the code does more than just turn the LED on and off, I made it `pulse' by smoothly changing the duty cycle using an approximate sine curve. Code is in i2c-leds.

No comments: