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.

TM4C123x prescaler values not accepted

Hi Support,

working with TM4C123x parts, it seems to me that prescaler values greater than 255 are not accepted, despite the comment.
In this case the functionality of 32/64 bit timer may be limited.
Can you kindly provide me a feedback on this?

//! \param ui32Base is the base address of the timer module.
//! \param ui32Timer specifies the timer(s) to adjust; must be one of
//! \b TIMER_A, \b TIMER_B, or \b TIMER_BOTH.
//! \param ui32Value is the timer prescale value which must be between 0 and
//! 255 (inclusive) for 16/32-bit timers and between 0 and 65535 (inclusive)
//! for 32/64-bit timers.
//!
//! This function configures the value of the input clock prescaler.  The
//! prescaler is only operational when in half-width mode and is used to extend
//! the range of the half-width timer modes.  The prescaler provides the least
//! significant bits when counting down in periodic and one-shot modes; in all
//! other modes, the prescaler provides the most significant bits.
//!
//! \note The availability of the prescaler varies with the Tiva part and
//! timer mode in use.  Please consult the datasheet for the part you are using
//! to determine whether this support is available.
//!
//! \return None.
//
//*****************************************************************************
void
TimerPrescaleSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
{
    //
    // Check the arguments.
    //
    ASSERT(_TimerBaseValid(ui32Base));
    ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
           (ui32Timer == TIMER_BOTH));
    ASSERT(ui32Value < 256);

Thanks and regards,

Alberto

  • Hello Alberto,

    I would agree with your assessment and believe this is a short coming of the driver. From my view, there should be either some check to see if it is a 16 or 64 bit time and range check the input value based on that or there should be a separate API for the 64bit timers as there seems to be with some of the other APIs already. I have assigned the thread to the TivaWare owner for their review as well in case I am missing something.