SLUUDD1 August   2025

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1 Introduction
  5. 2 FT4222_Python_Controller.py
    1. 2.1 I2C Commands
    2. 2.2 SPI Commands
  6. 3 AFE20408_Page_Global_Def.py
  7. 4 AFE20408_Page_0_Def.py
  8. 5 AFE20408_Page_1_Def.py
  9. 6 AFE20408_Page_2_Def.py
  10. 7 AFE20408_Page_3_Def.py
  11. 8 AFE20408_Page_4_Def.py
  12. 9 AFE20408_Page_6_Def.py
  13. 10Main.py
  14. 11Common Sequences
    1. 11.1 Reset Sequence
    2. 11.2 ADC Configuration
    3. 11.3 DAC Configuration
  15. 12Common Issues
  16. 13Summary

I2C Commands

initializeI2C(speed)

Initializes the FTDI in I2C Mode.

Table 2-1 InitializeI2C Parameters
Speed Can be between 60k to 3400k. Note that the AFE20408 can only handle up to 400k bps

i2cWrite(Slave Address, Register Address, Register Data)

Sends an I2C write command to the EVM.

Table 2-2 I2CWrite Parameters
Slave Address 8-bit slave address. This address is configurable using EVM jumpers.
Register Address 8-bit register address
Register Data 16-bit register data

i2cRead(Slave Address, Register Address)

Sends an I2C read command to the EVM. Returns a 16-bit value.

Table 2-3 I2CRead Parameters
Slave Address 8-bit slave address. This address is configurable using EVM jumpers.
Register Address 8-bit register address

Example:

    ftdiObject = FtdiController()   # initialize the FTDI 
    ftdiObject.getFtdiDeviceInfo()  # Get FTDI info
    ftdiObject.initializeI2C(400)   # initialize I2C with 400kbps

    # Write to slave address 0x40, register address 0x08, with data 0x0001
    ftdiObject.i2cWrite(0x40, 0x08, 0x0001) 

    # Read back from slave address 0x40, register address 0x08, and print the data.
    print(ftdiObject.i2cRead(0x40, 0x08))   

    ftdiObject.closeHandle()    # close the FTDI when done.