1 Reply Latest reply on Sep 26, 2018 6:59 AM by SananyaM_56

    fx2lp bytes missing

    gean_3054931

      Hello,

      Hello i am sending known pattern of 512 bytes through endpoint 6 from fx2lp to host.

      i am adding count variable in the every 512 bytes transfer and making count increment.if i look at this count in the host side,i am not recieving proper count increment.i am requesting 51200 bytes in one TRANSFERIN button in the control center.count bytes are missing in the middle.please find the below code example and test patern recieved in the host.why some bytes are failed to commit to host?

      int count=0;

      BYTE Test_data;

       

      void TD_Init( void )

      {

        CPUCS = 0x02;

        SYNCDELAY;

      // IFCONFIG = 0x03; 

      /*Commented,default port mode*/

       

      }

       

      void TD_Poll( void )

      {

        FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions

        SYNCDELAY;

        EP6FIFOCFG = 0x00; //switching to manual mode

        SYNCDELAY;

        for(loop=0;loop<512;loop++)

      {

        EP6FIFOBUF[loop] = Test_data;

              SYNCDELAY;

              Test_data++;    

      }

      EP6FIFOBUF[511]=count;

      SYNCDELAY;

        count++;

        EP6BCH=0x02; //512 bytes committed

        SYNCDELAY;

        EP6BCL=0x00;

        SYNCDELAY;

        FIFORESET = 0x00;  //Release NAKALL

       

              Test_data=0x00;

      }

       

      regadrs,

      geetha.

        • 1. Re: fx2lp bytes missing
          SananyaM_56

          Hello Geetha,

           

          Please use the following code snippet for TD_Poll()-

           

          void TD_Poll( void )

          {

            FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions

            SYNCDELAY;

            EP6FIFOCFG = 0x00; //switching to manual mode

            SYNCDELAY;

           

          if(!(EP2468STAT & bmEP6FULL))

          {

            for(loop=0;loop<512;loop++)

          {

            EP6FIFOBUF[loop] = Test_data;

                  SYNCDELAY;

                  Test_data++;   

          }

          EP6FIFOBUF[511]=count;

          SYNCDELAY;

            count++;

           

            EP6BCH=0x02; //512 bytes committed

            SYNCDELAY;

            EP6BCL=0x00;

            SYNCDELAY;

            FIFORESET = 0x00;  //Release NAKALL

           

                  Test_data=0x00;

          }

          }

           

          Best Regards,

          Sananya