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.

TMS320F280023C: Any way to "re-arm" the QEP to accept a "new" first-index pulse?

Part Number: TMS320F280023C


Hi,

  For our system, the motor may initially 'jump' (and potentially trigger a 'first index' event) before we actually want to get the first index.  That is, we want the first index after a 'blanking period'.

We are using this code to attempt to re-enable the triggering:

                EQEP_clearStatus(motor_QEP_BASE, EQEP_STS_1ST_IDX_FLAG);

But it seems to just clear the status bit but not actually re-arm the system to latch in the next actual index pulse.

Is there some way to get it to completely clear the First Index status so that it re-sets the bit on the next index pulse?

Here's the rest of the initialization code (created from the .syscfg):

void EQEP_init(){
    //motor_QEP initialization
        
    EQEP_SourceSelect source_motor_QEP =
    {
        EQEP_SOURCE_DEVICE_PIN,         // eQEPA source
        EQEP_SOURCE_DEVICE_PIN,        // eQEPB source
        EQEP_SOURCE_DEVICE_PIN,      // eQEP Index source
    };
    // Selects the source for eQEPA/B/I signals
    EQEP_selectSource(motor_QEP_BASE, source_motor_QEP);
    // Set the strobe input source of the eQEP module.
    EQEP_setStrobeSource(motor_QEP_BASE,EQEP_STROBE_FROM_GPIO);
    // Sets the polarity of the eQEP module's input signals.
    EQEP_setInputPolarity(motor_QEP_BASE,false,false,true,false);
    // Configures eQEP module's quadrature decoder unit.
    EQEP_setDecoderConfig(motor_QEP_BASE, (EQEP_CONFIG_QUADRATURE | EQEP_CONFIG_2X_RESOLUTION | EQEP_CONFIG_NO_SWAP | EQEP_CONFIG_IGATE_DISABLE));
    // Set the emulation mode of the eQEP module.
    EQEP_setEmulationMode(motor_QEP_BASE,EQEP_EMULATIONMODE_RUNFREE);
    // Configures eQEP module position counter unit.
    EQEP_setPositionCounterConfig(motor_QEP_BASE,EQEP_POSITION_RESET_1ST_IDX,65535U);
    // Sets the current encoder position.
    EQEP_setPosition(motor_QEP_BASE,0U);
    // Disables the eQEP module unit timer.
    EQEP_disableUnitTimer(motor_QEP_BASE);
    // Disables the eQEP module watchdog timer.
    EQEP_disableWatchdog(motor_QEP_BASE);
    // Configures the quadrature modes in which the position count can be latched.
    EQEP_setLatchMode(motor_QEP_BASE,(EQEP_LATCH_CNT_READ_BY_CPU|EQEP_LATCH_RISING_STROBE|EQEP_LATCH_SW_INDEX_MARKER));
    // Set the quadrature mode adapter (QMA) module mode.
    EQEP_setQMAModuleMode(motor_QEP_BASE,EQEP_QMA_MODE_BYPASS);
    // Disable Direction Change During Index
    EQEP_disableDirectionChangeDuringIndex(motor_QEP_BASE);
    // Configures the mode in which the position counter is initialized.
    EQEP_setPositionInitMode(motor_QEP_BASE,(EQEP_INIT_FALLING_INDEX));
    // Sets the software initialization of the encoder position counter.
    EQEP_setSWPositionInit(motor_QEP_BASE,true);
    // Sets the init value for the encoder position counter.
    EQEP_setInitialPosition(motor_QEP_BASE,0U);
    // Enables the eQEP module.
    EQEP_enableModule(motor_QEP_BASE);
}

Thanks,

