Open kelyrr opened 3 years ago
Whenever you update the EEPROM, you need to power cycle the device so that the EEPROM content is read and used.
Usage example on an UM232H board (FT232H module):
Load the current EEPROM content into a file
pyftdi/bin/ftconf.py -P 15ba:002a -o ft232h.ini ftdi://:232h/1
Create a backup file if something goes wrong
cp ft232h.ini ft232h_backup.ini
Edit the INI file
[values]
; ...
cbus_func_8 = DRIVE0
cbus_func_9 = DRIVE1
Update the EEPROM
pyftdi/bin/ftconf.py -i ft232h.ini -l values -u ftdi://:232h/1
Unplug/plug back the UM232H module
Edit the INI file
[values]
; ...
cbus_func_8 = DRIVE1
cbus_func_9 = DRIVE0
Update the EEPROM
pyftdi/bin/ftconf.py -i ft232h.ini -l values -u ftdi://:232h/1
Unplug/plug back the UM232H module
Edit the INI file
[values]
; ...
cbus_func_8 = GPIO
cbus_func_9 = GPIO
Unplug/plug back the UM232H module
Run a small Python test On FT232H, CBUS drivable pins are ACBUS5, ACBUS6,ACBUS8, ACBUS9, from FT232H datasheet, therefore:
#!/usr/bin/env python3
from time import sleep from pyftdi.ftdi import Ftdi, FtdiError from pyftdi.eeprom import FtdiEeprom
ftdi = Ftdi() ftdi.open_from_url('ftdi://:232h/1')
assert(ftdi.has_cbus == True) eeprom = FtdiEeprom() eeprom.connect(ftdi)
assert(eeprom.cbus_mask & 0xc == 0xc)
ftdi.set_cbus_direction(0xc, 0xc) loop = 10
while loop: loop -= 1 ftdi.set_cbus_gpio(0x8) sleep(0.2) ftdi.set_cbus_gpio(0x4) sleep(0.2) ftdi.close()
![ft232h_led_cbus](https://user-images.githubusercontent.com/172423/117330849-65223480-ae96-11eb-9aee-e2a0ba97a10f.gif)
I don't have any questions. I just want to thank you for the great example you've left in this thread @eblot! 👏
ftdi.set_cbus_gpio(0x8)
My FT232R is configured in this way:
But,
eeprom.cbus_mask 0
What should I do to access the 2 LEDS from python?
Hello,
Hello
With FTPROG i have switched the cbus_0 on "DRIVE1" and the LED turned on. Then i switched to "DRIVE0" but the LED stays into HIGH state.
Please could you explain why this is happening ? What should i do ?
Also, i have difficult to understand what i should put into theses functions to control the GPIOs:
Thanks a lot for your help!! :) Clément