2 Replies Latest reply on Feb 18, 2013 8:55 AM by abhishek.madaan

    Large Data

    abhishek.madaan

      HI,

         

            I am working on transferring video data to the USB host using fx2lp development kit. Can you help me with this. My camera is 320x240 so my buffer size would be 76800. Even on my firware code if i make a loop 76800, windows doesn't recognize the drivers. CyConsole download the hex file and but doesn't recognize the drivers.

         

       

         

      i am doing this in my code

         

      WORD i,j;

         

      WORD *Destination = (WORD *) (&EP6FIFOBUF);

         

      for(j=0;j<150;j++)

         

      {

         

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

         

           {

         

                  *Destination++ = 1;

         

            }

         

           EP6BCH = MSB(count);

         

           SYNCDELAY;

         

            EP6BCL = LSB(count);

         

             SYNCDELAY;   

         

      }

         

       

         

      Please let me know how I can do this. 

         

       

         

      Regards,

         

      ABM

        • 1. Re: Large Data
          rama.sai.krishna.vakkantula

          Hi,

             

          Did you look at the CATC trace to see what is going wrong with the enumeration.

             

          Or did you check the enumeration process by commenting out the piece of code that you pasted here. Is it successful after that.?

             

          Please attach your project here, if possible.

             

          Thanks,

             

          Sai Krishna.

          • 2. Re: Large Data
            abhishek.madaan

             Hi RSKV,

               

                              Thanks for your reply. I troubleshoot further and found the problem

               

            WORD *Destination = (WORD *) (&EP6FIFOBUF);

               

             

               

            The above line has the problem. If i don't use the above line and assign values directly to EP6FIFOBUF then the code works but it doesn't work when i try to cast EP6FIFOBUF to WORD. 

               

            What I am saying is that the following code works

               

             

               

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

               

            {

               

                   WORD i,j;

               

                  WORD count;

               

            if(!(EP2468STAT & bmEP6FULL))

               

            {  // check EP6 FULL(busy) bit in EP2468STAT (SFR), core set's this bit when FIFO is full

               

               // loop EP2OUT buffer data to EP6IN

               

            count = 0;

               

            for (i=0;i<150;i++)

               

                   {

               

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

               

                          {

               

                                        EP6FIFOBUF[j] = j;

               

                           }

               

                EP6BCH = 0x02;

               

                             EP6BCL = 0x00;

               

               count++;

               

              }

               

            }  

               

             

               

            But The above approach has two problems.

               

            1. I want to send 16 bits of data. Since EP6FIFOBUF is an array of BYTE so I can't send it 16 bytes with it. 

               

            2. I looked in the example of CyStream where there second loop was 1024 bytes instead of 512 bytes. I rather send packet of 1024 bytes but when i do that in my host program I start to get garbage value after 512 bytes. Can you explain why it is happening? Will there be any speed advantage by sending 1024 bytes instead of 512 bytes?

               

             

               

            Thanks for your support.

               

             

               

            Regards,

               

            Abhishek Madaan