5 * Maxim MAX6874, MAX6875
7 Addresses scanned: None (see below)
9 http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf
11 Author: Ben Gardner <bgardner@wabtec.com>
17 The Maxim MAX6875 is an EEPROM-programmable power-supply sequencer/supervisor.
18 It provides timed outputs that can be used as a watchdog, if properly wired.
19 It also provides 512 bytes of user EEPROM.
21 At reset, the MAX6875 reads the configuration EEPROM into its configuration
22 registers. The chip then begins to operate according to the values in the
25 The Maxim MAX6874 is a similar, mostly compatible device, with more intputs
31 See the datasheet for more information.
37 eeprom - 512 bytes of user-defined EEPROM space.
43 Valid addresses for the MAX6875 are 0x50 and 0x52.
44 Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56.
45 The driver does not probe any address, so you must force the address.
48 $ modprobe max6875 force=0,0x50
50 The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
51 addresses. For example, for address 0x50, it also reserves 0x51.
52 The even-address instance is called 'max6875', the odd one is 'max6875-dummy'.
55 Programming the chip using i2c-dev
56 ----------------------------------
58 Use the i2c-dev interface to access and program the chips.
59 Reads and write are performed differently depending on the address range.
61 The configuration registers are at addresses 0x00 - 0x45.
62 Use i2c_smbus_write_byte_data() to write a register and
63 i2c_smbus_read_byte_data() to read a register.
64 The command is the register number.
67 To write a 1 to register 0x45:
68 i2c_smbus_write_byte_data(fd, 0x45, 1);
70 To read register 0x45:
71 value = i2c_smbus_read_byte_data(fd, 0x45);
74 The configuration EEPROM is at addresses 0x8000 - 0x8045.
75 The user EEPROM is at addresses 0x8100 - 0x82ff.
77 Use i2c_smbus_write_word_data() to write a byte to EEPROM.
79 The command is the upper byte of the address: 0x80, 0x81, or 0x82.
80 The data word is the lower part of the address or'd with data << 8.
82 val = (address & 0xff) | (data << 8);
85 To write 0x5a to address 0x8003:
86 i2c_smbus_write_word_data(fd, 0x80, 0x5a03);
89 Reading data from the EEPROM is a little more complicated.
90 Use i2c_smbus_write_byte_data() to set the read address and then
91 i2c_smbus_read_byte() or i2c_smbus_read_i2c_block_data() to read the data.
94 To read data starting at offset 0x8100, first set the address:
95 i2c_smbus_write_byte_data(fd, 0x81, 0x00);
97 And then read the data
98 value = i2c_smbus_read_byte(fd);
102 count = i2c_smbus_read_i2c_block_data(fd, 0x84, buffer);
104 The block read should read 16 bytes.
105 0x84 is the block read command.
107 See the datasheet for more details.