Go Down

Topic: MCP2221a bridge USB interface (Read 423 times) previous topic - next topic

Xiviar

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).
Code: [Select]

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?

PaulS

Quote
Any idea?
The Arduino worked. Some not-even-remotely-related-to-an-Arduino board didn't. You need, therefore, to post your issue on the not-even-remotely-related-to-an-Arduino forum, NOT this forum.
The art of getting good answers lies in asking good questions.

ieee488

I never understand why people make it difficult for themselves with serial communication by introducing an intermediary into the problem.

Connect up the device that has the serial "port" directly to the PC, and use something like Putty or Hyperterminal to see if they are able to communicate consistently and reliably with the device.





Go Up