Recording a constant flow of 32-bits data

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

cross mob
lozu_4351981
Level 1
Level 1
First like given

I would like to record a constant flow of 32-bits data (using an external  synch clock - 50MHz). Can I do it with the Synch FIFO example ?
For the moment I can receive data but every 1024 bytes there is a "gap" in my received data.

0 Likes
1 Solution
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

I think you are sending data into FX3 over GPIF. And you expect the data flow to remain continuous. In this case, instead of following the slave fifo model, you can go through the state machine of AN75779 where the data is sampled on GPIF thread 0 and when DATA_CNT is hit (which also means that a buffer is full in FX3) the data is sampled on GPIF thread 1. In this case the data flow can be continuous, provided the Host is reading the data fast enough.

Regards,

Hemanth

Hemanth

View solution in original post

4 Replies
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

I think you are sending data into FX3 over GPIF. And you expect the data flow to remain continuous. In this case, instead of following the slave fifo model, you can go through the state machine of AN75779 where the data is sampled on GPIF thread 0 and when DATA_CNT is hit (which also means that a buffer is full in FX3) the data is sampled on GPIF thread 1. In this case the data flow can be continuous, provided the Host is reading the data fast enough.

Regards,

Hemanth

Hemanth

Thanks, i am investigating this at the moment.
I cannot use the structure fully because my "source" is only providing data and a clock that I need to catch.

Now that I have "clean" the state machine it is only two alternating thread with counters to trigger the switches from to another.

The firmware seems way to complex for my need and rely on the interrupts I suppressed from the state machine. So I try reusing the two threads structure with the synchronous FIFO firmware example.

I'll let you know how it goes.

Isn't it a problem to switch from a thread to another ? I may be losing data during transition.

0 Likes
lozu_4351981
Level 1
Level 1
First like given

Thanks a lot.
I followed this : Fx3 Streaming dropped packets? where the person share their code 😃 It was more clear for me to understand than AN75779

Now I DO have a constant flow toward my USB endpoint for a while...

BUT I still have packets loss after some time. when the thread are switched I miss 765k 32bits words.

I think it is my computer not reading the data fast enough and thus not freeing the memory space in the FX3 board.
If someone has a clue I take it all =D

0 Likes
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

There will be no loss due to thread switching as compared to buffer switching. So, the PC should be fast enough to empty the filled DMA buffers. If all the buffers are filled with Host not consuming them, then data will be lost.

Regards,

Hemanth

Hemanth
0 Likes