Good morning guys!
I am trying to communicate with a MCP2221a bridge via USB using pyserial.
While my pc see the port connected to the MCP2221a and can open it, I receive no response when i try to send commands.
My connections are as follows:
MCP2221a
pin 1 : V0 USB (5V)
pin 12: D- USB
pin 13: D+ USB
pin 14 GND
As per datasheet of MCP2221 (page 26) i am trying to query the settings of the chip.
My python code is the following ("portname" is replaced with the address of the port).
import serial
ser =serial.Serial('/dev/portname',9600, timeout=1)
print(ser.name)
vect = []
for i in range (64):
vect.append(0)
vect[0]=0xB0
print vect
ser.write(vect)
ser.read(64)
ser.close()
the reading of the chip returns an empty buffer. I tried to communicate with an Arduino with the same code, and the arduino correctly receives the byte buffer, thus the writing seem to work.
Any idea?