cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

New Contributor

To whom it may concerns,

We use CY7C65211A to interface both I2C and SPI. We get the I2C work fine, but we don't see any output toggle on any Pin#20, 22 and 23.

The chip is configured as following:

Mode: SPI

Protocol: CDC

pastedImage_1.png

The following is the software driver:

pastedImage_2.png

Do we need any special handler for SPI access?

Do you see any setup or connection wrong?@ !

Please advise.

Any response is highly appreciated.

Have a wonderful one.

Denny

0 Likes
Reply
1 Solution
Moderator
Moderator

Update:

When the USB-Serial Device is in Mixed configuration mode on a custom board i.e. when the VDDD/VCCIO is powered using an different supply and the VBUS/VCC of USB-Serial is connected to VBUS pin of the connector (bus powered): After programming the USB-Serial Device using the USB-Serial Configuration Utility, to reset the device so that device enumerates with a newer configuration, we have to make sure that either one of the below conditions is satisfied:

1. The power to both the VBUS/VCC and VDDD/VCCIO is cycled.

2. Reset pin is used to reset the USB-Serial device by pulling it low for more than 1us.

3. The device is reset using the reset command from the host using the USB-Serial API.

In case the board containing the USB-Serial Device is reconnected to the host by unplugging and re-plugging the USB cable and the VDDD/VCCIO has not lost power during this, the USB-Serial device will be still retain the previous configuration and not the updated one.

Thanks,

Yatheesh 

View solution in original post

0 Likes
Reply
21 Replies
Moderator
Moderator

Hello Denny,

1. Please make sure the device (COM port) is bound to Cypress CDC driver from the USB-Serial SDK.

    The device will appear as USB Serial port in the device manger under COM ports.

pastedImage_0.png

2. please enter the COM port number to access the device using the command line utility.

I have attached an example CDC master project which takes in the COM port number and writes 256 bytes incremental data.

Please try the same.

password: cypress

Thanks,

Yatheesh

0 Likes
Reply
New Contributor

Thanks, Yatheesh.

I will work with our software guy. Then got back to ASAP.

Million thanks for your quick response.

Best regards,

Denny

0 Likes
Reply
New Contributor

Hello Yatheesh,

The software folk took a look your files.

The following is the comment from him (Ron):

What he mentioned is exactly what we are doing. The snippet of codes I sent you is the same spimaster code he's talking about. That came from the SDK kit package sample codes in C.

So, he did exactly as your example.

Do you have any further recommendation?

Please advise.

Thank you very much for your support and patience.

Best regards,

Denny

0 Likes
Reply
New Contributor

Hello,

This is Ron who is responsible of writing the application to interface with the device that Denny is working on.

Here is some background of what we are trying to do and what have we done so far. We have a cypress chip CY7C65211A installed on our EVK board to interface via I2C and SPI. Note that we are already successful in interfacing with the I2C. Now, we reconfigured our EVK board to interface via SPI, following the design guidelines provided by Cypress. The problem we have  is that we are not seeing any clock movement coming out of GPIO5  of the Cypress chip. Note that we have not yet connected the slave device to the cypress, so none is connected to the SPI (MOSI, SCLK, SS) lines except for logic analyzer/scope to monitor the output of the cypress chip.

Here's how we do it:

1. Power the EVK and plug in the USB.

2. PC detected the device and assigned a COM Port.

3. Set the scope for capture and wait on clock trigger

4. Run spimaster.exe. This would starts the transmission of data and trigger some movements (toggle) at the clock line. Running with a trace (Debug breakpoints) on the code, I could see the it got through CyOpenVCP() and successfully acquired a handle. It also got past CySetSpiConfig_VCP() without error. When it executes the CySpiReadWrite_VCP() to do a write, it returns an error code 11 (timed out) which is expected when target is not connected.

So, from the software point of view, I don't see anything suspicious. With the SPI write in step 4, I would expect to see some activity at the SPI clock line (or any of the other SPI pins) and we are not seeing that. What are we missing?

-Ron

0 Likes
Reply
Moderator
Moderator

Hello Ron,

I tried the test and was able to get the data.

Below is my setting

pastedImage_3.png

pastedImage_4.png

Please confirm if the COM port is bound to the proper driver (USB Serial port with driver version 3.13.0.59 or 3.13.0.84)

You can try with the previously attached application (spimaster) or also try using a teraterm to send data.

