FLAG doesn't work by the Slave-Fifo mode.

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

cross mob
Anonymous
Not applicable
        Hello, I try to use EZ-USB in Slave-Fifo. They are EP6-IN and EP2-out. I could confirm that FLAGA works by the output of EP2. However, FLAGC doesn't move in input to EP6. Could you give me some advice? I tried following initialization. void TD_Init(void) // Called once at startup { CPUCS = 0x12; // CPU Control and Status Register SYNCDELAY; IFCONFIG = 0xE3; // Interface Configuration SYNCDELAY; //EP1 outout Config EP1OUTCFG = 0xB0; SYNCDELAY; //EP1 Inout Config EP1INCFG = 0xB0; SYNCDELAY; //Slave EPs setup EP2CFG = 0xA2; SYNCDELAY; EP6CFG = 0xE2; SYNCDELAY; EP4CFG = 0x02; SYNCDELAY; EP8CFG = 0x02; SYNCDELAY; FIFORESET = 0x80; SYNCDELAY; FIFORESET = 0x82; SYNCDELAY; FIFORESET = 0x84; SYNCDELAY; FIFORESET = 0x86; SYNCDELAY; FIFORESET = 0x88; SYNCDELAY; FIFORESET = 0x00; SYNCDELAY; PINFLAGSAB = 0xE8; // b7:FLAGB[3]=1 [1110]=EP6FF // b6:FLAGB[2]=1 // b5:FLAGB[1]=1 // b4:FLAGB[0]=0 // b3:FLAGA[3]=1 [1000]=EP2EF // b2:FLAGA[2]=0 // b1:FLAGA[1]=0 // b0:FLAGA[0]=0 SYNCDELAY; PINFLAGSCD = 0x9A; // b7:FLAGD[3]=1 [1001]=EP4EF // b6:FLAGD[2]=0 // b5:FLAGD[1]=0 // b4:FLAGD[0]=1 // b3:FLAGC[3]=1 [1010]=EP6EF // b2:FLAGC[2]=0 // b1:FLAGC[1]=1 // b0:FLAGC[0]=0 SYNCDELAY; FIFOPINPOLAR = 0x00; // Slave FIFO Interface Pins Polarity Register // b7:0 // b6:0 // b5:PKTEND=0 0=active low 1=active high // b4:SLOE=0 0=active low 1=active high // b3:SLRD=0 0=active low 1=active high // b2:SLWR=0 0=active low 1=active high // b1:EF=0 0=active low 1=active high // b0:FF=0 0=active low 1=active highS SYNCDELAY; EP2FIFOCFG = 0x10; // b7:0 // b6:INFM1=0 IN Full Minus One // b5:OEP1=0 OUT Empty Plus One // b4:AUTOOUT=1 Instantaneous Connection to Endpoint FIFO // b3:AUTOIN=0 Auto Commit to SIE. This bit applies only to IN endpoints // b2:ZEROLENIN=0 Enable Zero length IN Packets // b1:0 // b0:WORDWIDE=0 Select Byte/Word FIFOs on PORTB/D Pins SYNCDELAY; EP6FIFOCFG = 0x0C; // AUTOIN=1, ZEROLENIN=1, WORDWIDE=0 // b7:0 // b6:INFM1=0 IN Full Minus One // b5:OEP1=0 OUT Empty Plus One // b4:AUTOOUT=0 Instantaneous Connection to Endpoint FIFO // b3:AUTOIN=1 Auto Commit to SIE. This bit applies only to IN endpoints // b2:ZEROLENIN=1 Enable Zero length IN Packets // b1:0 // b0:WORDWIDE=0 Select Byte/Word FIFOs on PORTB/D Pins SYNCDELAY; OUTPKTEND = 0x82; SYNCDELAY; OUTPKTEND = 0x82; SYNCDELAY; OUTPKTEND = 0x82; SYNCDELAY; OUTPKTEND = 0x82; SYNCDELAY; EA = 1; SYNCDELAY; REVCTL = 0x03; SYNCDELAY; // Port A Initialize PORTACFG = 0x40; SYNCDELAY; OEC = 0xff; SYNCDELAY; IOC = 0x00; SYNCDELAY; OED = 0x00; SYNCDELAY; IOD = 0x00; SYNCDELAY; PORTECFG = 0x00; SYNCDELAY; OEE = 0xf0; SYNCDELAY; IOE = 0xff; SYNCDELAY; PORTE = 0x00; SYNCDELAY; }   
0 Likes
2 Replies
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        Hi, This is rion. I'm sorry, The line feed collapsed. Hello, I try to use EZ-USB in Slave-Fifo. They are EP6-IN and EP2-out. I could confirm that FLAGA works by the output of EP2. However, FLAGC doesn't move in input to EP6. Could you give me some advice? I tried following initialization.   
0 Likes
Anonymous
Not applicable

  Hi,

   
    

      The FIFO configuration that you have used is an invalid configuration so please look into section 1.17 EZ-USB Endpoint Buffers -page 30 of TRM for valid fifo configurations. Do REVCTL initialization in the begning of TD_Init. Please let me know why you used OUTPKTEND four time.

    

Thanks 

    

Prajith

   
0 Likes