5 Replies Latest reply on Aug 22, 2013 5:17 AM by userc_41942

    Flag configuration



      I'm trying to configure FlagA to work in U to P mode on Thread 3. Flag should be high if there are 8 or more bytes in FIFO, otherwise it should be low.


      I'm having problem configuring this. If I get 8 bytes to FIFO Flag goes high but when I read it it still stays high.


      Can anybody advise me how can I configure this? 


      Thanks for help,



        • 1. Re: Flag configuration





          Please refer http://www.cypress.com/?rID=51581. This demonstrates an example of configuring the watermark flag.







          • 2. Re: Flag configuration
                    Hi, I already referred to this document. I configured FlagA as Thread_3_DMA_WaterMark, Initial value: high, Polarity: active low. In SlaveFifoSync example I added CyU3PGpifSocketConfigure(3, PPORT_SOCKET, 2, CyTrue, 0); Before I send anything to FX3, FlagA is low, when I received 8 bytes it goes high and stays high even if I read it from GPIF. Strange is that if I configure like this CyU3PGpifSocketConfigure(3, PPORT_SOCKET, 20, CyTrue, 0); FlagA also goes high, even if it gets only 8 bytes of data. If I configure FlagA as Thread_3_DMA_Ready it works, it goes high when I get something from PC and goes back low if I read it from GPIF. So how can I configure WaterMark to goes down when I read it from GPIF? Regards, Rok   
            • 3. Re: Flag configuration



              I have another question about flag configuration. I am using Slave fifo example on FX3 and I have configured P to U dma transfer with 512 bytes FIFO, count =3, so together 1536 bytes of FIFO. I would like to configure FlagB to go high when buffers have 1280 bytes of data inside. If I set watermark value to 256 bytes Flag goes high when comes 256 bytes in first FIFO, not in third. Endpoint size is also 512 bytes.


              How can I configure that?


              Thanks for help.



              • 4. Re: Flag configuration

                Hi Rok,


                You can directly configure the Dma buffer to the size of 1280bytes and then you can directly use a Flag (Thread_x_DMA_ready) to know whether it got the 1280bytes of data into the FX3. In this case your P-port socet will be producer and USB socket will be consumer socket. So that flag will be high as long as there is a space in that buffer and it will go Low as soon as 1280 bytes are written.


                Please let me know if you need any more details from me on this regard.






                sai krishna.

                • 5. Re: Flag configuration

                   If I would do this way, Flag will be set when the buffer is full. But I want to have partially full flag that goes high when 1280 bytes are inside buffer which full size is 1536 bytes.


                  Best regards,