Master example to read GPIF II data

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

cross mob
LeDe_2880731
Level 1
Level 1

I have been reading all the documents and examples about FX3 and so far I haven't found any example that I can use directly. Please help me if you have an example that meets our following requirements:

1. We would like to replace a Microchip micro-controller on our products with FX3 in order to gain the supper speed data transfer so FX3 will be the master on this product.

2. GPIF II will be used to retrieve data from a FIFO memory to the FX3 memory and then a head will be added to the buffer. Then FX3 will send the data to USB (or host).

3. FX3 receives the data request command form USB (or host) with the number of bytes to read which may vary from 16 to 32KB.

4. The FIFO memory control is pretty simple: D15..D0, CS# and RD# lines.

Hopefully some can provide an example.

Thank you in advance.

0 Likes
1 Solution
ManaskantD_51
Employee
Employee
Welcome! 25 solutions authored 10 solutions authored

You can refer to the application note AN87216 (www.cypress.com/AN87216) which explains how to design a GPIF-II Master using FX3. A code example is also attached to the app note which you can modify based on your requirements.

View solution in original post

0 Likes
7 Replies
ManaskantD_51
Employee
Employee
Welcome! 25 solutions authored 10 solutions authored

You can refer to the application note AN87216 (www.cypress.com/AN87216) which explains how to design a GPIF-II Master using FX3. A code example is also attached to the app note which you can modify based on your requirements.

0 Likes

Thank you for the quick answer. I checked the code AutoMaster but it doesn't have the MANUAL-OUT code. Did I get the wrong code? Or I should add it myself?

0 Likes

Also how can the firmware initiate the transfer from GPIF II to the internal memory for the specified number of the bytes?

Thanks.

0 Likes

1) The AutoMaster code example has only the AUTO DMA channel implemented. You can modify the channel to MANUAL and add a DmaCallback function.

2) Once you call the CyU3PGpifSMStart() API, the GPIF state machine will start running and based on the control signals it will capture data. Once the buffer is full, you will get a callback in the firmware. You can then add/modify the data if you want and send it to the USB.

0 Likes

It seems to me that the read operation starts with FLAG_A asserted from outside FIFO. However, we would like the firmware starts the operation by calling a function. Can we do thar?

0 Likes

You can use FW_TRIG in the state transition equation. The value of FW_TRIG can be controlled from the firmware using the CyU3PGpifControlSWInput () API. Please refer to the FX3_API guide for more details on the API.

0 Likes

That is nice! I will give it a try. Thanks a lot!

0 Likes