Comments (10)
I found some useful code as a work around in issue 38 by chadkennedyonline:
#38
but I'm still wondering is it possible to add acbus control in library?
from pyftdi.
Yes it should be possible using the SET_BITS_HIGH
command. It has already been implemented with SPI mode.
from pyftdi.
Thanks a lot,I can configure the ACBUS using SpiController().get_gpio() now.
from pyftdi.
Re-opening this feature request as it would be great to provide GPIO support for ACBUS with bit bang mode as well.
from pyftdi.
Dear all,
Finally, is it possible to control both SPI on AD0/1/2 and CS on AD4 + an extra gpio output on AC3 with an FT2232D?
In my case, the SPI perfectly works with AD0/1/2 and CS on AD4 but I can't add the extra gpio output on AC3.
Im in an Ubuntu environnement, with python3, pylibftdi 0.16.1.2, pyusb 1.0.0 and pyftdi 0.28.5.
I tried the example "Example: communication with a SPI device and an extra GPIO".
Thank you!
from pyftdi.
There was an issue with ACBUS, it should now be supported (v0.28.7), which has been tested with a FTDI2232H.
I do not have a FT2232D at hand - this is a really legacy device, I'm afraid I cannot test it by now.
from pyftdi.
Dear Mr Blot,
Thanks for your answer and to added example on spi with gpio access.
I don't understand the philosophy on how to use functions. In my case, I'm working with:
AD0: SCLK, AD1: MOSI, AD2: MISO, AD4: /CS (AD3 unused)
+AC3 a gpio output.
I suppose I should:
- self._spi.get_port(0, freq=1E6, mode=0)
- self._spi.get_gpio()
- self._io.set_direction(?,?)
- self._io.write(?)
- self._port.exchange(data,length)
- self._io.write(0)
Is that the correct way to dessert the gpio pin, do an spi access (with CS on AD4) and then reassert the gpio pin? Which value should I put on the parameters?
I'll be able to confirm (or not) that the issue with ACBUS is supported on FT2232D.
Thank you!
from pyftdi.
/CS are supposed (at least with PyFtdi) be in-order, starting from the first pin after the three mandatory SPI signals (AD0/AD1/AD2). If you do not use AD3 for /CS, but you use AD4 for the first /CS signal, AD3 is still reserved for another /CS and cannot be re-used for GPIOs, i.e. in your case:
- AD0: SCLK
- AD1: MOSI
- AD2: MISO
- AD3: N.C.
- AD4: /CS
- AD5,AD6,AD7: GPIOs
- AC0,AC1,AC2,AC3: GPIOs
You still need to declare 2 /CS signal, and only use the second one, i.e.
self._spi = SpiController(cs_count=2) # AD3, AD4
port = self._spi.get_port(1, freq=6E6, mode=3) # port 0 is AD3, not used
then if you want to re-use the SPIO GPIO unit test, you need to perform the test on only 3 pins instead of 4, as there are only 3 AD pins available for GPIO, i.e. something roughly like this:
ad_pins = ((1 << 3) - 1) << 5 # AD5-AD7 as input
ac_pins = ((1 << 3) - 1) << 9 # AC1-AC3 as output
io_pins = ad_pins | ac_pins
# ...
for ac_ in range(1 << 3): # only 3 pins
ac = ac_ << 1 # skip LSB (AD4/AC0)
# ...
with:
- AD5 connected to AC1
- AD6 connected to AC2
- AD7 connected to AC3
- AC0 not connected
from pyftdi.
I have an equipment (fpga) behind the ft2232D, so when I deassert and reassert AC gpios, I have something different than the example. But in my case, I confirm that your example with SPI + 2 extra GPIOS (/CS and ACBUS) perfectly works on the FT2232D.
Thank you!!
from pyftdi.
Ok, thanks for the feedback!
from pyftdi.
Related Issues (20)
- LSB first with MPSSE SPI? HOT 2
- Retry issue with SPI reads HOT 5
- 0.54.0: Deprecated setuptools functionality in use, will break on 2023-10-30 HOT 3
- 0.55 Operation not supported or unimplemented on this platform (FT4232HA) Windows HOT 1
- 0.54.0 FT230x EEPROM API inaccuracies HOT 2
- 0.55.0 not on pypi.org HOT 3
- Low baudrates doesn't work with bit-banging.
- How to enable TXDEN on FT4232H?
- Intermittent errors when accessing FTDI HOT 5
- Specification issue in I2cController.exchange(self, out, readlen, relax, start)
- Timeout behaviour of read method not compatible with pyserial HOT 1
- clearing eeprom
- Unable to configure EEPROM: EEPROM does not support mirroring HOT 1
- UART lock up with FT4232H HOT 1
- GPIO state reset when opening device
- Error in class I2CBusScanner logic - if read success, skips write test HOT 1
- "Error: No backend available" during Mac OS instllation. HOT 1
- in_waiting and out_waiting in pyftdi/serialext/protocol_ftdi.py not implemented but return always 0 HOT 2
- Incorrect results when reading i2c with clock stretching
- No such device / 4 USB devices match URL 'ftdi:///2' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyftdi.