Archive for January, 2007

Microchip AN734 (I2C slave)

I spent most of yesterday getting Microchip’s AN734 code working on a PIC16F690. To spare others the pain, here’s a tarball of my source code and Makefile.

To test this code, I connected a couple wires to the I2C lines on the flash memory on one of my computer’s memory DIMMs. I got the idea from the lm-sensors project. Here’s a photo:

Soldering to the Memory DIMM

So does it work? I’ll test it using the SMBus tools from lm_sensors. (In Fedora, “yum install lm_sensors” as root will install it).

The SMBus protocol writes an address byte, then reads the resulting data. AN734 just reads/writes the same buffer, so the effect is to echo the SMBus address back.

i2cget will only write to i2c addresses 3 and above. I have fixed this in the tarball above. For whatever reason, the address is half the one given in the an734.asm source file. So I set the address to 0×06.

Now, I’m ready to test:

[root@kaonashi ~]# i2cget -y 0 3 0x01
0x01
[root@kaonashi ~]# i2cget -y 0 3 0xff
0xff

Sweet!

Comments

Double Melody

My new computer has a VGA video camera built-in, and can apply some simple effects in real time. Here’s Melody playing with it:

Melody in the mirror

Comments (4)