This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28335: Z-Flag detection issue

Part Number: TMS320F28335

Hello,

We have encountered a recurrent problem with our F28335 EZDSP.

Sometimes it seems that the encoder module does not detect a Z-Flag during operation no matter how many times the motor completes 360 deg rotations. We have even measured using an Oscilloscope at the the uC pin and indeed the pulse is present at the input.
The only solution we found is to reset the CPU using CCS 3.3 and then we are able to detect Z-flags again !

Does any one have a similar experience with this processor ? Any suggestions on what could be the cause are welcome.

Thanks

Abdoon

  • Hi,

    I'm assuming you are trying to connect QEP outputs of the encoder to the eQEP module and 
    When you say the module does not detect Z-Flag, do you mean the Position counter is not reset?
    Can you share the EQEP configuration?

    -Bharathi.

  • Hello,


    I forgot to mention that we use Matlab simulink to generate our code. Please find the resulting code bellow

    /* Enable internal pull-up for the selected pins */

      GpioCtrlRegs.GPAPUD.bit.GPIO20 = 0;  /* Enable pull-up on GPIO20 (EQEP1A)*/

      GpioCtrlRegs.GPAPUD.bit.GPIO21 = 0;  /* Enable pull-up on GPIO21 (EQEP1B)*/

      GpioCtrlRegs.GPAPUD.bit.GPIO22 = 0;  /* Enable pull-up on GPIO22 (EQEP1S)*/

      GpioCtrlRegs.GPAPUD.bit.GPIO23 = 0;  /* Enable pull-up on GPIO23 (EQEP1I)*/

     

      /* Configure eQEP-1 pins using GPIO regs*/

      GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 1; /* Configure GPIO20 as EQEP1A*/

      GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 1; /* Configure GPIO21 as EQEP1B  */

      GpioCtrlRegs.GPAMUX2.bit.GPIO22 = 1; /* Configure GPIO22 as EQEP1S*/

      GpioCtrlRegs.GPAMUX2.bit.GPIO23 = 1; /* Configure GPIO23 as EQEP1I*/

      EDIS;

      EQep1Regs.QPOSINIT= pcInitialvalue;  /*eQEP Initialization Position Count*/

      EQep1Regs.QPOSMAX= pcmaximumvalue;   /*eQEP Maximum Position Count*/

      EQep1Regs.QUPRD= unittimerperiod;    /*eQEP Unit Period Register*/

      EQep1Regs.QWDPRD= watchdogtimer;     /*eQEP watchdog timer Register*/

      EQep1Regs.QDECCTL.all = qdecctl;     /*eQEP Decoder Control (QDECCTL) Register*/

      EQep1Regs.QEPCTL.all = qepctl;       /*eQEP Control (QEPCTL) Register*/

      EQep1Regs.QPOSCTL.all = qposctl;     /*eQEP Position-compare Control (QPOSCTL) Register*/

      EQep1Regs.QCAPCTL.all = qcapctl;     /*eQEP Capture Control (QCAPCTL) Register*/

      EQep1Regs.QEPCTL.bit.FREE_SOFT= 2;   /*unaffected by emulation suspend*/

      EQep1Regs.QPOSCMP = comparevalue;    /*eQEP Position-compare*/

      EQep1Regs.QEINT.all = qeint;         /*eQEPx interrupt enable register*/

     

     

    Where

    pcmaximumvalue = 2047U;

    pcInitialvalue = 0U;

    unittimerperiod = 0;

    comparevalue = 0;

    watchdogtimer = 0;

    qdecctl = 0;

    qepctl = 136;

    qposctl = 32768;

    qcapctl = 119;

    qeint = 0;