The newly manufactured EL502 Mezzanine cards do not contain any data in their EEPROM yet. A Raspberry Pi and a custom made cable are used to programm the EEPROM.
The code of this project is under version control in a Git repository whose upstream is: https://git.gsi.de/BEA_HDL/V_DIO_EEPROM_Programming
sudo raspi-config
, browse to Interfaces
and activate I2Csrc
folder to the Raspberry Pi or clone the Git repository on itRaspberry Pi | Raspberry Pi | Mezzanine | Mezzanine |
---|---|---|---|
pin number | signal name | pin number | signal name |
1 | +3.3 V | 1 | +5 V |
3 | SDA | 3 | SDA |
5 | SCL | 2 | SCL |
6 | GND | 26 | GND |
cd src
./write_serial_number.py <serial number>
cd src
./write_eeprom.py
This will program the content of src/eeprom_content.csv
to the EEPROM.
cd src
./read_eeprom.py
This will create an output file src/eeprom_content_readback.csv
.
You can compare it to the desired content using diff eeprom_content_readback.csv eeprom_content.csv
.
The six IO expanders on the EL502 Mezzanine can be accessed via the same I2C bus. The following commands can be used:
i2cdetect -y 1
will list all available I2C devices on the I2C bus /dev/i2c-1
The output on the EL502 is the following:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 21 22 -- 24 25 26 -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
The devices with the addresses 0x20, 0x21, 0x22 are the IO expanders on the top side. The devices with the addresses 0x24, 0x25, 0x26 are the IO expanders on the bottom side. The device with the address 0x50 is the EEPROM.
E.g. i2cset -y 1 0x20 0x02 0xff
will write the value of 0xff
to the register 0x02
on the device with the I2C address 0x20
.
cd src
./configure_io_expanders.py
This will program the content of src/io_expander_config.csv
to the registers of the IO expanders.
E.g. i2cget -y 1 0x20 0x02
will read the value of the register 0x02
on the device with the I2C address 0x20
.
cd src
./read_io_expanders.py
This will print all the register values of the IO expanders.