Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Last byte repeat, On NextData/ActivateData in the GPIF write Waveform Interval

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Last byte repeat, On NextData/ActivateData in the GPIF write Waveform Interval
Moderator:
RSKV

Post Reply
Follow this topic



Last byte repeat, On NextData/ActivateData in the GPIF write Waveform Interval

Il posted on 10 Apr 2012 1:44 AM PST
Member
3 Forum Posts

Hello,everyone!

 

I am using GPIF write waveform to send less than 512 bytes data block.

I referenced Knowledge Base Article "NextData/ActivateData in the GPIF read Waveform Interval".

In this paper,

In order to write data from the FIFO to the external peripheral, you will do an activate data first in one interval. Doing this will result in driving the first byte in the FIFO on to the GPIF data bus and then you may do a Next FIFO Data on the subsequent interval. Doing an Activate Data and a Next FIFO Data on the same interval will result in incrementing the FIFO  pointer and driving the new data (pointed to by the incremented pointer) and should be done in subsequent intervals. Therefore a Next FIFO Data is required in case of GPIF Write

I activated data first in one interval(Same Data),and Next FIFO Data on the subsequent interval.

I writed 256 bytes “0x00, 0x01,…, 0xFF”,but read  data is 258 bytes “0x00, 0x01,…, 0xFF,0xFE, 0xFF”.

So , last 2 byte in the FIFO,” 0xFE ,0xFF” repeated.

What is the reason?

The source code is as following.

 

// we are just using the default values, yes this is not necessary...

TD_INIT()

{

             EP2CFG = 0xA2;                               //           double buffer,bulk

             SYNCDELAY;                   

EP2FIFOCFG = 0x15;                                      //00010101 : AUTOOUT=1, ZEROLEN=1, WORDWIDE=1

             EP2AUTOINLENH = 0x02;                    // When AUTOOUT=1, core commits IN data

             SYNCDELAY;

             EP2AUTOINLENL = 0x00;                     // ...when EPxAUTOINLEN value is met

             SYNCDELAY;

             EP2GPIFFLGSEL = 0x01;                    //           FiFo empty Flag

}

 

void TD_Poll(void)              // Called repeatedly while the device is idle

{

             if( GPIFTRIG & 0x80 )           // GPIF is Idle

             {

                           if(!(EP2468STAT & bmEP2EMPTY))

                           {

                                        GPIFTRIG = GPIFTRIGWR | GPIF_EP2;

                           }

}

}

 

In Waveform, I repeated “Next FIFO Data on the subsequent interval” until EP2GPIFFLG empty.




Re: Last byte repeat, On NextData/ActivateData in the GPIF write Waveform Interval

Gayathri posted on 11 Apr 2012 11:32 PM PST
Cypress Employee
428 Forum Posts

 Hi,

 

Can you please share with us why you want read from the Slave device more data than is transferred from the host ? Since it is in the Auto mode, you are supposed to read only as many bytes as is transferred from host, as only so many bytes gets auto committed. If you want applications like adding a few more bytes onto the packet by the 8051, then you will have to choose the manual mode.

In auto mode, please modify your GPIF waveform such that it will terminate the Write waveform when either Transaction count reaches zero / Empty flag gets asserted.

 

Regards,

Gayathri



Re: Last byte repeat, On NextData/ActivateData in the GPIF write Waveform Interval

Il posted on 16 Apr 2012 05:31 AM PST
Member
3 Forum Posts

Thank you Gayathri for your answer.

I am developing ITS(ITS(Intelligent Transportation System) device.

The core of ITS deviceis Xilinx Spatarn 3A.

PC sends necessary parameters to ITS via USB,and ITS sends recognized car information including car image to PC via EZ-USB.  Naturally received packet is longer than send packet.

Send packet length is not const  and Receive packet length is Const.

When ITS device is reset, PC first handshake necessary information with ITS device 5~8 times.

Main key in handshaking with EZ-USB is to smothly changing From FIFO write waveform to   FIFO read waveform,and From FIFO read waveform to   FIFO write waveform.

I solved this problem as following:

void TD_Poll(void)     

{

 if(!(EP2468STAT & bmEP2EMPTY))
    {
           if(bGPIFRD==TRUE)
            {
                    GPIFTRIG = GPIFTRIGWR | GPIF_EP2;    //    send GPIF data to endpoint2
                    bGPIFRD=FALSE;
                  
            }
    else if(bGPIFRD==FALSE)
    {
           GPIFTRIG = GPIFTRIGRD | GPIF_EP6;
           bGPIFRD=TRUE;
     }


I want to use GPIFDONE flag,but it does't work properly.

My question is as following:

best way to use GPIFDONE flag.

 

 



Re: Last byte repeat, On NextData/ActivateData in the GPIF write Waveform Interval

Gayathri posted on 19 Apr 2012 11:23 PM PST
Cypress Employee
428 Forum Posts

 HI,


 


GPIFDONE flag is indication of whether the GPIF transaction has been completed or not, whether it be write/ read transaction. Before you are triggering GPIF transaction, you need to poll for GPIFDONE flag so as to know whether the previous transaction is complete or not. Please refer code snippets in page 7 and 8 in http://www.cypress.com/?docID=34260


 


Regards,


Gayathri


 


 


 


 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20