User Tools

Site Tools


ds:projects:vdio:el502

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ds:projects:vdio:el502 [2021/07/20 21:12]
rgeissler
ds:projects:vdio:el502 [2022/03/10 14:31] (current)
klang
Line 2: Line 2:
  
 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 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.
 +
 +===== Resources =====
 +
 +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
  
 ===== How to program the EEPROM ===== ===== How to program the EEPROM =====
  
-  * connect the custom made cable to the Raspberry Pi and to the Mezzanine (TODO: add image)+  * connect the custom made cable to the Raspberry Pi and to the Mezzanine
   * activate the I2C interface of the Raspberry Pi: ''%%sudo raspi-config%%'', browse to ''%%Interfaces%%'' and activate I2C   * activate the I2C interface of the Raspberry Pi: ''%%sudo raspi-config%%'', browse to ''%%Interfaces%%'' and activate I2C
-  * copy the ''%%src%%'' folder to the Raspberry Pi or clone this repository on it+  * copy the ''%%src%%'' folder to the Raspberry Pi or clone the Git repository on it
  
 {{:ds:projects:vdio:Raspi_Mezzanine_Connection.jpg| I2C connection}} {{:ds:projects:vdio:Raspi_Mezzanine_Connection.jpg| I2C connection}}
Line 17: Line 21:
 |                 5|               SCL|               2|              SCL| |                 5|               SCL|               2|              SCL|
 |                 6|               GND|              26|              GND| |                 6|               GND|              26|              GND|
 +
 +==== Programming with individual serial numbers ====
 +
 +  * ''%%cd src%%''
 +  * ''%%./write_serial_number.py <serial number>%%''
 +
 +===== Alternative static programming and verification scripts =====
  
 ==== Programming ==== ==== Programming ====
  
   * ''%%cd src%%''   * ''%%cd src%%''
-  * ''%%./write_i2c_data.py%%''+  * ''%%./write_eeprom.py%%''
  
-This will programm the content of ''%%src/eeprom_content.csv%%'' to the EEPROM.+This will program the content of ''%%src/eeprom_content.csv%%'' to the EEPROM.
  
 ==== Verification ==== ==== Verification ====
  
   * ''%%cd src%%''   * ''%%cd src%%''
-  * ''%%./read_i2c_data.py%%''+  * ''%%./read_eeprom.py%%''
  
 This will create an output file ''%%src/eeprom_content_readback.csv%%''. 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%%''+You can compare it to the desired content using ''%%diff eeprom_content_readback.csv eeprom_content.csv%%''
 + 
 +===== Testing the IO expanders ===== 
 + 
 +The six IO expanders on the EL502 Mezzanine can be accessed via the same I2C bus. The following commands can be used: 
 + 
 +==== Listing the available I2C devices ==== 
 + 
 +''%%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. 
 + 
 +==== Writing registers ==== 
 + 
 +=== Via single CLI accesses === 
 + 
 +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%%''
 + 
 +=== Via a script === 
 + 
 +  * ''%%cd src%%'' 
 +  * ''%%./configure_io_expanders.py%%'' 
 + 
 +This will program the content of ''%%src/io_expander_config.csv%%'' to the registers of the IO expanders. 
 + 
 +==== Reading registers ==== 
 + 
 +=== Via single CLI accesses === 
 + 
 +E.g. ''%%i2cget -y 1 0x20 0x02%%'' will read the value of the register ''%%0x02%%'' on the device with the I2C address ''%%0x20%%''
 + 
 +=== Via a script === 
 + 
 +  * ''%%cd src%%'' 
 +  * ''%%./read_io_expanders.py%%'' 
 + 
 +This will print all the register values of the IO expanders.
  
  
ds/projects/vdio/el502.1626808330.txt.gz · Last modified: 2021/07/20 21:12 by rgeissler