sample code "GPIFtoUSB"

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

cross mob
ArHs_1540296
Level 1
Level 1

Hello everyone,

I am a beingger of FX3

I try sample code "GPIFtoUSB" of SDK

The project would catch GPIF one time when power on and transmit by endpoint 0x81

But GPIF always keeps first state

Question is: how to update state of GPIF continually?

Thanks

0 Likes
1 Solution

Arthur Hsu,
As you may be aware the data from the gpif is received by FX3 and stored in DMA buffers before sending it to USB.

GPIF to USB example has 4 DMA buffers, each of the size 32k Bytes.Once the data transfer starts, the bytes from GPIF Start filling the 1st Buffer. Once the 1st buffer is filled then GPIF start filling the 2nd buffer. Finally at some point of time all DMA buffers filled.

Case-1: Connect only GPIF-0 pin to logic high.

Click the Transfer Data-IN button,16 KB data transfer from the first buffer.

s5.PNG

Case-2:Connect only GPIF-2 pin to logic high.

We know that all the four buffers are filled and we received 16K of first buffer in case 1. Now half of first buffer and other three buffers are filled with the same data (01 00 00 00). There is no buffer to store the data. Hence, the state machine stops at the state (DMA_WAIT).

If we want to see the effect of GPIO -2 pin, we have to first empty the four buffer then only GPIF state machine will be able sample the data and store it.

Then do Transfer-IN to see the effect of GPIO-2. Here is the screen shot for 9th DATA IN transfer.

s6.PNG

Regards,

Anil Srinivas

View solution in original post

0 Likes
5 Replies