[U-Boot] I2c imd/imw for a digital potentiometer?

Brian Hutchinson b.hutchman at gmail.com
Tue Sep 1 19:50:20 CEST 2009


Hi all,

I'm a little stumped as to how to write to a EEPot with the imw command.

The EEPot is a Maxim 5434 and has an address of 0x28.  To write to its
volatile or non-volatile register ... a command byte is given.

Writing 5 bits of data (it is a 32 tap pot so that is where the 5 bits come
from) to move the wiper goes something like this:

Start, 0x28, Ack, Cmd byte, Ack, Data byte, Ack, Stop

Cmd byte is 0x11 to write to volatile reg. 0x21 to write to non-volatile
reg.

The EEPROM really doesn't have addresses/offsets so I tried:

imw 28 11 80 1
imw.w 28 0.0 1180

... but it doesn't appear to play well with my device.

I'm in a bitbanged I2C environment (with GPIO) on a ARM9 core and I can
write to RTC and EEPROM just fine.

So, will uboot I2C commands handle a device like this (address command
data)?

I've been grepping code and searching this mail list and kernel drivers
(lm-sensor's) and I can't find any examples of EEpots being used in u-boot
or the Linux kernel.

Regards,

Brian


More information about the U-Boot mailing list