GPIF Dual Socket

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

cross mob
lock attach
Attachments are accessible only for community members.
jl46
Level 4
Level 4
50 replies posted 50 sign-ins 25 replies posted

Hello,

I tried referencing the pingpong buffer mechanism stated in AN75779 (UVC) for my ADC application. Using a GUI made in visual studio, I'm able to capture data properly:

jl46_0-1632745054030.png

But there are times when the data is corrupted.

I am using the "bulkEpt.XferData(ref buffer, ref bytes, false);" function to transfer data to and from the FX3 onboard.

Attached is the project source files that I modified to resemble the AN75779 pingpong buffer mechanism. Inside is also the folder containing the modified state machine I use with the firmware.

 

Thanks,
jl46

0 Likes
1 Solution

Hi Jayakrishna,

Apologies for the delayed response. I found the problem and it seems to be in the CyU3PGpifDisable function implementation in the firmware. I added provisions in the firmware to start and stop the GPIF state machine using the CyU3PGpifDisable function for disabling and initially the input is set to CyTrue. This means that this is a total shutdown of the state machine (based on the API description) and starting the state machine again after this seemed to result to a period of instability, which is the corruption in the data that I observed when I capture data.

Aside from the disable / enable mechanism, the initialization of the state machine was also transferred to run only once during the initialization of the DMA channels (CyU3PGpifLoad). 

I've modified my firmware to have the loading of the state machine parameters in the CyFxlnAppStart() function to run only once, the CyU3PGpifDisable(CyFalse), and just using the CyU3PGpifSMStart() every time the state machine needs to be re-enabled.

Thanks,
jl46

View solution in original post

0 Likes
7 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please let me know what exactly was meant by "data is corrupted" so that we can understand the problem better. In addition to this, please test the project with control center application and let us know if the problem is also seen with control center application or not.

Best Regards,
Jayakrishna
0 Likes

Hi Jayakrishna,

Data is corrupted means that some of the datapoints result into spikes when converted at the GUI application end like so:

jl46_1-1632809206661.png

The garbage data seems to be a result of lost bytes in the captured data. For example, every 8th bit in every 32 bits should be 0x0F. This means that when I convert the data, I would get a good value but if the 0x0F moves from 8th to 7th or a different location, using the same data conversion, I get a wrong result, possibly similar to the image above.

I'm still looking at the GUI end because doing some changes there seem to have a noticeable effect on the results but it would also be good to know more on the behavior of the firmware (possible instance of lost bytes).

 

thanks,
jl46

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

Hello,

Is it possible to send known data from the ADC to FX3? Also, is it possible to send exactly 2 full buffers from ADC to FX3? If this is possible, then please try this and collect the data using control center application. This can be used to understand if the bytes were lost while capturing the data and the location where the byte losses were seen. 

In addition to this, can you check if this data loss is seen at the boundary of DMA buffers?

Best Regards,
Jayakrishna
0 Likes

Hi Jayakrishna,

Apologies for the delayed response. I found the problem and it seems to be in the CyU3PGpifDisable function implementation in the firmware. I added provisions in the firmware to start and stop the GPIF state machine using the CyU3PGpifDisable function for disabling and initially the input is set to CyTrue. This means that this is a total shutdown of the state machine (based on the API description) and starting the state machine again after this seemed to result to a period of instability, which is the corruption in the data that I observed when I capture data.

Aside from the disable / enable mechanism, the initialization of the state machine was also transferred to run only once during the initialization of the DMA channels (CyU3PGpifLoad). 

I've modified my firmware to have the loading of the state machine parameters in the CyFxlnAppStart() function to run only once, the CyU3PGpifDisable(CyFalse), and just using the CyU3PGpifSMStart() every time the state machine needs to be re-enabled.

Thanks,
jl46

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

Hello,

Thank you for the update. I understand that the problem is resolved. Please let me know if my understanding is not correct.

Best Regards,
Jayakrishna
0 Likes

Hi Jayakrishna,

Yes the problem was resolved by doing some modifications in the firmware. For my application, it seems that disabling the state machine fully and then re-enabling it again by reloading the GPIF configuration parameters take some time, which causes a period in time where the data is corrupted.

Best regards,
jl46

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

Hello,

Thank you for the update. We are glad to hear that the issue is resolved.

Best Regards,
Jayakrishna
0 Likes