Post Go back to editing

ADIN1110: TS_TIMER quantization error correction documentation is unclear

Category: Datasheet/Specs
Product Number: ADIN1110

Good day,

The datasheet lacks clarity when it comes to the quantization error correction of TS_TIMER. The (now removed) driver that was initially available also incorrectly implemented the quantization error correction.

From page 30 of rev. C of the datasheet (see also page 63):

"Because it is frequent that the required period of TS_TIMER cannot
be programmed as a multiple of 16, the quantization error correc-
tion register can be programmed with a value between 0 and 15 to
compensate for the TS_TIMER quantization error."

One would assume (as the driver did) that the total period of the TS_TIMER would be:

TS_TIMER_period = TS_TIMER_HI + TS_TIMER_LO + quantization error correction value

However, after testing and lots of head-scratching, it turns out it is as follows:

TS_TIMER_period = TS_TIMER_HI + TS_TIMER_LO - (16 - quantization error correction value)

In other words, the value of (TS_TIMER_HI + TS_TIMER_LO) should be greater than the desired period (by 16) so that the subraction of the quantization error correction value will lead to the desired period.

Clarity around this in the datasheet would save some head-scratching for anyone else trying to make use of the TS_TIMER.

  • Hi  

    Thank you for your feedback. 

    It seems there's an issue with the driver link on the webpage, we'll get that fixed.

    Regarding the TS_TIMER observations, what you're saying appears to be correct. Let me confirm this with the team and get back to you. I'll also pass along your feedback about the DS and the driver to the team for future updates.

    Regards,

    Shazia

  • Hi  , thank you for the feedback. 

    I would like to know what the team says - I'm not 100% sure that my suggested formula is correct. I get the correct output for my particular use case, however.

    As for the the driver, there were 2 other bugs in the driver within the "MAC_TsTimerStart()" function (in addition to the quantization error correction value being calculated incorrectly). Here they are:

    1. The conditional at the start of the function should be

        if (pTimerConfig->startTimeNs < ADI_MAC_TS_MIN_NS)
        {
            pTimerConfig->startTimeNs = ADI_MAC_TS_MIN_NS;
        }

    2. 
    Changes to the order of applying the mask and multiplying with a float so that we are guaranteed to have someting that's divisible by 16
    Previous:
        timeHi = (uint32_t)((pTimerConfig->periodNs & ~ADI_MAC_TS_QE_MASK) * pTimerConfig->dutyCycle);
    Suggestion:
        timeHi = ((uint32_t)(pTimerConfig->periodNs * pTimerConfig->dutyCycle)) & ~ADI_MAC_TS_QE_MASK;