4 Replies Latest reply on Aug 16, 2019 5:40 AM by KySa_4218291

    FX3 GPIF to USB


      Hello Guys,

      I am absolutely new with this topic.

      I created State Machine that basically reads all PINS (32bit) and buffers it in to a thread. So I can fetch it via USB when it is full. Now I want to make a Firmware with 4 Threads, 1024bytes (4 Times the same)  and a specific System Clock and my state machine has an output as a clock for Slave from wich I read the 32 bit. So i make an output (clock) and collect the 32 bits.
      How do I do this?


      I have found a similar named example "gpiftousb".So I just want to put my header from gpif ii in this project and build to get the firmware, but I also want to modify it more to my case:

      systemclock 9.6Mhz

      4 Threads and

      1024byte buffer

      and do i have todo anything with my 1 pin for "fake"clock output?

      or about send data only if I fetch it


      Wich places do i have to look to?
      Would be very nice if someone could explained it on "noob to cypress" level


      PS:  maybe cyfxbulklpauto is even better ?

        • 1. Re: FX3 GPIF to USB



          1) You can go through this app note https://www.cypress.com/file/124206/download   for you understanding of GPIF II as master.

          2) For the firmware file, you can get it from https://www.cypress.com/documentation/application-notes/an87216-designing-gpif-ii-master-interface - Auto master (cyfxbulklpauto)

          3) Do you mean systemclock as PCLK i.e. clock from FX3 to slave??

          4) Can you share the block diagram of application that you need?

          5) For understanding of GPIF thread refer Meaning of Thread in GPIF - KBA90269




          • 2. Re: FX3 GPIF to USB

            Hello, this is the state machine. I have 64 devices to check. On high tact 32 and on low tact 32. They are all connected to GPIF. So I want that the state machine will tact it self with 96mhz and with each 10th cycle i read the data and toggle a pin (high and low external clock). I have got 4 threads with 1024 bytes simple to keep it fast enough to stream on usb with modified streamer application. I think i have to define master clock and just don't use the clocking pin?
            Something like that

                 pibClock.clkDiv      = 4;

                 pibClock.clkSrc      = CY_U3P_SYS_CLK;

                 pibClock.isHalfDiv   = CyFalse;

                 pibClock.isDllEnable = CyTrue;

                 apiRetStatus = CyU3PPibInit (CyTrue, &pibClock);
            But is there an Example that is nearly what I want? cyfxsrammaster Could it be?






            • 3. Re: FX3 GPIF to USB



              - You can use cyfxbulklpauto.c which is in Auto master example (as mentioned in my previous response) for your design

              - For 32 bit GPIF configuration, change io_cfg.isDQ32Bit = CyFalse; to io_cfg.isDQ32Bit = CyTrue;

              - You can use the same pib clock configuration it will give you pib clock of 96MHz (384 MHz /4)

              - From the state machine it seems that the data will be read in multiples of 1024(buffer size)??. You can refer to master_read_write_sync.cyfx file.






              1 of 1 people found this helpful
              • 4. Re: FX3 GPIF to USB

                Thank you! Exactly what I was looking for.

                From the state machine it seems that the data will be read in multiples of 1024(buffer size)??.

                Almost, I will read and process the data instantly so it will stream the data fluently and with one thread.. well it takes time to initiate one so it would be some fraction in the data. That is why I have a queue of 4 threads (tested) and 1024 byte is one package in usb stream. (or 256 samples a 32 bit)
                So it just to avoid the delay of initialization and fraction in the streamed data