10 Replies Latest reply on Dec 4, 2013 10:21 PM by prajith.cheerakkoda

    68013a :EP2AUTOINLENH\L can not be modified successfully

    andy.yao

       hello,

         

      I found that register EP2AUTOINLENH\L is always kept as default value when I try to modify it. I tried to write 0x01,0x03,0x04 into EP2AUTOINLENH\L separately.,but It always present   EP2AUTOINLENH= 2,EP2AUTOINLENL = 0 when I read them;why could this happen? I need some help,sorry for my pool english,welcome to ask me when my point is not expressed clearly ,here is my TD_init code:

         

       

         

      void TD_Init(void)             // Called once at startup

         

      {

         

      CPUCS = 0x0a;//24Mclk 

         

      SYNCDELAY;

         

      REVCTL = 0x03;   

         

      SYNCDELAY;

         

      FX2InitI2C();

         

       

         

      PORTACFG =  0x01;//P00 set to int0 mode

         

      OEA = 0x00; //

         

      IOA = 0xff; // 

         

       

         

      PORTECFG =  0x00;//all set to GPIO definition

         

          OEE = 0x00;  //all set to input...

         

      IOE = 0xff;  //output set to 0 .input set to 1

         

      SYNCDELAY;

         

       

         

      PORTCCFG =  0x00;//all set to GPIO definition

         

      OEC = ~0x20;  //PC 8 pin all set to output 

         

      IOC = ~0x01;  //PC0 reset sensor ... now set to 0:reset state... //20130729 added 

         

      SYNCDELAY;

         

       

         

      EP1INCFG = 0xb0;

         

      SYNCDELAY;

         

       

         

      PINFLAGSAB = 0xcc;

         

      SYNCDELAY;

         

      PINFLAGSCD = 0xcc;

         

      SYNCDELAY;

         

       

         

      FIFOPINPOLAR = 0x3c; //0x3c for ov or hynix

         

      SYNCDELAY;

         

       

         

      WAKEUPCS = 0x04;     //!!! should like this.others can't work when power on..

         

      SYNCDELAY;

         

          IFCONFIG = 0x43;

         

      SYNCDELAY;

         

       

         

      EP2CFG = 0xe8;

         

      SYNCDELAY;

         

      EP4CFG = 0;

         

      SYNCDELAY;

         

      EP6CFG = 0;

         

      SYNCDELAY;

         

      EP8CFG = 0;

         

          SYNCDELAY;

         

           

         

       

         

          EP2AUTOINLENH = 0x01 //0x03,0x04

         

          SYNCDELAY;                  // 

         

       

         

          EP2AUTOINLENL = 0x00;

         

          SYNCDELAY;

         

          

         

          EP2FIFOCFG = 0x0c; //8bit autoin

         

      SYNCDELAY;

         

          

         

      FIFORESET = 0x80;

         

      SYNCDELAY;

         

      FIFORESET = 0x02;

         

      SYNCDELAY;

         

      // FIFORESET = 0x06;

         

      // SYNCDELAY;

         

      FIFORESET = 0x00;

         

      SYNCDELAY;

         

       

         

          

         

      //    EP2BCH = 4;

         

      //    SYNCDELAY;

         

      //    EP2BCL = 0;

         

      //    SYNCDELAY;

         

       

         

          INPKTEND = 0x82;                   //“arming” the IN transfer

         

          SYNCDELAY;                         

         

          INPKTEND = 0x82;                 

         

          SYNCDELAY;

         

          INPKTEND = 0x82;                   //“arming” the IN transfer

         

          SYNCDELAY;                         

         

          INPKTEND = 0x82;                 

         

          SYNCDELAY;

         

          

         

          // enable dual autopointer(s)

         

          AUTOPTRSETUP |= 0x01;

         

       

         

       

         

      // _alpum_init();

         

       

         

      SerialPort_Init(BD_115200);

         

       

         

      EX0 = 0;//disable interrupt..

         

      IT0 = 1;//edge effective interrupt.

         

      IE0 = 0;

         

       

         

      m_WorkState = 0;

         

      m_bIsMe = 0;

         

      m_CheckNum = 0;

         

      m_bNoStop = 0;

         

       

         

      m_SlaveID = SENSOR_ID;

         

      m_I2CData[0] = 0;

         

      m_I2CData[1] = 0;

         

       

         

      EZUSB_Delay(20);  //20130729 added 

         

      P20 = 1;      //20130729 added 

         

      Rwuen = TRUE;        // Enable remote wakeup

         

          

         

          dbg_str("EP2CFG=");

         

          dbg_int(EP2CFG);

         

          dbg_str(",EP2AUTOINLENH=");

         

          dbg_int(EP2AUTOINLENH);

         

          dbg_str(",EP2AUTOINLENL=");

         

          dbg_int(EP2AUTOINLENL);

         

          dbg_str(",REVCTL=");

         

          dbg_int(REVCTL);

         

      }