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

cross mob
E_521156
Level 4
Level 4
100 sign-ins 50 replies posted 50 sign-ins

Hi,

I have two Bulk endpoint and I made a “loop back” by copy the EP IN to EP OUT in software:
BulkInEndPt.XferData(ref buffer, ref bytes);

BulkOutEndPt.XferData(ref buffer, ref bytes);

Everything works fine. I want to measure the time between send and receive data. I set a GPIO(37) in CY_U3P_DMA_CB_CONS_EVENT and then I tried to reset that GPIO in a thread related to CY_U3P_DMA_CB_PROD_EVENT . But I get different intervals while I send same packet. I want to know that which factors affect on this time that varies each time (The time that GPIO is high)? BTW I have two threads in my code.
Thanks

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

I am looking for time in whole path or at least from UIB C to UART T.

>> I understand the you need the time interval between data received from USB producer to UART transmitter. Instead of GPIO you can try using CyU3PGetTime API to get the timer ticks when the producer event for MANUAL IN channel is received and call the API again once the data is sent over UART. The difference in the timer ticks will be the time taken (in ms)

Regards,
Rashi

View solution in original post

0 Likes
3 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

From the description and the firmware, I understand that you want to calculate the time for the loopback on USB side. Is my understanding correct? or is the loopback on the UART side?

If loopback is on USB side, you can calculate the time on the Host application side. As done in the streamer  application of FX3 SDK.

Regards,
Rashi
0 Likes

Hi, 
Thanks for your reply.
The flow is:
UART R-> In buffer ->CPU-> DMA(Manual IN)-> UIB C …//.. UIB P->DMA(Manual OUT) -> CPU-> Out buffer -> UART T

I used from DateTime before BulkInEndPt.XferData and after BulkOutEndPt.XferData in host application, but I think It shows time between UIB C to UIB P. right? I am looking for time in whole path or at least from UIB C to UART T.

Thanks

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

I am looking for time in whole path or at least from UIB C to UART T.

>> I understand the you need the time interval between data received from USB producer to UART transmitter. Instead of GPIO you can try using CyU3PGetTime API to get the timer ticks when the producer event for MANUAL IN channel is received and call the API again once the data is sent over UART. The difference in the timer ticks will be the time taken (in ms)

Regards,
Rashi
0 Likes