How to use SparkFun TCA9534 GPIO Expander with CircuitPython (CircuitPlayground Bluefruit for example)
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- drmikegreen
- Posts: 26
- Joined: Sat Sep 06, 2014 3:18 pm
How to use SparkFun TCA9534 GPIO Expander with CircuitPython (CircuitPlayground Bluefruit for example)
I need additional GPIO pins and happen to have several SparkFun TCA9534 boards and a variety of CircuitPython boards (Gemma M0, CircuitPlayground Bluefruit for example). What driver (if any) could I use?
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: How to use SparkFun TCA9534 GPIO Expander with CircuitPython (CircuitPlayground Bluefruit for example)
Sparkfun has python examples and packages that might help to give you a path. If you try and have problems you can ask specific questions here.
- drmikegreen
- Posts: 26
- Joined: Sat Sep 06, 2014 3:18 pm
Re: How to use SparkFun TCA9534 GPIO Expander with CircuitPython (CircuitPlayground Bluefruit for example)
Alas, the SparkFun Python I2C package only supports the Raspberry Pi and only on a few hardware platforms. The TCA9523 is supposed to be a similar GPIO expander for which there is an Adafruit driver (Adafruit_AW9523). The default I2C address for this is 0x58. If I override this with "address=0x27", I get an I/O error when I try to create an instance of the GPIO expander using a CircuitPlayground Bluefruit board.
code.py output:
]0;🐍BLE:Off | code.py | 8.1.0-rc.0\Traceback (most recent call last):
File "code.py", line 7, in <module>
File "adafruit_aw9523.py", line 91, in __init__
File "adafruit_register/i2c_struct.py", line 81, in __get__
OSError: [Errno 5] Input/output error
]0;🐍BLE:Off | 81@adafruit_register/i2c_struct.py OSError | 8.1.0-rc.0\
Code done running.
import time
import busio
import board
import adafruit_aw9523
i2c = busio.I2C(board.SCL, board.SDA)
aw = adafruit_aw9523.AW9523(i2c,address=0x27)
print("Found AW9523")
code.py output:
]0;🐍BLE:Off | code.py | 8.1.0-rc.0\Traceback (most recent call last):
File "code.py", line 7, in <module>
File "adafruit_aw9523.py", line 91, in __init__
File "adafruit_register/i2c_struct.py", line 81, in __get__
OSError: [Errno 5] Input/output error
]0;🐍BLE:Off | 81@adafruit_register/i2c_struct.py OSError | 8.1.0-rc.0\
Code done running.
import time
import busio
import board
import adafruit_aw9523
i2c = busio.I2C(board.SCL, board.SDA)
aw = adafruit_aw9523.AW9523(i2c,address=0x27)
print("Found AW9523")
- drmikegreen
- Posts: 26
- Joined: Sat Sep 06, 2014 3:18 pm
Re: How to use SparkFun TCA9534 GPIO Expander with CircuitPython (CircuitPlayground Bluefruit for example)
I've found the Community driver library and there is a driver for the TCA9555 which is a "close relative" of the TCA9534 written by Gabriele Pongelli.
- drmikegreen
- Posts: 26
- Joined: Sat Sep 06, 2014 3:18 pm
Re: How to use SparkFun TCA9534 GPIO Expander with CircuitPython (CircuitPlayground Bluefruit for example)
I'm giving up. I'm doing fine with "ready-made" CircuitPython library routines for a variety of devices. I just don't have the fluency either in Python or the internal structure and assumptions of the I/O library to do what I want without more "hand holding".
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: How to use SparkFun TCA9534 GPIO Expander with CircuitPython (CircuitPlayground Bluefruit for example)
You might try the Discord Adafruit Forum for the "help with Circuitpython" group
- adafruit2
- Posts: 22148
- Joined: Fri Mar 11, 2005 7:36 pm
Re: How to use SparkFun TCA9534 GPIO Expander with CircuitPython (CircuitPlayground Bluefruit for example)
its a totally different chip - your best bet is to ask Sparkfun to write a library for you since its their hardware (we dont own this chip)
Please be positive and constructive with your questions and comments.