Continuous sending data from USB to GPIF? | Cypress Semiconductor
Continuous sending data from USB to GPIF?
I am currenlty trying to use the CYUSB3014 to send data synchronously from USB to GPIO. The application would be a 16-bit parallel digital data generator with a clock.
What I have done so far is to configure a DMA auto channel between UIB(producer) and PIB(consumer) usign GPIF II designer. The state with "DR_DATA" is triggered by "DMA_RDY_TH1" and exits when "!DMA_RDY_TH1". There are 4 DMA buffers and each is 16kB.
My problem is, there is a gap during buffer change. Please see the attached image.
I am thinking two ways to solve this, but need some guidance on implementation. If neither of them is possbile, is there anyway to do it with CYUSB3014? Thanks
Okay, here are two ideas;
(1) implement a circular buffer with two pointers: one for UIB, one for PIB. Since USB is faster that the GPIF, most of the time, the DMA buffer is full and it won't be necessary to switch buffers. So I can use a single large buffers. Therefore, there won't be buffer switching. However, I don't know how to do this on a low level or if this is possible.
(2) implement two sockets with GPIF and switch threads to avoid the delay. Just like reversing the configuration in AN75779 (UVC example). However, GPIF doesn't allow me to switch states when they have "DR_DATA" on different sockets. Maybe there is another way?