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.

AM2634: How to test the EQEP in the customized board

Part Number: AM2634
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi team,

i am using eqep_position_speed example

sdk version - 09_02_00_55


I am working on customized hardware, in that EQEP Module so for this we configured the pin mux 

EQEP2_A  - B13
EQEP2_B  - A13

EQEP0_A - U18
EQEP0_B - T18







1. our code is struck in the driver_config() function and we tried to debug it will going to assembly code and strucking but this case is not happen in eval board in custom board we are facing issue


2. Here i removed epwm because via simulator we are giving the pulse and can u give the test code to test both the eqep.


can u replay asap we required immediately

thank you, 

  • Apologies for the delay in response,

    If there is an issue in the custom board but not the eval board, and the issue is appearing in the driver_config() function, I would look at the driver_config() function, specifically. Looking at the listed example in the SDK, I don't see a driver_config() function. What are you referring to?

    Regards,
    Jason Osbron

  • hi Jason,

    Actually the issue we are getting in the Drivers_eqepOpen() function so inside this function

    1. when we tested the EQEP0_A - U18, EQEP0_B - T18 this configuration we are got the output successfully.... but when tested the EQEP2_A  - B13
    EQEP2_B  - A13 those pin code struct in  /* CONFIG_EQEP2 initialization */ part and it will goes to HwiP_data_abort_handler_c and it struct.

    2. How to configure those pins EQEP2_A  - B13, EQEP2_B  - A13 in sysconfig and is there any other thing is dependences is there to do?

     

    Below is my Drivers_eqepOpen() driver open code:

    static void Drivers_eqepOpen(void)
    {
    /* CONFIG_EQEP0 initialization */
    /* Set the strobe input source of the eQEP module */
    EQEP_setStrobeSource(SPEED_SENSOR_1_BASE_ADDR,EQEP_STROBE_FROM_GPIO);
    /* Sets the polarity of the eQEP module's input signals */
    EQEP_setInputPolarity(SPEED_SENSOR_1_BASE_ADDR,false,false,false,false);
    /* Configures eQEP module's quadrature decoder unit */
    EQEP_setDecoderConfig(SPEED_SENSOR_1_BASE_ADDR, (EQEP_CONFIG_QUADRATURE | EQEP_CONFIG_2X_RESOLUTION | EQEP_CONFIG_NO_SWAP));
    /* Set the emulation mode of the eQEP module */
    EQEP_setEmulationMode(SPEED_SENSOR_1_BASE_ADDR,EQEP_EMULATIONMODE_STOPIMMEDIATELY);
    /* Configures eQEP module position counter unit */
    EQEP_setPositionCounterConfig(SPEED_SENSOR_1_BASE_ADDR,EQEP_POSITION_RESET_IDX,0);
    /* Sets the current encoder position */
    EQEP_setPosition(SPEED_SENSOR_1_BASE_ADDR,0);
    /* Disables the eQEP module unit timer */
    EQEP_disableUnitTimer(SPEED_SENSOR_1_BASE_ADDR);
    /* Disables the eQEP module watchdog timer */
    EQEP_disableWatchdog(SPEED_SENSOR_1_BASE_ADDR);
    /* Configures the quadrature modes in which the position count can be latched */
    EQEP_setLatchMode(SPEED_SENSOR_1_BASE_ADDR,(EQEP_LATCH_CNT_READ_BY_CPU|EQEP_LATCH_RISING_STROBE|EQEP_LATCH_RISING_INDEX));
    /* Set the quadrature mode adapter (QMA) module mode */
    EQEP_setQMAModuleMode(SPEED_SENSOR_1_BASE_ADDR,EQEP_QMA_MODE_BYPASS);
    /* Disable Direction Change During Index */
    EQEP_disableDirectionChangeDuringIndex(SPEED_SENSOR_1_BASE_ADDR);
    /* Configures the mode in which the position counter is initialized */
    EQEP_setPositionInitMode(SPEED_SENSOR_1_BASE_ADDR,(EQEP_INIT_DO_NOTHING));
    /* Sets the software initialization of the encoder position counter */
    EQEP_setSWPositionInit(SPEED_SENSOR_1_BASE_ADDR,false);
    /* Sets the init value for the encoder position counter */
    EQEP_setInitialPosition(SPEED_SENSOR_1_BASE_ADDR,0);
    /* Disables the eQEP module */
    EQEP_disableModule(SPEED_SENSOR_1_BASE_ADDR);

    EQEP_SourceSelect sourceSelect;
    sourceSelect.sourceA = EQEP_SOURCE_ZERO;
    sourceSelect.sourceB = EQEP_SOURCE_ZERO;
    sourceSelect.sourceIndex = EQEP_SOURCE_ZERO;
    EQEP_selectSource(SPEED_SENSOR_1_BASE_ADDR, sourceSelect);

    /* CONFIG_EQEP2 initialization */
    /* Set the strobe input source of the eQEP module */
    EQEP_setStrobeSource(SPEED_SENSOR_2_BASE_ADDR,EQEP_STROBE_FROM_GPIO);
    /* Sets the polarity of the eQEP module's input signals */
    EQEP_setInputPolarity(SPEED_SENSOR_2_BASE_ADDR,false,false,false,false);
    /* Configures eQEP module's quadrature decoder unit */
    EQEP_setDecoderConfig(SPEED_SENSOR_2_BASE_ADDR, (EQEP_CONFIG_QUADRATURE | EQEP_CONFIG_2X_RESOLUTION | EQEP_CONFIG_NO_SWAP));
    /* Set the emulation mode of the eQEP module */
    EQEP_setEmulationMode(SPEED_SENSOR_2_BASE_ADDR,EQEP_EMULATIONMODE_STOPIMMEDIATELY);
    /* Configures eQEP module position counter unit */
    EQEP_setPositionCounterConfig(SPEED_SENSOR_2_BASE_ADDR,EQEP_POSITION_RESET_IDX,0);
    /* Sets the current encoder position */
    EQEP_setPosition(SPEED_SENSOR_2_BASE_ADDR,0);
    /* Disables the eQEP module unit timer */
    EQEP_disableUnitTimer(SPEED_SENSOR_2_BASE_ADDR);
    /* Disables the eQEP module watchdog timer */
    EQEP_disableWatchdog(SPEED_SENSOR_2_BASE_ADDR);
    /* Configures the quadrature modes in which the position count can be latched */
    EQEP_setLatchMode(SPEED_SENSOR_2_BASE_ADDR,(EQEP_LATCH_CNT_READ_BY_CPU|EQEP_LATCH_RISING_STROBE|EQEP_LATCH_RISING_INDEX));
    /* Set the quadrature mode adapter (QMA) module mode */
    EQEP_setQMAModuleMode(SPEED_SENSOR_2_BASE_ADDR,EQEP_QMA_MODE_BYPASS);
    /* Disable Direction Change During Index */
    EQEP_disableDirectionChangeDuringIndex(SPEED_SENSOR_2_BASE_ADDR);
    /* Configures the mode in which the position counter is initialized */
    EQEP_setPositionInitMode(SPEED_SENSOR_2_BASE_ADDR,(EQEP_INIT_DO_NOTHING));
    /* Sets the software initialization of the encoder position counter */
    EQEP_setSWPositionInit(SPEED_SENSOR_2_BASE_ADDR,false);
    /* Sets the init value for the encoder position counter */
    EQEP_setInitialPosition(SPEED_SENSOR_2_BASE_ADDR,0);
    /* Disables the eQEP module */
    EQEP_disableModule(SPEED_SENSOR_2_BASE_ADDR);

    sourceSelect.sourceA = EQEP_SOURCE_DEVICE_PIN;
    sourceSelect.sourceB = EQEP_SOURCE_DEVICE_PIN;
    sourceSelect.sourceIndex = EQEP_SOURCE_DEVICE_PIN;
    EQEP_selectSource(SPEED_SENSOR_2_BASE_ADDR, sourceSelect);

    }

    Because the same thing if we configure in eval board we not got any issues but in customized board we are getting issue in eqep2 configuration in Drivers_eqepOpen();

    kindly replay asap....

  • hi Jason, 

    can you please replay for this ASAP...

  • Hi,

    I'm looking into this now.

    While I look into it, although I don't think it's likely that this is the issue, I should confirm- all required Additional SDK Tools from this page were downloaded, correct?

    Regards,
    Jason Osborn