-Mike

  • Hi Mike,

    Can you provide the .syscfg with your eQEP configuration within it? This would be easier to see how your eQEP is exactly configured. 

    For our system, the motor may initially 'jump'

    Is this something that is inherent to your system and the motor "physically jumps", or is this a result of some connection issue between the motor and the device? Resetting the status will not automatically reprompt for the first index flag. I believe an option you can take is to reset the eQEP peripheral using the QPEN bit when you detect one of these unwanted jumps

    Regards,

    Peter

  • Hi, and thanks for your response.  I'm attaching the .syscfg file for your review.

    Regarding the motor "jump", this happens when the PWMs are first turned on (we don't have an angle sensor on the motor), depending on where the motor was when it was last used, the initial magnetic field angle will likely be different than the actual motor pole angle.   We then rotate the field for one turn, allowing the motor to sync up to the magnetic field, and then when the index is detected, we know the motor pole orientation.  But this generally causes an initial jump, which can falsely trigger the 'first index' flag.   Perhaps there's a better way?

    Regarding QPEN, based on our testing, this does not appear to work, we even tried initially keeping the QEP disabled, and only enabling it (via     EQEP_enableModule(motor_QEP_BASE);) after the first quarter turn, but it appeared that even when the module was disabled, it would still latch the 'first index'.

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "F28002x" --package "80QFP" --part "F28002x_80QFP" --product "C2000WARE@3.01.00.00"
     * @versions {"tool":"1.12.0+2406"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const adc             = scripting.addModule("/driverlib/adc.js", {}, false);
    const adc1            = adc.addInstance();
    const analog          = scripting.addModule("/driverlib/analog.js", {}, false);
    const analog1         = analog.addInstance();
    const asysctl         = scripting.addModule("/driverlib/asysctl.js");
    const clb             = scripting.addModule("/driverlib/clb.js", {}, false);
    const clb1            = clb.addInstance();
    const clb2            = clb.addInstance();
    const clb_inputxbar   = scripting.addModule("/driverlib/clb_inputxbar.js", {}, false);
    const clb_inputxbar1  = clb_inputxbar.addInstance();
    const clb_outputxbar  = scripting.addModule("/driverlib/clb_outputxbar.js", {}, false);
    const clb_outputxbar1 = clb_outputxbar.addInstance();
    const clb_outputxbar2 = clb_outputxbar.addInstance();
    const cmpss           = scripting.addModule("/driverlib/cmpss.js", {}, false);
    const cmpss1          = cmpss.addInstance();
    const cputimer        = scripting.addModule("/driverlib/cputimer.js", {}, false);
    const cputimer1       = cputimer.addInstance();
    const epwm            = scripting.addModule("/driverlib/epwm.js", {}, false);
    const epwm1           = epwm.addInstance();
    const epwm2           = epwm.addInstance();
    const epwm3           = epwm.addInstance();
    const eqep            = scripting.addModule("/driverlib/eqep.js", {}, false);
    const eqep1           = eqep.addInstance();
    const gpio            = scripting.addModule("/driverlib/gpio.js", {}, false);
    const gpio1           = gpio.addInstance();
    const gpio2           = gpio.addInstance();
    const gpio3           = gpio.addInstance();
    const gpio4           = gpio.addInstance();
    const gpio5           = gpio.addInstance();
    const gpio6           = gpio.addInstance();
    const gpio7           = gpio.addInstance();
    const gpio8           = gpio.addInstance();
    const gpio9           = gpio.addInstance();
    const gpio10          = gpio.addInstance();
    const gpio11          = gpio.addInstance();
    const gpio12          = gpio.addInstance();
    const gpio13          = gpio.addInstance();
    const gpio14          = gpio.addInstance();
    const gpio15          = gpio.addInstance();
    const lin             = scripting.addModule("/driverlib/lin.js", {}, false);
    const lin1            = lin.addInstance();
    const outputxbar      = scripting.addModule("/driverlib/outputxbar.js", {}, false);
    const outputxbar1     = outputxbar.addInstance();
    const outputxbar2     = outputxbar.addInstance();
    const sci             = scripting.addModule("/driverlib/sci.js", {}, false);
    const sci1            = sci.addInstance();
    const spi             = scripting.addModule("/driverlib/spi.js", {}, false);
    const spi1            = spi.addInstance();
    const spi2            = spi.addInstance();
    const TILE            = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE", {}, false);
    const TILE1           = TILE.addInstance();
    const TILE2           = TILE.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    adc1.$name               = "ADC_InstanceA";
    adc1.enabledSOCs         = ["ADC_SOC_NUMBER0","ADC_SOC_NUMBER1","ADC_SOC_NUMBER2","ADC_SOC_NUMBER3","ADC_SOC_NUMBER4"];
    adc1.soc0Trigger         = "ADC_TRIGGER_EPWM1_SOCA";
    adc1.soc1Channel         = "ADC_CH_ADCIN1";
    adc1.soc1Trigger         = "ADC_TRIGGER_EPWM2_SOCA";
    adc1.soc2Channel         = "ADC_CH_ADCIN2";
    adc1.soc2Trigger         = "ADC_TRIGGER_EPWM4_SOCA";
    adc1.soc3Channel         = "ADC_CH_ADCIN5";
    adc1.soc4Channel         = "ADC_CH_ADCIN6";
    adc1.useInterrupts       = false;
    adc1.socHighPriorityMode = "ADC_PRI_THRU_SOC2_HIPRI";
    
    asysctl.analogReference        = "INTERNAL";
    asysctl.analogReferenceVoltage = "1P65";
    
    clb1.attachTile                = true;
    clb1.enableCLB                 = true;
    clb1.initTile                  = true;
    clb1.$name                     = "BISS_RA_CLB";
    clb1.clken                     = true;
    clb1.localConfigCLB_IN0        = "CLB_LOCAL_IN_MUX_CLB_PSCLK";
    clb1.localConfigCLB_IN1        = "CLB_LOCAL_IN_MUX_INPUT1";
    clb1.globalConfigCLB_IN0       = "CLB_GLOBAL_IN_MUX_CLB_AUXSIG0";
    clb1.inputTypeCLB_IN0          = "LOCAL";
    clb1.globalConfigCLB_IN1       = "CLB_GLOBAL_IN_MUX_CLB_AUXSIG4";
    clb1.strb                      = true;
    clb1.inputTypeCLB_IN1          = "LOCAL";
    clb1.inputsUsed                = ["CLB_IN0","CLB_IN1","CLB_IN2","CLB_IN3"];
    clb1.gpStartValueConfigCLB_IN3 = 1;
    clb1.prescale                  = 256;
    clb1.tap                       = 7;
    
    clb2.clbBase    = "CLB2_BASE";
    clb2.attachTile = true;
    clb2.initTile   = true;
    clb2.$name      = "the_other_CLB";
    
    clb_inputxbar1.CLB_INPUTXBAR1Gpio = "GPIO17";
    clb_inputxbar1.CLB_INPUTXBAR1Lock = true;
    clb_inputxbar1.inputsUsed         = ["CLB_INPUTXBAR1Gpio"];
    clb_inputxbar1.$name              = "BiSS_Data_In";
    
    clb_outputxbar1.muxesUsed                                = ["XBAR_MUX03"];
    clb_outputxbar1.$name                                    = "Biss_Debug_try2_not_works";
    clb_outputxbar1.clb_outputxbar.$assign                   = "CLB_OUTPUTXBAR1";
    clb_outputxbar1.clb_outputxbar.clb_outputxbarPin.$assign = "ball.51";
    
    clb_outputxbar2.$name                                    = "BiSS_Debug_Try3_Works";
    clb_outputxbar2.muxesUsed                                = ["XBAR_MUX03"];
    clb_outputxbar2.clb_outputxbar.$assign                   = "CLB_OUTPUTXBAR4";
    clb_outputxbar2.clb_outputxbar.clb_outputxbarPin.$assign = "ball.73";
    
    cmpss1.$name = "myCMPSS0";
    
    adc1.analog                             = analog1;
    cmpss1.analog                           = analog1;
    analog1.$name                           = "Analog_PinMuxforA";
    analog1.analog.$assign                  = "ANALOG";
    analog1.analog["a0/c15Pin"].$assign     = "ball.19";
    analog1.analog.a1Pin.$assign            = "ball.18";
    analog1.analog["a10/c10Pin"].$assign    = "ball.29";
    analog1.analog["a11/c0Pin"].$assign     = "ball.16";
    analog1.analog["a12/c1Pin"].$assign     = "ball.22";
    analog1.analog["a14/c4Pin"].$assign     = "ball.15";
    analog1.analog["a15/c7Pin"].$assign     = "ball.14";
    analog1.analog["a2/c9Pin"].$assign      = "ball.13";
    analog1.analog["a3/c5/vdacPin"].$assign = "ball.12";
    analog1.analog["a4/c14Pin"].$assign     = "ball.27";
    analog1.analog["a5/c2Pin"].$assign      = "ball.17";
    analog1.analog.a6Pin.$assign            = "ball.10";
    analog1.analog["a7/c3Pin"].$assign      = "ball.23";
    analog1.analog["a8/c11Pin"].$assign     = "ball.24";
    analog1.analog["a9/c8Pin"].$assign      = "ball.28";
    analog1.analog.c6Pin.$assign            = "ball.11";
    
    cputimer1.$name              = "motionTickTimer";
    cputimer1.emulationMode      = "CPUTIMER_EMULATIONMODE_RUNFREE";
    cputimer1.enableInterrupt    = true;
    cputimer1.registerInterrupts = true;
    cputimer1.startTimer         = true;
    cputimer1.timerPeriod        = 30000;
    
    epwm1.$name                  = "motorPWM1_U";
    epwm1.epwm.$assign           = "EPWM1";
    epwm1.epwm.epwm_aPin.$assign = "ball.63";
    epwm1.epwm.epwm_bPin.$assign = "ball.62";
    
    epwm2.$name                  = "motorPWM2_V";
    epwm2.epwm.$assign           = "EPWM2";
    epwm2.epwm.epwm_aPin.$assign = "ball.61";
    epwm2.epwm.epwm_bPin.$assign = "ball.60";
    
    epwm3.$name                  = "motorPWM4_W";
    epwm3.epwm.$assign           = "EPWM4";
    epwm3.epwm.epwm_aPin.$assign = "ball.67";
    epwm3.epwm.epwm_bPin.$assign = "ball.65";
    
    eqep1.$name                       = "motor_QEP";
    eqep1.emulationMode               = "EQEP_EMULATIONMODE_RUNFREE";
    eqep1.positionCounterMax          = 65535;
    eqep1.positionCounterMode         = "EQEP_POSITION_RESET_1ST_IDX";
    eqep1.inputPolarity               = ["invertIndex"];
    eqep1.latchIndexPosition          = "EQEP_LATCH_SW_INDEX_MARKER";
    eqep1.swPositionInit              = true;
    eqep1.useInterrupts               = false;
    eqep1.positionIndexEvents         = "EQEP_INIT_FALLING_INDEX";
    eqep1.enableModule                = true;
    eqep1.eqep.$assign                = "EQEP1";
    eqep1.eqep.eqep_aPin.$assign      = "ball.69";
    eqep1.eqep.eqep_bPin.$assign      = "ball.46";
    eqep1.eqep.eqep_strobePin.$assign = "ball.58";
    eqep1.eqep.eqep_indexPin.$assign  = "ball.54";
    
    gpio1.direction       = "GPIO_DIR_MODE_OUT";
    gpio1.qualMode        = "GPIO_QUAL_ASYNC";
    gpio1.$name           = "Blinky_LED";
    gpio1.gpioPin.$assign = "ball.2";
    
    gpio2.direction       = "GPIO_DIR_MODE_OUT";
    gpio2.$name           = "FrontStatus_LED";
    gpio2.gpioPin.$assign = "ball.77";
    
    gpio3.$name             = "dbgFlag1";
    gpio3.direction         = "GPIO_DIR_MODE_OUT";
    gpio3.qualMode          = "GPIO_QUAL_ASYNC";
    gpio3.writeInitialValue = true;
    gpio3.gpioPin.$assign   = "ball.6";
    
    gpio4.$name             = "motor_gatesel0";
    gpio4.writeInitialValue = true;
    gpio4.gpioPin.$assign   = "ball.74";
    
    gpio5.$name             = "motor_gatesel1";
    gpio5.writeInitialValue = true;
    gpio5.gpioPin.$assign   = "ball.75";
    
    gpio6.$name           = "motor_fault";
    gpio6.gpioPin.$assign = "ball.68";
    
    gpio7.$name             = "motor_enable";
    gpio7.direction         = "GPIO_DIR_MODE_OUT";
    gpio7.writeInitialValue = true;
    gpio7.gpioPin.$assign   = "ball.66";
    
    gpio8.$name             = "motor_gain_sel";
    gpio8.direction         = "GPIO_DIR_MODE_OUT";
    gpio8.writeInitialValue = true;
    gpio8.gpioPin.$assign   = "ball.64";
    
    gpio9.$name           = "jtag_TDI";
    gpio9.gpioPin.$assign = "ball.48";
    
    gpio10.$name           = "boot_mode_sel0_gpio32";
    gpio10.gpioPin.$assign = "ball.49";
    
    gpio11.$name           = "boot_mode_sel1_gpio24";
    gpio11.gpioPin.$assign = "ball.41";
    
    gpio12.$name           = "Sam_Flag1";
    gpio12.gpioPin.$assign = "ball.42";
    
    gpio13.$name           = "Sam_Flag2";
    gpio13.gpioPin.$assign = "ball.43";
    
    gpio14.$name           = "Joystick_Button_In";
    gpio14.gpioPin.$assign = "ball.59";
    
    gpio15.$name           = "AxisID";
    gpio15.gpioPin.$assign = "ball.38";
    
    lin1.$name                 = "DbgSerial";
    lin1.lin.$assign           = "LINB";
    lin1.lin.lin_rxPin.$assign = "ball.35";
    lin1.lin.lin_txPin.$assign = "ball.36";
    
    outputxbar1.muxesUsed                        = ["XBAR_MUX01"];
    outputxbar1.mux1Config                       = "XBAR_OUT_MUX01_CLB1_OUT4";
    outputxbar1.$name                            = "CLB_Biss_Clk_Out";
    outputxbar1.outputxbar.$assign               = "OUTPUTXBAR4";
    outputxbar1.outputxbar.outputxbarPin.$assign = "ball.78";
    
    outputxbar2.mux1Config                       = "XBAR_OUT_MUX01_CLB1_OUT4";
    outputxbar2.$name                            = "CLB_BiSS_Debug_Out";
    outputxbar2.muxesUsed                        = ["XBAR_MUX03"];
    outputxbar2.mux3Config                       = "XBAR_OUT_MUX03_CLB1_OUT5";
    outputxbar2.outputxbar.$assign               = "OUTPUTXBAR5";
    outputxbar2.outputxbar.outputxbarPin.$assign = "ball.57";
    
    sci1.useFifo               = false;
    sci1.useInterrupts         = false;
    sci1.$name                 = "Sam_SCI";
    sci1.baudRates             = 38400;
    sci1.sci.$assign           = "SCIA";
    sci1.sci.sci_rxPin.$assign = "ball.4";
    sci1.sci.sci_txPin.$assign = "ball.3";
    
    spi1.useFifo                 = false;
    spi1.useInterrupts           = false;
    spi1.mode                    = "SPI_MODE_MASTER";
    spi1.bitRate                 = 2500000;
    spi1.$name                   = "H_bridge_SPI";
    spi1.spi.$assign             = "SPIA";
    spi1.spi.spi_simoPin.$assign = "ball.39";
    spi1.spi.spi_somiPin.$assign = "ball.76";
    spi1.spi.spi_clkPin.$assign  = "ball.50";
    spi1.spi.spi_stePin.$assign  = "ball.37";
    
    spi2.$name                   = "BiSS_SPI";
    spi2.bitRate                 = 1200000;
    spi2.spi.$assign             = "SPIB";
    spi2.spi.spi_simoPin.$assign = "ball.1";
    spi2.spi.spi_somiPin.$assign = "ball.80";
    spi2.spi.spi_clkPin.$assign  = "ball.79";
    spi2.spi.spi_stePin.$assign  = "ball.44";
    
    clb1.tile                       = TILE1;
    TILE1.$name                     = "BISS_RA_TILE";
    TILE1.BOUNDARY.$name            = "BOUNDARY0";
    TILE1.BOUNDARY.in_sync0         = true;
    TILE1.BOUNDARY.in0              = "squareWave";
    TILE1.BOUNDARY.in_period0       = 32;
    TILE1.BOUNDARY.in_duty0         = 16;
    TILE1.BOUNDARY.in1              = "1";
    TILE1.BOUNDARY.in2              = "squareWave";
    TILE1.BOUNDARY.in_repeat_count2 = 2;
    TILE1.LUT_0.$name               = "LUT_0";
    TILE1.LUT_0.i0                  = "BOUNDARY.in3";
    TILE1.LUT_0.i1                  = "COUNTER_0.count_match2";
    TILE1.LUT_0.eqn                 = "i0 | i1";
    TILE1.LUT_1.$name               = "LUT_1";
    TILE1.LUT_1.i1                  = "BOUNDARY.in0";
    TILE1.LUT_1.i0                  = "COUNTER_2.count_match2";
    TILE1.LUT_1.i2                  = "BOUNDARY.in2";
    TILE1.LUT_1.eqn                 = "i1 | (~ i0)";
    TILE1.LUT_2.$name               = "LUT_2";
    TILE1.LUT_2.i0                  = "FSM_1.OUT";
    TILE1.LUT_2.i1                  = "LUT_1.OUT";
    TILE1.LUT_2.eqn                 = "~i1";
    TILE1.FSM_0.$name               = "FSM_0";
    TILE1.FSM_1.$name               = "FSM_1";
    TILE1.FSM_1.eqn_out             = "s0 & (~e0)";
    TILE1.FSM_1.eqn_s0              = "e0";
    TILE1.FSM_1.eqn_s1              = "0";
    TILE1.FSM_1.e0                  = "LUT_1.OUT";
    TILE1.FSM_2.$name               = "FSM_2";
    TILE1.FSM_2.e0                  = "LUT_1.OUT";
    TILE1.FSM_2.e1                  = "BOUNDARY.in1";
    TILE1.FSM_2.eqn_out             = "e1";
    TILE1.COUNTER_0.$name           = "COUNTER_0";
    TILE1.COUNTER_0.action          = "Add";
    TILE1.COUNTER_0.event           = "LUT_2.OUT";
    TILE1.COUNTER_0.event_load_val  = "1";
    TILE1.COUNTER_0.reset           = "BOUNDARY.in3";
    TILE1.COUNTER_0.match1_val      = "32";
    TILE1.COUNTER_0.match2_val      = "44";
    TILE1.COUNTER_1.$name           = "COUNTER_1";
    TILE1.COUNTER_1.action          = "Shift Right";
    TILE1.COUNTER_1.match1_tap_sel  = 31;
    TILE1.COUNTER_1.event_load_val  = "1";
    TILE1.COUNTER_1.serializer_en   = true;
    TILE1.COUNTER_1.mode1           = "1";
    TILE1.COUNTER_1.mode0           = "FSM_1.OUT";
    TILE1.COUNTER_1.reset           = "BOUNDARY.in3";
    TILE1.COUNTER_1.event           = "BOUNDARY.in1";
    TILE1.COUNTER_2.$name           = "COUNTER_2";
    TILE1.COUNTER_2.event           = "BOUNDARY.in2";
    TILE1.COUNTER_2.action          = "Load";
    TILE1.COUNTER_2.match1_val      = "42";
    TILE1.COUNTER_2.match2_val      = "42";
    TILE1.COUNTER_2.event_load_val  = "42";
    TILE1.COUNTER_2.reset           = "LUT_0.OUT";
    TILE1.OUTLUT_0.$name            = "OUTLUT_0";
    TILE1.OUTLUT_0.eqn              = "0";
    TILE1.OUTLUT_1.$name            = "OUTLUT_1";
    TILE1.OUTLUT_1.eqn              = "1";
    TILE1.OUTLUT_2.$name            = "OUTLUT_2";
    TILE1.OUTLUT_2.eqn              = "1";
    TILE1.OUTLUT_3.$name            = "OUTLUT_3";
    TILE1.OUTLUT_3.eqn              = "i0";
    TILE1.OUTLUT_3.i0               = "BOUNDARY.in2";
    TILE1.OUTLUT_4.$name            = "OUTLUT_4";
    TILE1.OUTLUT_4.i0               = "LUT_1.OUT";
    TILE1.OUTLUT_4.eqn              = "i0";
    TILE1.OUTLUT_5.$name            = "OUTLUT_5";
    TILE1.OUTLUT_5.eqn              = "i0";
    TILE1.OUTLUT_5.i0               = "FSM_1.OUT";
    TILE1.OUTLUT_6.$name            = "OUTLUT_6";
    TILE1.OUTLUT_6.eqn              = "1";
    TILE1.OUTLUT_7.$name            = "OUTLUT_7";
    TILE1.OUTLUT_7.i0               = "FSM_2.OUT";
    TILE1.OUTLUT_7.i1               = "LUT_1.OUT";
    TILE1.OUTLUT_7.eqn              = "i0 & (~i1)";
    TILE1.HLC.$name                 = "HLC_0";
    TILE1.HLC.e3                    = "COUNTER_0.count_match2";
    TILE1.HLC.e1                    = "COUNTER_0.count_match1";
    TILE1.HLC.R3_init               = "0x51";
    TILE1.HLC.program0.$name        = "HLCP_0";
    TILE1.HLC.program1.$name        = "HLCP_1";
    TILE1.HLC.program1.instruct0    = "MOV C1, R0";
    TILE1.HLC.program2.$name        = "HLCP_2";
    TILE1.HLC.program3.$name        = "HLCP_3";
    TILE1.HLC.program3.instruct2    = "PUSH R0";
    TILE1.HLC.program3.instruct0    = "MOV C0, R3";
    TILE1.HLC.program3.instruct1    = "MOV C1, R1";
    TILE1.HLC.program3.instruct3    = "PUSH R1";
    TILE1.HLC.program3.instruct4    = "PUSH R2";
    TILE1.HLC.program3.instruct5    = "PUSH R3";
    TILE1.AOC_0.$name               = "AOC_0";
    TILE1.AOC_1.$name               = "AOC_1";
    TILE1.AOC_2.$name               = "AOC_2";
    TILE1.AOC_3.$name               = "AOC_3";
    TILE1.AOC_4.$name               = "AOC_4";
    TILE1.AOC_5.$name               = "AOC_5";
    TILE1.AOC_6.$name               = "AOC_6";
    TILE1.AOC_7.$name               = "AOC_7";
    
    clb2.tile                  = TILE2;
    TILE2.$name                = "UnusedTile";
    TILE2.BOUNDARY.$name       = "BOUNDARY1";
    TILE2.LUT_0.$name          = "LUT_3";
    TILE2.LUT_1.$name          = "LUT_4";
    TILE2.LUT_2.$name          = "LUT_5";
    TILE2.FSM_0.$name          = "FSM_3";
    TILE2.FSM_1.$name          = "FSM_4";
    TILE2.FSM_2.$name          = "FSM_5";
    TILE2.COUNTER_0.$name      = "COUNTER_3";
    TILE2.COUNTER_1.$name      = "COUNTER_4";
    TILE2.COUNTER_1.match1_val = "22";
    TILE2.COUNTER_1.match2_val = "055";
    TILE2.COUNTER_2.$name      = "COUNTER_5";
    TILE2.OUTLUT_0.$name       = "OUTLUT_8";
    TILE2.OUTLUT_1.$name       = "OUTLUT_9";
    TILE2.OUTLUT_2.$name       = "OUTLUT_10";
    TILE2.OUTLUT_3.$name       = "OUTLUT_11";
    TILE2.OUTLUT_4.$name       = "OUTLUT_12";
    TILE2.OUTLUT_5.$name       = "OUTLUT_13";
    TILE2.OUTLUT_6.$name       = "OUTLUT_14";
    TILE2.OUTLUT_7.$name       = "OUTLUT_15";
    TILE2.HLC.$name            = "HLC_1";
    TILE2.HLC.program0.$name   = "HLCP_4";
    TILE2.HLC.program1.$name   = "HLCP_5";
    TILE2.HLC.program2.$name   = "HLCP_6";
    TILE2.HLC.program3.$name   = "HLCP_7";
    TILE2.AOC_0.$name          = "AOC_8";
    TILE2.AOC_1.$name          = "AOC_9";
    TILE2.AOC_2.$name          = "AOC_10";
    TILE2.AOC_3.$name          = "AOC_11";
    TILE2.AOC_4.$name          = "AOC_12";
    TILE2.AOC_5.$name          = "AOC_13";
    TILE2.AOC_6.$name          = "AOC_14";
    TILE2.AOC_7.$name          = "AOC_15";
    

  • Hi Michael,

    Are you resetting the flags while using the QPEN bit to disable and enable the QEP peripheral? There are various flags that do not get reset whenever you use the QPEN bit, so be sure to reset those flags manually before enabling the peripheral.

    Regards,

    Peter

  • No, we've always enabled it first, and also the only bit we've been trying to clear is the FIMF, using this call:

                    EQEP_clearStatus(motor_QEP_BASE, EQEP_STS_1ST_IDX_FLAG);

    Are there other ways to clear other flags?  It's not completely clear from the Tech Ref manual or the EQEP functions listed in 'eqep.h'

  • Hi Michael,

    Let me clarify what I mean. I believe you should be able to reset the eQEP peripheral by toggling the QPEN bit. In DriverLib, this is done by disabling the module with 

    EQEP_disableModule(motor_QEP_BASE)

    Before re-enabling the eQEP, you can use the

    EQEP_clearStatus(motor_QEP_BASE, EQEP_STS_1ST_IDX_FLAG)

    function to clear this first index flag that you got from the motor jumping. Then you can re-enable the eQEP module by using 

    EQEP_enableModule(motor_QEP_BASE)

    I believe this is the correct order and that once this is done, your eQEP should get be ready for the first index signal following resetting the eQEP

    Regards,

    Peter

  • Hi, and thanks for the detailed response.  However, just tried doing exactly that and it is still having the problem.

    Thanks,

    -Mike

  • Hi Michael,

    Thanks for the info, I have not been able to test this yet but I will try to and get back to you with a solution on how to re-arm for the first index flag. 

    Regards,

    Peter

  • Thanks so much, really appreciate it!

  • Hi Michael,

    In the TRM, it states that the FIMF and FIDF flags are not applicable when you have the position counter in "Reset on First Index" mode. Neither are these flags are available in the "Reset on Maximum Position" mode either.

    I think this is why you are not seeing the flag getting triggered even though you are resetting the eQEP peripheral. You will need to run the position counter in "Reset on Index" mode or "Reset on UTO" mode

    Regards,

    Peter