Skip to content

Supporting the CY7C65215 #3

Description

@runger1101001

Thank you for your excellent work on this library.
In your readme you write:

However, in my experience so far, they are easier to work with and simpler to design your circuit board around. In particular, they do not need an external EEPROM, and they are much better documented on the electrical side. Why the industry still prefers the FTDI chips is... something of a mystery to me at this point.

I agree very much with this statement. I think perhaps the reason the FT2232H is still widely used, is that is has better software support. Your library may go a long way to change that.

I'm trying to add support for the CY7C65215 chips, the dual channel versions of these chips. Compared to the FT2232H this chip also offers 2 serial channels configurable as either UART, SPI or I2C, but needs far fewer external components to support it, and comes in a smaller package at half the price.

In terms of the code, at the moment it does not work to connect to these chips. To get my local version to connect, I needed to change the list_devices function in cy_scb_context.py.

There are significant differences to the USB device for the 2-channel version:

  1. The PID is a different one. It seems to be 0x0005 or 0x0007
  2. the CY7C65215 has 4 USB Interfaces when configured with 1 CDC UART and 1 SPI. I have to check different configurations, but presumably there is always one extra interface since it has 2 SCBs.
  3. the interface order seems to be: 0 - control, 1 - SCB1, 2 - SCB2, 3 - MGR
  4. the interfaces have the same classes and subclasses, but the endpoints are a little different: the endpoints for the SCBs in Vendor mode have different addresses. Instead of 0x01, 0x82 and 0x83 it is 0x04, 0x85 and 0x86.
  5. After modifying the checks in list_devices accordingly, it connects to my CY7C65215 successfully.

I'm happy to submit these changes as a PR, but I am uncertain regarding the best way to proceed.

What is the purpose of all these checks? Are you trying to recognise the device based on its interface and endpoint configuration? Why not trust the user-supplied PID values?

How to deal with the fact that there could be 2x UART or 2x SPI, etc? The CLI has the --scb option, but the SCBContext does not seem to take it into account?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions