A problem about using 68013A connect with ARM9 in full speed

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 We using external logic control 68013A in slave FIFO mode , It connect with ARM9 by linux only in full speed mode. Now we have a problem . when we using ARM wirte 68013A ,the speed can reach 200K , but when we read ,the speed only 25k,too slow.

   

 Can you give some advice,what the problem? the firmware ,the dirver(this dirver of linux were make by ourself) or  something we need setting up for linux kernel.

   

Thank  very much

0 Likes
1 Solution
Anonymous
Not applicable

 Hi,

   

 

   

A few suggestions, after going through your piece pf code:

   

 

   

- Do FIFORESET of Enpoints after configuring them, i.e. after assigning values to EPxCFG registers.

   

- I noticed, in EPxFIFOCFG registers for IN Enpoints (EP6 and EP8), you are assigning AUTOOUT bit to be as 1. Please correct the same.

   

 

   

Please refer Auto - Slave mode TD_INIT() part of code from http://www.cypress.com/?rID=45850 for reference. See if this makes any difference to the behaviour seen.

   

 

   

One more thing I wanted to confirm, I believe, the host ypu are using is only full speed capable, and that is why FX2LP is coming up in full speed. Right?

   

 

   

Regards,

   

Gayathri

View solution in original post

0 Likes
9 Replies
Anonymous
Not applicable

 Hi,

   

  I would like to see the init part of your firmware. Please take the trace of  USB traffic and post it here so that we can have a look at it.

   

Thanks

   

Prajith 

0 Likes
Anonymous
Not applicable

This is my  firmware,

   

void TD_Init( void )
{ // Called once at startup
  REVCTL = 0x01;    
  CPUCS = 0x12;                

   

 IFCONFIG = 0xe3;   
 

   

  SYNCDELAY;        
  FIFORESET = 0x80;             // ativate NAK-ALL to avoid race conditions
  SYNCDELAY;                    // see TRM section 15.14
  FIFORESET = 0x02;             // reset, FIFO 2
  SYNCDELAY;                    //
  FIFORESET = 0x04;             // reset, FIFO 4
  SYNCDELAY;                    //
  FIFORESET = 0x06;             // reset, FIFO 6
  SYNCDELAY;                    //
  FIFORESET = 0x08;             // reset, FIFO 8
  SYNCDELAY;                    //
  FIFORESET = 0x00;             // deactivate NAK-ALL

   

  SYNCDELAY;
  PINFLAGSAB = 0xf0; //0x98;    //
  SYNCDELAY;
  PINFLAGSCD = 0x08; //0xFE;    //
  SYNCDELAY;
  PORTACFG |= 0x80;             // 
  SYNCDELAY;
  FIFOPINPOLAR = 0x00;          //
  SYNCDELAY;
  EP8AUTOINLENH = 0x00; // you can define these as you wish,
  SYNCDELAY;                     // to have the FX2 automatically limit IN's
  EP8AUTOINLENL = 0x40;
  SYNCDELAY;
                                                   // handle the case where we were already in AUTO mode...
  EP2FIFOCFG = 0x00;            
  SYNCDELAY;

  
  EP2FIFOCFG = 0x10;           
  SYNCDELAY;
 
  // handle the case where we were already in AUTO mode...
  EP4FIFOCFG = 0x00;           
  SYNCDELAY;
 
  EP4FIFOCFG = 0x11;          
  SYNCDELAY;
 
  EP6FIFOCFG = 0x1c;            
  SYNCDELAY;
  EP8FIFOCFG = 0x1c;           
  SYNCDELAY;
  EP1OUTCFG  = 0xA0;
  EP1INCFG   = 0xA0;
  SYNCDELAY;  
  EP2CFG = 0xA2;
  SYNCDELAY;                   
  EP4CFG = 0xA0;
  SYNCDELAY;                   
  EP6CFG = 0xE2;
  SYNCDELAY;   
  EP8CFG = 0xE2;

   

 }

   

  Thank you very much  .

   

 I have been nagged  by this problem a long time.

0 Likes
Anonymous
Not applicable

 Hi,

   

 

   

A few suggestions, after going through your piece pf code:

   

 

   

- Do FIFORESET of Enpoints after configuring them, i.e. after assigning values to EPxCFG registers.

   

- I noticed, in EPxFIFOCFG registers for IN Enpoints (EP6 and EP8), you are assigning AUTOOUT bit to be as 1. Please correct the same.

   

 

   

Please refer Auto - Slave mode TD_INIT() part of code from http://www.cypress.com/?rID=45850 for reference. See if this makes any difference to the behaviour seen.

   

 

   

One more thing I wanted to confirm, I believe, the host ypu are using is only full speed capable, and that is why FX2LP is coming up in full speed. Right?

   

 

   

