CY65211 USBtoSPI

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
hata_3396041
Level 4
Level 4
First solution authored First like received 50 questions asked

Hello

Please tell me about communication between CY7C65211A and MCU.

How is USB (CDC) data converted to SPI and transmitted to the microcomputer?

I want to see the internal state when converting USB commands and SPI signals

I want to know the status of both transmission and reception for Mode 3 (SPI Master Mode) and Mode 4 (SPI Slave Mode).

I want an answer as soon as possible because of important content.

(Today or Tomorrow)

Best regards

0 Likes
1 Solution

Hello Yamashita-san,

They can refer to program which is in

C:\Program Files (x86)\Cypress\USB-Serial SDK\examples\usbserialexample

C:\Program Files (x86)\Cypress\USB-Serial SDK\examples\usbserialCDCdeviceExamples

if they want to use SPI as USB-Serial Communications Device Class (CDC) devices, they can refer to usbserialCDCdeviceExamples.

Helpful document is Cypress USB-Serial VCP I2C/SPI API Guide and Read/Write operation API is CySpiReadWrite_VCP(). The arguments are same as CySpiReadWrite() API which can refer to USB Serial API Library Guide.

USB-to-Serial device (CY7C65211A) appropriately converts USB data to SPI format when receiving this command.

USB Serial SDK can install from https://www.cypress.com/documentation/software-and-drivers/usb-serial-software-development-kit

Best regards,

Hirotaka Takayama

View solution in original post

0 Likes
5 Replies
HirotakaT_91
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

Hello,

CY7C65211/11A supports various patterns (Data width, Protocol, etc.) of SPI transfer by setting configuration table.

The customer can install "Cypress USB-Serial Configuration Utility" and plug a device, then configure the table by clikcing "Configure" button.

pastedImage_0.png

They can see and change the various settings.

On the above setting, SPI is Master and Protocol is Motorola, CPHA and CPOL is low (Mode 0), etc.

Firmware in the CY7C65211 works accordingly on the settings of this configuration setting.

Unfortunately, firmware implementation cannot share. Please consider that the device works accordingly by setting configuration table using "Cypress USB-Serial Configuration Utility".

Best regards,

Hirotaka Takayama

0 Likes

Thank you for your quick response.

Can I share the buffer usage during data transfer?

Data sheet states that a buffer with a data width of 4 to 16 bits and 256 bytes is installed.

Does it mean that the data divided into 4 to 16 bits by SPI communication is stored in a buffer,

and 256 bytes are transferred together via USB?

Best regards

0 Likes

Buffer is used for buffering data and achieve the good throughput.

pastedImage_0.png

- "256 Bytes TX Buffer" stores data from USB transfer to SPI trasnfer whereas "256 Bytes RX Buffer" stores data from SPI transfer to USB transfer. These transaction is done in the CPU main loop as a periodically invoked task.

- USB transfer happens in bursts.

- Since CY7C65211 is a Full-Speed device, bulk packet transfer size is up to 64 Bytes, not 256 Bytes.

Does it make sense?

Best regards,

Hirotaka Takayama

0 Likes

Hi Takayama-san,

Let me jump in - this customer is not requesting us to share the internal state machine of our USB-to-Serial controller. They are requesting us to give examples of how SPI Rear/Write API gets transformed to an USB packet and SPI operation.

E.g.

1. Host application initiates CySpiReadWrite API to communicate with a SPI pier device

2. CDC driver converts to a certain USB packet (A. Customer wants to take a look this USB packet)

3. USB-to-Serial device converts this read (or write) request to SPI read (or write). (B. Customer wants to take a look at SPI traffic)

It would be really appreciate if you can show both read and write example. Let us know if it is doable.

Thanks in advance.

Yasu Yamashita

0 Likes

Hello Yamashita-san,

They can refer to program which is in

C:\Program Files (x86)\Cypress\USB-Serial SDK\examples\usbserialexample

C:\Program Files (x86)\Cypress\USB-Serial SDK\examples\usbserialCDCdeviceExamples

if they want to use SPI as USB-Serial Communications Device Class (CDC) devices, they can refer to usbserialCDCdeviceExamples.

Helpful document is Cypress USB-Serial VCP I2C/SPI API Guide and Read/Write operation API is CySpiReadWrite_VCP(). The arguments are same as CySpiReadWrite() API which can refer to USB Serial API Library Guide.

USB-to-Serial device (CY7C65211A) appropriately converts USB data to SPI format when receiving this command.

USB Serial SDK can install from https://www.cypress.com/documentation/software-and-drivers/usb-serial-software-development-kit

Best regards,

Hirotaka Takayama

0 Likes