gpif event

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 added LD_ctrl_count and used count_ctrl in my GPIF state machine. Then I used the CYU3P_GPIF_EVT_CTRL_COUNTER in a callback in firmware application(CyU3PGpifRegisterCallback (CyFxGpifCB);). But no event is received.  I expected that when crtl_counter reaches to limit, I get an event.

My question is: should I active any other things for receiving counter’s events in GPIF SM? 
I couldn't find any example using CYU3P_GPIF_EVT_CTRL_COUNTER or other counters.

For another test, I used the attached project in  https://community.infineon.com/t5/USB-superspeed-peripherals/FX3-CyU3PGpifInitCtrlCounter-API/td-p/2... . I ticked "reload counter on the reaching limit" in LD_ctrl_count  and used
if (event == CYU3P_GPIF_EVT_CTRL_COUNTER)  in CyFxGpifCB, then it doesn't work.
Actually I don't want to use CPU_int, I want to get the event by CYU3P_GPIF_EVT_CTRL_COUNTER.

Thanks

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

Hello,

Please uncheck the "counter mask event" to get the event without calling INTR_CPU

counter_event.PNG

 

Please let me know if further queries

Regards,
Rashi

View solution in original post

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

Hello,

Please uncheck the "counter mask event" to get the event without calling INTR_CPU

counter_event.PNG

 

Please let me know if further queries

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.

Hi Rashi,
Thanks for your reply. Yes it works with your comment.
But I have a question, I added ld-add_count and count_address to usbtogpif project in KBA229814, and set/reset a ctrl pin(pin 22) when the specific amount of samples (for example 24 samples of 32-bit) are received to count the received samples.  I monitored DQ13(Fs) and ctrl5(pin22) when I send a hex file to Fx3, I noticed that Fs and the sample count pin are not synchronize. I mean that I get the first 24 samples and after a few samples i see the pin22 sets for remain stream it repeats every 24 samples but it has delay from the right position.  Is there any way that I get a  sample counter signal in the right position without any delay?
I attached my changes in the KBA229814 project here.
Thanks

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

Hello,

I do not see GPIO 22 is driven from the GPIF SM. Please let me know if I missed anything. Kindly, let me know in which state are you calling DR_GPIO

Regards,
Rashi
0 Likes

Hi,
I didn't use DR_GPIO. I used  CyU3PGpioSetValue(22, CyTrue) in the call back of CyFxGpifCB/CYU3P_GPIF_EVT_ADDR_COUNTER  in the firmware application.
Thanks

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

Hello,

Please let me know if there is a reason for driving the GPIO from firmware and not from the State machine.

The delay could be because the GPIO is set/reset from firmware.

Please try setting /resetting the GPIO directly by using the GPIO register instead of calling the API

Regards,
Rashi
0 Likes

Hi,
My concern is about delay for changing states and missing some clock cycles in transferring data so I used diving the GPIO from firmware.
I tested driving GPIO in SM, it works fine.
Thanks