| 1 | You can use this program to read/write to i2c-eeproms |
|---|
| 2 | like the popular 24C16, 24C08, 24C04,.. In contrast to lm_sensor's eeprommer |
|---|
| 3 | which supports 24C256-type eeproms 24C16ss use 1-byte addresses! |
|---|
| 4 | |
|---|
| 5 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|---|
| 6 | !!! ! |
|---|
| 7 | !!! This program should only be used on external busses such as i2c-pport. ! |
|---|
| 8 | !!! ! |
|---|
| 9 | !!! Your computer may contain i2c-eeproms for saving data vital to its ! |
|---|
| 10 | !!! operation. If you are not careful you might overwrite this data with ! |
|---|
| 11 | !!! this program and your computer may no longer boot! ! |
|---|
| 12 | !!! ! |
|---|
| 13 | !!! An example are the EEPROMS on your SDRAM DIMMs, your computer may no ! |
|---|
| 14 | !!! longer detect the RAM module rendering it essentially USELESS! ! |
|---|
| 15 | !!! ! |
|---|
| 16 | !!! IBM Thinkpads are said to store their configuration data in a eeprom, ! |
|---|
| 17 | !!! if you manage to overwrite this eeprom you will have to send your ! |
|---|
| 18 | !!! computer to the manufacturer for a costly repair! ! |
|---|
| 19 | !!! ! |
|---|
| 20 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|---|
| 21 | |
|---|
| 22 | It has several options: |
|---|
| 23 | |
|---|
| 24 | -d devicenode |
|---|
| 25 | |
|---|
| 26 | set this to the device-node of the i2c-bus |
|---|
| 27 | you want to use like /dev/i2c-0. |
|---|
| 28 | Use /dev/i2c-1 for the second bus, i2c-2 for the third... |
|---|
| 29 | |
|---|
| 30 | The default /dev/i2c-0 should work most of the time. |
|---|
| 31 | |
|---|
| 32 | -a address |
|---|
| 33 | |
|---|
| 34 | set this to the device-address of your |
|---|
| 35 | eeprom. For a 24C16 the address is hardcoded to |
|---|
| 36 | 0x50, which is -you guessed it- the default. |
|---|
| 37 | |
|---|
| 38 | For a 24C08 and smaller types you can choose which |
|---|
| 39 | addresses they occupy by forcing the address-pins |
|---|
| 40 | of the chip to High or Low so here the address may differ. |
|---|
| 41 | |
|---|
| 42 | -p number_of_pages |
|---|
| 43 | |
|---|
| 44 | set this to the number of pages you want to read |
|---|
| 45 | from or write to the eeprom. The 24C16 maps it's |
|---|
| 46 | pages to consecutive addresses on the i2c-bus so |
|---|
| 47 | we will try to read 256 bytes from every i2c |
|---|
| 48 | address between 'address' (inclusive) and |
|---|
| 49 | 'address + number_of_pages' (exclusive)... |
|---|
| 50 | |
|---|
| 51 | A 24C16 has 8 pages so that's the default for this |
|---|
| 52 | parameter. |
|---|
| 53 | |
|---|
| 54 | -f filename |
|---|
| 55 | |
|---|
| 56 | read data from this file (when writing to eeprom) or |
|---|
| 57 | write data to this file (when reading from eeprom). |
|---|
| 58 | |
|---|
| 59 | When reading a file that's smaller than the |
|---|
| 60 | eeprom's storage size we will pad the eeprom |
|---|
| 61 | with zeroes. |
|---|
| 62 | |
|---|
| 63 | If no file is given we will just read the |
|---|
| 64 | eeprom (while in read-mode) and test it's presence |
|---|
| 65 | this way. In write-mode we will just write zeroes |
|---|
| 66 | to the eeprom. |
|---|
| 67 | |
|---|
| 68 | -w When '-w' is present we will *write* to the eeprom. |
|---|
| 69 | If you do not specify '-w' we will read the contents |
|---|
| 70 | of the eeprom. |
|---|
| 71 | |
|---|
| 72 | -y This flag will suppress the warning when you write to the |
|---|
| 73 | eeprom. You will not be required to enter 'yes' so be careful |
|---|
| 74 | when using this switch! |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | I wrote that program to clear a 24C16 eeprom that sit's in my crappy |
|---|
| 78 | satellite receiver because sometimes its Z80 processor likes to |
|---|
| 79 | write garbage to it and then crash.... |
|---|
| 80 | |
|---|
| 81 | No further testing besides writing a long series of "The quick brown |
|---|
| 82 | fox jumps over the lazy dog!" and reading it back has been done so |
|---|
| 83 | of course this comes without any warranty. |
|---|
| 84 | |
|---|
| 85 | Chris <chris@hedonism.cx> |
|---|