GPIF Master: variable DATA_COUNT and address

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

cross mob
RaschTam
Level 1
Level 1
5 replies posted 5 sign-ins First reply posted

Hello

In my Application I need a Master GPIF to an FPGA with a 16-bit address bus. I want to transmit and receive data through the USB directly to the FPGA.

First question:

My plan is to send a control package to setup bulk transfers between the U-Port and the P-Port. With every setup package I would like to chose a new starting address, the number of data words and if the address counter will be incremented or not.

The only functions I found that give me control about the address counter and data counter are CyU3PGpifInitAddrCounter() and CyU3PGpifInitDataCounter(). I found somewhere here on the forum that these functions can be used only after loading the GPIF state machine but before starting it. Is that the correct way to implement a variable address and data counter? If yes, is it enough to disable the state machine with CyU3PGpifDisable(0) before reinitializing the address and data counter and then restarting it using CyU3PGpifSMStart()? Or is there a more direct way to access the address and data counter while the state machine is running?

Second question:

I want to have another option to send very short commands to the FPGA. For those I don't want to have an extra control package. But I want to send one package with my own header information I extract within the CPU. I use CyU3PGpifWriteDataWords() and CyU3PGpifReadDataWords() to write and read from the bus and the macro CY_U3P_PIB_GPIF_EGRESS_ADDRESS() to setup the address bus.

Writes are working fine when I use "OUT_REG0_VALID" as my transition equation. For reads I trigger the state machine through the FW_TRG transition by calling the commands CyU3PGpifControlSWInput(CyTrue) and CyU3PGpifControlSWInput(CyFalse). Now there is a relatively long delay between FW_TRG going low again. I need to add a state and the end of my read cycles that wait for !FW_TRG before going back to the IDLE state. Is this how it is supposed to be, when I intend to go through the CPU or is there another way to have quicker trigger mechanism.

Thanks

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Regarding your question 1, you can change the address or data counters when the state machine is running. Please refer to the project that comes along with AN87216 (link given below):

https://www.cypress.com/documentation/application-notes/an87216-designing-gpif-ii-master-interface

In the Auto Master project that comes along with this Application Note, you can find that the counters are initialized after loading and starting the state machine. Also, if you refer to the definitions of the APIs CyU3PGpifInitAddrCounter() and CyU3PGpifInitDataCounter(), you can find that it just stops the counters and then reconfigures it again. So, you can use these APIs after starting the state machine. But, make sure that the previous settings are counted fully when you change the settings so that data is not missed.

I did not understand your second question clearly. Kindly share the GPIF II project and elaborate the question so that I can understand it better.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
1 Reply
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Regarding your question 1, you can change the address or data counters when the state machine is running. Please refer to the project that comes along with AN87216 (link given below):

https://www.cypress.com/documentation/application-notes/an87216-designing-gpif-ii-master-interface

In the Auto Master project that comes along with this Application Note, you can find that the counters are initialized after loading and starting the state machine. Also, if you refer to the definitions of the APIs CyU3PGpifInitAddrCounter() and CyU3PGpifInitDataCounter(), you can find that it just stops the counters and then reconfigures it again. So, you can use these APIs after starting the state machine. But, make sure that the previous settings are counted fully when you change the settings so that data is not missed.

I did not understand your second question clearly. Kindly share the GPIF II project and elaborate the question so that I can understand it better.

Best Regards,
Jayakrishna
0 Likes