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
alamandaa_16
Moderator
Moderator
Moderator
10 likes received First like received

Hello Arthur Hsu,

 

1. did you modify the sample GPIF state machine?

2.How did you say gpif always keeps first state?

GPIF statemachine continues to push data into the DMA channel whenever the thread is in the ready state.

Regards,

Anil Srinivas.

0 Likes

Dear Anil

Thanks your reply!

1. No,I don't

2. This project would catch GPIO[0]~[15],if I pull high GPIO[0] and get state as below when power on

     after first catch,I pull high other pins except GPIO[0]

     But the data is same as first time

     That's why I guess it just catch once GPIF state

000001.png

0 Likes

The gpif II should be configured with the help of the gpf editor

0 Likes

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

0 Likes

Dear Anil

Your are correct

Much thanks your support

0 Likes