You are here

Very Slow operation of CyU3PGpifWriteDataWords | Cypress Semiconductor

Very Slow operation of CyU3PGpifWriteDataWords

Summary: 3 Replies, Latest post by Mudabir Kabir on 11 Dec 2013 12:31 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
Ken4242's picture
54 posts

 I am trying to send 3 words of data out on the GPIF bus manually and found it to be very very slow.  I have tried to do a single 3 word transfer and I have tried to do 3 1 word transfers in a loop.  The time for the both are about the same.I have also attached a scope trace showing how slow it is.  I am seeing 3-5 milliseconds between each word send out on the GPIF bus.  Is this expected?


     for (i=0; i<3; i++)


    apiRetStatus = CyU3PGpifWriteDataWords (0, CyFalse, 1, &(awGpibBuffer[i]), 0xFF);

    CyU3PDebugPrint (4, "Write Status [0x%x] %d = %d\n\r", awGpibBuffer[i], i, apiRetStatus);

    if (apiRetStatus != CY_U3P_SUCCESS)



Or I have also tried.
     apiRetStatus = CyU3PGpifWriteDataWords (0, CyFalse, 3, &(awGpibBuffer[0]), 0xFF);
rskv's picture
Cypress Employee
1134 posts

 Hi Ken,

Yes. GPIF II read and writes over registers are slow.

We need to do transfers over sockets if high data rates are required.


Sai Krishna.

Ken4242's picture
54 posts

Right now, I am sending the data as the first 3 words of the Setup Data Packet Payload.  I want to take these three words only and send them over the GPIF.  

1) Is there a way to configure the state machine to just take these payload only and send it to socket?

2) Is there a way that I could write this data to internal memory, and just DMA this data to the GPIF?

Mudabir Kabir's picture
Cypress Employee
44 posts

 Hi Ken,

   You can try this

1) Create a Manual OUT dma channel (CY_U3P_DMA_TYPE_MANUAL_OUT) between CPU and GPIF block and you can manually commit only the first 3 words as follows

CyU3PDmaBuffer_t outBuf_p;

status = CyU3PDmaChannelGetBuffer (&glChHandleCPUtoGPIF, &outBuf_p, CYU3P_NO_WAIT);

 if (status == CY_U3P_SUCCESS)             {

    CyU3PMemCopy(outBuf_p.buffer, awGpibBuffer_byte_type,12); // 3 words =12 bytes

    status = CyU3PDmaChannelCommitBuffer (&glChHandleCPUtoGPIF, 12 , 0);


     **   : Note that outBuf_p.buffer is a uint8_t  pointer and CyU3PMemCopy accepts two  uint8_t pointers as input. Since awGpibBuffer is a 32 bit pointer, extract the individual bytes, store them in a 8 bit array awGpibBuffer_byte_type and then do the CyU3PMemCopy.

2) Alternatively , you can send the entire data to GPIF through DMA channel and ensure that DR_DATA ( say 32 bit bus) is done only 3 times in the state machine. You can use one of the counters available in GPIF II designer to keep track of how many data words have been driven on the data lines. 



Mudabir Kabir 


Log in to post new comments.