- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I'm trying to figure out what the best method for configuring an FX3 would be in order to achieve this SPI transaction. Each SPI transaction must have an adjustable "stall time" appended after being transmitted on the order of microseconds. The entire block of SPI data to be transmitted (four 16-bit words in the attached example) must only be transmitted after receiving a "data valid" pulse on a gpio. I have successfully implemented the SPI transactions using CyU3PSpiTransmitWords() and CyU3PSpiTransferWords() and am successfully storing data in a pre-allocated buffer, but I have not been able to figure out what the best method would be to send the data to the PC over USB. I've included a few captures of what I'm looking to do, as well as what my issue is:
Above Image: Desired SPI sequence
Above image: Desired SPI sequence illustrating stall time
Above image: SPI transactions become inconsistent after filling the transmit buffer and sending to the PC over USB
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please find the attached project which is a modification of cyfxusbspidmamode SDK example.
In this,an IN Endpoint: 1 is added and the data received from SPI is sent to EP1 instead of EP0.
The EP0 would just be performing a zero length transfer.
Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I wanted to see if anyone had some input on how to achieve this. I've tried sending data using a manual dma transfer after each cycle, but USB latency seems to be an issue using that method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been trying out a few more things and think I may be on the right track. If I set up a DMA where the CPU is acting as the producer and the USB as a consumer, then I think I may be able to write data to the buffer as data packets become available and shove them out to USB without any CPU invervention (for that part of the transfer, anyway). Does this sound like something that would work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Don't you want to use Endpoint 0 for the data transfer over USB to Host?
If you refer to the following example, the data read from the Flash over SPI is sent to USB over Endpoint 0:
C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxusbspidmamode
Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't want to use endpoint 0 since I'm using that for application control. This data stream is unique in that both timing and reacting to an external GPIO are both critical.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content