Regards,

   

Gayathri

0 Likes
Anonymous
Not applicable

As you say, I change my firmware ,

   

void TD_Init( void )
{ // Called once at startup
  REVCTL = 0x01;  
  CPUCS = 0x12;              

   

  IFCONFIG = 0xe3;  

   

  EP1OUTCFG  = 0xA0;
  EP1INCFG   = 0xA0;
  SYNCDELAY;  
               
   EP2CFG = 0xA2;

  SYNCDELAY;                   
  EP4CFG = 0x00;
  SYNCDELAY;                   
  EP6CFG = 0x02;
  SYNCDELAY;   
  EP8CFG = 0xE2;

   

  SYNCDELAY;       

   

  FIFORESET = 0x80;             // activate NAK-ALL to avoid race conditions
  SYNCDELAY;                    // see TRM section 15.14
  FIFORESET = 0x02;             // reset, FIFO 2
  SYNCDELAY;                    //
  FIFORESET = 0x04;             // reset, FIFO 4
  SYNCDELAY;                    //
  FIFORESET = 0x06;             // reset, FIFO 6
  SYNCDELAY;                    //
  FIFORESET = 0x08;             // reset, FIFO 8
  SYNCDELAY;                    //
  FIFORESET = 0x00;             

   

  SYNCDELAY;
  PORTACFG |= 0x80;             
  SYNCDELAY;
  FIFOPINPOLAR = 0x00;         

   

  SYNCDELAY;
  EP8AUTOINLENH = 0x00; 

   

  SYNCDELAY;
  EP8AUTOINLENL = 0x40;
  SYNCDELAY;
 
  EP2FIFOCFG = 0x00;            
  SYNCDELAY;

  
  EP2FIFOCFG = 0x10;             SYNCDELAY;
 
  // handle the case where we were already in AUTO mode...
  //EP4FIFOCFG = 0x00;            
  //SYNCDELAY;
 
 // EP4FIFOCFG = 0x11;           // SYNCDELAY;
 
 // EP6FIFOCFG = 0x1c;             SYNCDELAY;
  EP8FIFOCFG = 0x0c;             SYNCDELAY;

   

  SYNCDELAY;
  PINFLAGSAB = 0xf0; //0x98;     SYNCDELAY;
  PINFLAGSCD = 0x08; 

   

 }

   

 But  It also  write and read too slow.the wirte was 200K and the read was 25k. can you give me some suggestion.

   

And they say the   TD_Poll( ) ''nothing to do in the slave fifo's are in AUTO mode...'', so  I do nothing in this function.

   

As you say  my  host were only support full speed . so the FX2 can only run in full speed.

   

 Thank you  very  much .

0 Likes
Anonymous
Not applicable

Connect FX2LP loaded with Cystream firmware and use streamer/screamer too measure the maximum throughput possible in full speed. This will give you a rough estimate of the speed you can achieve.

   

What is the frequency and width of the slave FIFO interface. Have you tried hooking up a logic analyzer to see if the FPGA is sending data fast enough?

   

Regards,

   

Anand

0 Likes
Anonymous
Not applicable

     we using "c:\cypress\usb\bin\hex2bix -c 0x80 -i -f 0xC2 -o tcxmaster.iic tcxmaster.hex" force the FX2LP in full speed mode
    .when we connect it with PC of Windows,the speed will reach up 1M/s(the reading and writing speed were same),  when we connect the PC of Linux (reading and writing were also same). But when we using the ARM9 by linux the speed were very slow ,the reading speed was 25k/s the writing speed was 200k/s.
    I was also using the chipscope to looking the FX2LP full and empty pin. I would like to say,FPGA is sending data very fast.  the most time was waste in FX2LP to ARM9.  I don't know why?  And I also don't konw why the reading speed and writing speed were diffent so much .
   And thank you very much.........

0 Likes
Anonymous
Not applicable

Hi,

   

What is this tcxmaster.hex? Which firmware is this?

   

Seems you're using 1 out and 1 in endpoint. Please change them both to quad buffered. I don't see any other reason why should be seeing this behavior.

   

Also please do not write to endpoint config registers (EPxCFG) of endpoints that you're not using.

   

Regards,

   

Anand

0 Likes
Anonymous
Not applicable

   I sorry  the tcxmaster.hex is my first firmware.
   Now as you say, I delete the EP1CFG,and change the buffered to quad,But it don't improve,can you give me some suggestion.
  Thank you very much.

0 Likes
Anonymous
Not applicable

How are you ensuring that the FPGA is sending data faster than the rate you're observing on the USB?

   

How did you ascertain that FX2LP is slowing down the traffic?

   

Regards,

   

Anand

0 Likes