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.

TMS570LS1227: When does the eQEP position count overflow occurs?

Part Number: TMS570LS1227

Dear all,

In our application the position counter is configured to operate in Position Counter Reset on Index Event mode.

As per SPNU515C sec. 21.4.1 Position Counter Operating Modes, overflow occurs when the position counter counts up after QPOSMAX value.

Based in test results, we observe that overflow occurs when the position counter counts up at QPOSMAX value.

Is there any possibility a mistake in the configuration may result in the observed behaviour? We assume SPNU515C is the true reference.

Thanks in advance for your time.

With my best regards,

Luis

  • Hi Luis,

    Is there any possibility a mistake in the configuration may result in the observed behaviour? We assume SPNU515C is the true reference.

    No, there should not be any mistake in the configuration and occurring an overflow when the position counter counts up at QPOSMAX value is an expected behavior.

    Yes, SPNU515C is true.

    --

    Thanks & regards,
    Jagadish.

  • Dear Jagadish,

    Thanks for the swift response.

    Following up on your answer, if the SPNU515C is true than your answer does not match the SPNU515C and matches my claim.

    I mean exactly that the SPNU515C in sec. 21.4.1 says "[...] overflow occurs when the position counter counts up AFTER QPOSMAX value." and I (and you also in your answer) say that "[...]overflow when the position counter counts up AT QPOSMAX value"

    We observe overflow AT QPOSMAX value and in the SPNU515C is written after AFTER QPOSMAX value.

    Could you please clarify your answer?

    Thanks for your time and support.

    Best regards,

    Luis

  • Hi Luis,

    Is it possible for you to share your code, so that i can quickly debug the problem.

    --

    Thanks & regards,
    Jagadish.

  • Dear Jagadish,

    Sure! However, I can't provide it  today. I will share it most likely by tomorrow.

    Thanks for the time and support.

    Best regards,

    Luis

  • I will share it most likely by tomorrow.

    Thanks Luis.

  • Hello Jagadish,

    Sorry for the delay. Below you can find the initialization we are using,

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    static void fn_qep_reg_init_qepctl(qep_reg_t* p_qep_reg) {
    /**
    * Setup eQEP Control Register QEPCTL (SPNU515C, p. 920, p. 921).
    *
    * PCRM: Select Position counter Reset Mode:
    *
    * 0h = Position counter reset on any index event,
    * 1h = Position counter reset on the maximum position,
    * 2h = Position counter reset on the first index event.
    */
    BITMOD_CLR_BITS_16(0x3u, 12u, p_qep_reg->u16_qepctl);
    /* SEI: Enable & Select Strobe event initialization of position counter.
    *
    * 0h = Do nothing (action is disabled).
    */
    BITMOD_CLR_BITS_16(0x3u, 10u, p_qep_reg->u16_qepctl);
    /* IEI: Enable & Select Index event initialization of position counter.
    *
    * 0h = Do nothing (action is disabled),
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks for your time and support.

    Best regards,

    Luis

  • Hi Luis,

    I want to give some more clarification on what TRM says here.

    Actually, here counter value won't reach to the QPOSMAX+1, it will reach to only QPOSMAX and on the next pulse the over flag will get set and counter will get reset.

    I hope this will clarifies your doubt regarding counter after reset in the TRM means.

    --

    Thanks & regards,
    Jagadish.

  • Hello Jagadish,

    Thanks for the reply and sorry for my delay.

    As I mentioned in the original post, we understand what is in the documentation but during testing we observed different behaviour.

    We will re-check and post any further question later.

    Just to finalize, did you find any issues ad or points of improvement in the initialization code provided?

    Thanks and regards,

    Luis

  • Hi Luis,

    Just to finalize, did you find any issues ad or points of improvement in the initialization code provided?

    I don't find any issues in your initialization code.

    We will re-check and post any further question later.

    All right, we will wait for your feedback.

    --

    Thanks & regards,
    Jagadish.