fx3 serial GPIF input data compare

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

cross mob
SaGi_4116301
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hello,

I am using the FX3 in serial in- and output GPIF mode at approx 100Mbit/s with pin DQ14 as input and DQ15 as output, based on info in the firmware include file gpif_regs.h.

It works fine using a simple state machine. Also word length can be set, and packing into 32 bit words etc.

My question is: can a compare data action CMP_DATA be done in the GPIF state machine in serial mode?

What is the data representation in the state machine with serial input data? Is it just a bit at a time, so should one just compare with either a 1 or 0 or must one compare on the word level?

My goal is: I would like to look for a certain pattern in the serial input data (say a word with all 1's) and once this is detected write data in the data sink socket. Can this be done using CMP_DATA?

regards

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

Hi Sander,

I was able to detect 'Logic 1' on DQ[14].

Please try with the following:

Comparator Value: 0x4000

Unmask Value      : 0x4000

Regards,

Hemanth

Hemanth

View solution in original post

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

Hi,

As you might already know, that while using CMP_DATA action, the value specified in the 'Unmask Value' is ANDed with the sampled data word and then the result is used for comparison. So, can you please try giving the Unmask value and the Comparator value with only 1 in the DQ line which is Serial-IN to FX3 and check whether you are able to make a transition using DATA_CMP_MATCH.

Regards,

Hemanth

Hemanth
0 Likes

Hi Hemanth,

Thanks for your answer. I did already play last week with the unmask value and played with connecting the serial input DQ14 permanently connected to GND or V3p3 as you also suggested. I monitored the state using CyU3PGpifGetSMState through debug UART to see if I can make a state transition. So far I have only been able to get state transitions when either:

- DQ14 is connected to GND and I set CMP_DATA to 0x0 and unmask value to 0xffffffff;

- DQ14 is connected to a periodic signal (generated by FX3 itself through a GPIO pin) and CMP_DATA is set to "Change detection"

So far I have not been able to detect a permanent "1" on the serial input DQ14 with CMP_DATA. Neither with comparator value set to 0x1 or 0xffffffff (or any number of f's) and an unmask. Also not by changing serial word lengths etc. Maybe you could give it a try and detect a permanent "1" input on DQ14 in serial mode? The streamer does confirm that I get all ff's out when DQ14 is permanently "1" so the output data is correct. By the way I use an auto dma channel

Regards

Sander

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

Hi Sander,

I am trying back to back setup with one FX3 Explorer Kit sending SERIAL OUT and with one receiving the same. As of now I am able to send the data out. I am working on receiver part. Can you please share what changes you have done in the Gpif header for receiver part (so that I can compare with mine)?

Regards,

Hemanth

Hemanth
0 Likes
lock attach
Attachments are accessible only for community members.

Hi Hemanth,

I used a state machine from one of the original GPIF2USB examples, which was modified in one of the cypress community forums back in 2017 to include serial communication.

Attached the GPIF state machine part for serial in, where I added a data compare state before the actual data read in state.

Hope this helps,

Regards

Sander

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

Hi Sander,

I was able to detect 'Logic 1' on DQ[14].

Please try with the following:

Comparator Value: 0x4000

Unmask Value      : 0x4000

Regards,

Hemanth

Hemanth
0 Likes

Hi Hermanth,

Thanks for your help!

I tried it, and it works.

By the way,

I noticed that the serial interface input DQ14 only seems to work with the big endian setting in GPIF designer (even if I leave out the data comparator

completely and directly read in data). In little endian setting the streamer app only shows zeros, even if the DQ14 input is tied high permanently.

Regards

Sander

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

Hi Sander,

I think it's the other way round. Only the Little Endian setting works. Please confirm.

Regards,

Hemanth

Hemanth
0 Likes

Hi Hemanth,

Yes you are absolutely right. I have my Endians mixed up.

Serial input interface through DQ14 only streams in data in little endian mode.

Thanks,

Sander

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

Yes. Big Endian doesn't work with the serial data.

Regards,

Hemanth

Hemanth
0 Likes