When anything is typed in the teraterm terminal, it is sent through the SPI when the SPI is configured in CDC mode.

pastedImage_5.png

If you still cannot get the data out of the SPI lines (SCLK and MOSI), please send me the snippet of the schematic containing the USB-Serial part.

Thanks,

Yatheesh

0 Likes
Reply
New Contributor

Yes, the COM port is bound to Cypress driver 3.13.0.84

Here's our Cypress configuration:

Here's the snippet of the schematic of our hardware configuration of the cypress chip.

I used TeraTerm as you suggested to eliminate question about the software. The result is the same. I still don't see any movement at any of the SPI pins.

0 Likes
Reply
New Contributor

Sorry, looks like the cutting and pasting images did not work.

As suggested, I used TeraTerm also to eliminate question about the test software we're using.

Still no output at the SPI Pins.

TeraTerm serial configuration.

TTerm.JPG

Here's the Com Port driver bounding.

ComPort.JPG

Here's the configuration

cycfg1.JPGCyConfig.JPG

Here's the snipped of the schematic of the cypress on our board.

Pin 20 to 23 are connected to a header where we monitor the pins with a scope.

CypressConfig.JPG

0 Likes
Reply
Moderator
Moderator

Hello,

The schematic seems fine except that the nXRES should not be left floating and should be pulled up to VDDD so that the device does not unnecessarily reset.

See point 7 in this KBA:USB-Serial: Hardware Design Schematic Checklist - KBA231249

1. Is it the same issue on all the boards?

If the application is reporting a timeout error, then its trying to communicate with the other device.

2. Please check if the ground of the scope is connected to USB-Serial ground.

3. Can you try reducing the SPI frequency in the USB-Serial configuration utility to 100 KHz and check?

Thanks,

Yatheesh

0 Likes
Reply
New Contributor

Hello Yatheesh,

The schematic which Ron sent you was out of date. I changed the logic based on your recommendation in "Unknown USB Device for CY7C65211".

I checked with I2C. I saw both SCL and SDA toggle as expected.

pastedImage_2.png

When I switched to SPI mode. I saw both SCK and SSL went down and stayed down until I unplugged and plugged the USB cable.

pastedImage_3.png

I checked "3" boards. All behaved the same.

All "3" have the same error message:

pastedImage_4.png

I did change the frequency from 1MHz to 100KHz. All have the same error.

I did remove all connections to Pin#20, 21, 22, and 23.

The behavior of SCK and SSL was the same. I got the same error.

For SPI, it should be very forgivable. It is "fire and forget" for write.

It doesn't need any external logic to pull it high or low.

Is there any special hardware setup requirement(s) for SPI excepted the configuration change?

Please advise.

Thank you very much for your support and patience.

Denny

0 Likes
Reply
Moderator
Moderator

Hello Denny,

To check if this is a problem  only in CDC mode, please configure the SPI in vendor mode and try the program USB Serial Test utility from USB-Serial SDK (under bin folder) to just write the data. You can refer to the CYUSBS234 Kit User Guide section  3.3.5.1 to use the test utility.

Please let me know if the clock and data is seen on the lines.

If you still cannot see the data, please provide the newer schematic for review.

pastedImage_0.png

Thanks,

Yatheesh

0 Likes
Reply
New Contributor

Hello Yatheesh,

I included the latest schematic in the last reply.

I did try to remove any connection to the SPI interface. I saw both SCK and SSL went down and stayed down until I unplugged the USB cable.

What do you want me to change on the hardware? The interesting point is the I2C work.

What make the SPI difference compare with I2C on the hardware standpoint?

Please educate me.

Thank you very much for your support and patience.

Have a wonderful one.

Denny

0 Likes
Reply
Moderator
Moderator

Hello Denny,

Looks like the schematic did not get attached in the response.

Can you please reattach it?

Also, please let me know if the SPI vendor mode test worked?

Thanks,

Yatheesh

0 Likes
Reply
New Contributor

Hello Yatheesh,

What is the difference between vendor mode and CDC mode?

Am I going to send data using the USB Serial Test Utility?

Is it the same one which I use to configure the chip to SPI mode?

Please educate me.

Thank you very much for your support and patience.

Denny

0 Likes
Reply
New Contributor

Hello Yatheesh,

I did copy and paste the schematic twice.

When I clicked Add Reply, it disappeared.

Please educate me what I did wrong.

Thanks.

