ftdi_spi doesn't appear to support chips with more than 8 GPIO's
See original GitHub issueSystem: Ubuntu 22.04 Linux Kernel: 5.15.0-48-generic Python version: 3.10.6
This is potentially an odd one, fringe case or even PICNIC.
I’m trying to utilise a SSD1322 OLED display through an FTDI FT232h USB adapter. The chip on the adapter has 2x GPIO banks (the usual ADBUS pins 0-7 labelled as D0-7, and the secondary ACBUS pins 0-7 labelled as pins C0-7)…
This used to work fine under Ubuntu 16.04 using the Adafruit_GPIO Python2.7 module to wrap the SPI interface (it provided an abstraction of FT232H) with the following pin configuration…
CS = 3 #D3 Brown
RESET = 13 #C5 Purple
DC = 14 #C6 White
…however this has been completely dropped and I’ve migrated to pyftdi to try and return to what the luma.core documents state. In migrating, I now find myself with this error:
pyftdi.spi.SpiIOError: No such GPO pins: 0000/2000
This is the code I’ve written to try and initialise it;
from luma.core.interface.serial import ftdi_spi
from luma.core.render import canvas
from luma.oled.device import ssd1322
SPI = ftdi_spi(device='ftdi://ftdi:232h:RP39WI7Z/1', bus_speed_hz=8E6, gpio_CS=3, gpio_DC=14, gpio_RST=13)
To which I get the following traceback;
Traceback (most recent call last):
File "/root/src/oled-esxi/test.py", line 67, in <module>
SPI = ftdi_spi(device='ftdi://ftdi:232h:RP39WI7Z/1', bus_speed_hz=8E6, gpio_CS=3, gpio_DC=14, gpio_RST=13)
File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/luma/core/interface/serial.py", line 495, in ftdi_spi
serial = spi(
File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/luma/core/interface/serial.py", line 299, in __init__
bitbang.__init__(self, gpio, transfer_size, reset_hold_time, reset_release_time, DC=gpio_DC, RST=gpio_RST)
File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/luma/core/interface/serial.py", line 195, in __init__
self._gpio.output(self._RST, self._gpio.HIGH) # Keep RESET pulled high
File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/luma/core/interface/serial.py", line 427, in output
self._gpio.write(self._data)
File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/pyftdi/spi.py", line 316, in write
return self._controller.write_gpio(value)
File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/pyftdi/spi.py", line 682, in write_gpio
raise SpiIOError('No such GPO pins: %04x/%04x' %
pyftdi.spi.SpiIOError: No such GPO pins: 0000/2000
Sadly I cannot simply “rewire” - this was a small run custom PCB made by an Aida64 forum member and as such, immutable.
The pyftdi module references 16-bit wide GPIOs for the 232h so I know this is possible. Richard (or perhaps another developer), please can you look into this when you find yourself with a few mins? 🥰
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
So Amazon managed to lose it…
Have chosen an alternative and it’s on its way; https://www.mouser.co.uk/ProductDetail/895-FT2232HMINIMOD
Closing.