AUTO DMA Channel for SPI to USB

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

cross mob
Anonymous
Not applicable

Hi,

   

 

   

Can I have an infinite transfer AUTO DMA channel from SPI to USB end point. Is it possible to make the transmission happen only if fixed number of bytes got received from SPI each time?

   

Any example source code to evaluate?

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

I have modified the functionality of USB-UART example to get SPI data to CPU and then from CPU to USB. Here, the modified code is working but I am seeing a serious problem of significant gaps between SPI clocks. The SPI to CPU is with DMA Manual IN.  My SPI data is actually the audio from an I2S to SPI converter logic. Since the clock is discontinuous for a significant amount of time the audio gets suffered.

   

Please advise me for the following things.

   

1) Infinite transfer of SPI data directly to USB (So clock wont have any discontinuity). This will help to avoid CPU intervention.

   

2) If the SPI data is audio data, can I still use the infinite way of transferring. Or, does it require buffering of data and sent as frame always?

   

Following is the producers-consumers used

   

#define CY_FX_EP_PRODUCER1_SOCKET        CY_U3P_CPU_SOCKET_PROD
#define CY_FX_EP_CONSUMER1_SOCKET        CY_U3P_UIB_SOCKET_CONS_2
#define CY_FX_EP_PRODUCER2_SOCKET        CY_U3P_LPP_SOCKET_SPI_PROD
#define CY_FX_EP_CONSUMER2_SOCKET        CY_U3P_CPU_SOCKET_CONS

0 Likes