Denny

0 Likes
Reply
New Contributor

Hello Yatheesh,

(1) the following is the updated schematic.

updated_schematic.jpg

(2) Run the vendor mode. It didn't work because it couldn't find CypressUSBConsoleWindowsDriver:

image (2).png

(3) I changed the different SPI configuration:

(a) CPHA =1 & CPOL=1: toggle high to low and stay low until USB cable was unplugged

(b) CPHA =0 & CPOL=1: toggle high to low and stay low until USB cable was unplugged

(c) CPHA =0 & CPOL=0: SCK stayed low; SSL toggle from high to low

(d) CPHA =1 & CPOL=0: SCK stayed low; SSL toggle from high to low

Please advise.

I run out idea to try.

Thanks.

0 Likes
Reply
Moderator
Moderator

Hello Denny,

When USB-Serial SPI is configured in vendor mode, the device will appear as USB-Single channel Vendor 1 in the device manager.

As per the screenshot you shared, the device is coming up as USB-Serial Adapter, which is for the CDC configuration. Please configure it to vendor mode in the SCB tab, reprogram and reset the device.

The below is for CY7C65215.

pastedImage_0.png

pastedImage_1.png

Thanks,

Yatheesh

0 Likes
Reply
New Contributor

Hello yatheesh,

Yes, I did configure to vendor.

Please see my screen shot with highlight. It is Vender MFG, not CDC.

Please let me know what I did wrong. The only thing which I didn't see was "CypressUSBConsoleWindowsDriver".

Thank you very much for your support and patience.

Denny

image (2).png

0 Likes
Reply
Moderator
Moderator

Hello Denny,

Vendor MFG is the manufacturing interface which will be present always if the "Enable Manufacturing interface" is checked in the configuration Utility.

The USB-Serial Adapter is the one which defines the CDC interface. This should not be present when the device is configured to vendor mode.

Can you please go to properties of both the devices, USB-Serial Single channel Vendor MFG and USB-Serial Adapter and the check the Details tab -> Device instance path ?

Please paste the screenshots for both the devices.

See the screenshot below for reference:

pastedImage_0.png

Thanks,

Yatheesh

0 Likes
Reply
New Contributor

Per your request, please see devices in detail below:

USB-seril_config.png

USB-serila_adapter_detail.png

USB-serial_adpter_general.png

USB-serial_adapter_driver.png

USB-serial_adapter_events.png

USB_serial_vendor_driver.png

USB_serial_vendor_general.png

USB_serial_vendor_detail.png

USB_serial_vendor_events.png

Please let me know if you have any questions or more info.

Million thanks for your support and patience.

Denny

0 Likes
Reply
Moderator
Moderator

Update:

When the USB-Serial Device is in Mixed configuration mode on a custom board i.e. when the VDDD/VCCIO is powered using an different supply and the VBUS/VCC of USB-Serial is connected to VBUS pin of the connector (bus powered): After programming the USB-Serial Device using the USB-Serial Configuration Utility, to reset the device so that device enumerates with a newer configuration, we have to make sure that either one of the below conditions is satisfied:

1. The power to both the VBUS/VCC and VDDD/VCCIO is cycled.

2. Reset pin is used to reset the USB-Serial device by pulling it low for more than 1us.

3. The device is reset using the reset command from the host using the USB-Serial API.

In case the board containing the USB-Serial Device is reconnected to the host by unplugging and re-plugging the USB cable and the VDDD/VCCIO has not lost power during this, the USB-Serial device will be still retain the previous configuration and not the updated one.

Thanks,

Yatheesh 

View solution in original post

0 Likes
Reply
Moderator
Moderator

Hello Denny,

Ideally with the same schematic there should be no issues with the SPI when I2C is working fine.

Since, CDC mode is currently used and issue is seen, we need to confirm even if the vendor mode in SPI is causing the same issue.

The TestUtility is different from the configuration utility.

I recommended to use the test utility as it is easier and can be tested very fast. just open the test utility from the USB-Serial SDK-> bin, enter the PID of the USB-Serial device,  and under SPI tab click on  write data option, this will put random data on the SPI lines. This utility is actually used to test the SPI operation on the CYUSBS234 DVK which has an SPI EEPROM.

If pasting the images in the response is not convenient you can attach them by using the advanced editor option on the top right part of the response box and select attach.

Thanks,

Yatheesh

0 Likes
Reply