This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems w/ Slave FIFO (FX2LP)

Hi,
Can anybosy who have worked on FX2LP help me? I'm writing firmware (converted from bulkloop)of slave FIFO mode w/ FX2LP(Cameleon). I'm using AUTOOUT mode w/ EP2, so, regarding UZ_USB_TRM, i don't think I need any codes in TD_Poll.
If anyone finds any mistakes, please let me know, thanks.

void TD_Init(void) // Called once at startup
{

  CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1) ;

  IFCONFIG = 0xe3; // slave FIFO

  SYNCDELAY;

  REVCTL = 0x03;
  SYNCDELAY;

  EP1OUTCFG = 0xA0; //Active Endpoint1-out , type = BULK (E610)
  EP1INCFG = 0xA0; //Active Endpoint1-in  , type = BULK (E610)
  SYNCDELAY;
  EP2CFG = 0xA2;
  SYNCDELAY;
  EP4CFG = 0x00; // invalid
  SYNCDELAY;
  EP6CFG = 0x00;
  SYNCDELAY;
  EP6CFG = 0x00;
  SYNCDELAY;

  EP2BCL = 0x80;   // arm EP2OUT by writing byte count w/skip. (E691)
  SYNCDELAY;
  EP2BCL = 0x80;
  SYNCDELAY;

  PINFLAGSAB = 0x00;
  SYNCDELAY;
  PINFLAGSCD = 0x00;

  OEB = 0xff; // PortB All Output
  OED = 0xff; // PortD All Output

  FIFORESET = 0x80;
  SYNCDELAY;
  FIFORESET = 0x02;
  SYNCDELAY;
  FIFORESET = 0x04;
  SYNCDELAY;
  FIFORESET = 0x06;
  SYNCDELAY;
  FIFORESET = 0x08;
  SYNCDELAY;

  OUTPKTEND = 0x82;
  SYNCDELAY;
  OUTPKTEND = 0x82;
  SYNCDELAY;
  OUTPKTEND = 0x82;
  SYNCDELAY;
  OUTPKTEND = 0x82;
  SYNCDELAY;

  EP2FIFOCFG = 0x10; // FD[7:0]->PortB
  SYNCDELAY;

  IOD = 0xe0; // Set a Mode
}

0