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.

TM4C129ENCPDT: WHAT ARE AVAILABLE BROWN OUT SETTINGS UNDER TIRTOS

Part Number: TM4C129ENCPDT

Tool/software:

The sysctl.h file in the TIRTOS folder for the TM4C129ENCPDT has the function "SysCtlBrownOutConfigSet" declared but there is no prototype for this function, datasheet seems to indicate this functionality is not possible.

Is SysCtlBrownOutConfigSet even relevant to the TM4C129ENCPDT?

If so, where can I find the function definition and an example of how to use.

If not, is there an example of how I can change the Brown Out so it gives me an interrupt rather than resetting the processor, preferably an example under TI-RTOS with typical interrupt function so I can see how it handles the BOR.

My project is built using tirtos_tivac_2_16_01_14 and I would like to look at options to stop the Brown Out triggering so easily and resetting my PCB for a very momentary drop of supply to 2.9V.

  • Hi Barry,

      I did some investigation. There is no longer the SysCtlBrownOutConfigSet API. It is a  mistake that it is remaining in the sysctl.h header file. SysCtlBrownOutConfigSet was a API to configure Brownout circuit for an earlier generation of MCU (LM3S). 

      The only register that is pertinent to Brown-out for TM4C MCU is the PTBOCTL register where the only thing you can change is the type of event action (e.g. NMI, Reset or Interrupt) when a brownout is detected. The threshold voltage beyond which brownout is detected is documented in the Electrical Specification in the datasheet. The threshold voltage is not programmable. 

  • Thanks

    That confirms what I thought was the case.

    Can you direct me to any examples of how I enable the BOR interrupt and handle it under TIRTOS?

    This is what I am thinking is required

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    // ----------------------------------------------------------------------------------------
    // TM4C129ENCPDT has BOR (Brown Out Reset) and POR (Power On Reset)
    // BOR triggers at 2.86V (2.77 - 2.95), POR triggers at 2.20V (1.84 - 2.56),
    // It is possible to have BOR just generate an interrupt and not a reset.
    // By default BOR will generate a Reset of the CPU.
    // It is not possible to change POR operation, it will always reset the CPU.
    // SysCtlBrownOutConfigSet does not exist for TM4C129ENCPTD -
    // It is for older family of processors.
    //
    // Enable Interrupt for brown out
    SysCtlVoltageEventConfig(SYSCTL_VEVENT_VDDABO_NONE | SYSCTL_VEVENT_VDDBO_INT);
    SysCtlIntRegister(sysCtlInterruptFn);
    // ----------------------------------------------------------------------------------------
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I have created this function, just working out how to determine source of the interrupt

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    /////////////////////////////////////////////////////////////////////////////
    /// System Control Interrupt handler.
    /// \brief handler for system interrupt.
    /// \return None.
    void sysCtlInterruptFn(void)
    {
    //
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Can you direct me to any examples of how I enable the BOR interrupt and handle it under TIRTOS?

    Hi,

      There is no example per se for BOR event. You would need to create a Hwi and let TI-RTOS handle the interrupt instead of using SysCtlIntRegister. When you use SysCtlIntRegister(sysCtlInterruptFn), this will destroy the interrupt table that is managed by TI-TRTOS. Refer to this post https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/849627/faq-can-i-update-the-vector-table-with-intregister-when-using-ti-rtos?tisearch=e2e-sitesearch&keymatch=ti-rtos%20vector%20table#

      If you look at the interrupt vector table, System Control is mapped to Vector number 44. 

    You can use the below example to create a Hwi for vector 44. 

    Hwi_Params hwiParams;
    Hwi_Handle myHwi;
    Error_Block eb;
    /* Initialize error block and hwiParams to default values */
    Error_init(&eb);
    Hwi_Params_init(&hwiParams);
    hwiParams.enableInt = FALSE;
    myHwi = Hwi_create(44, (Hwi_FuncPtr)sysCtlInterruptFn, &hwiParams, &eb);
    if (myHwi == NULL) {
    System_abort("Hwi create failed");
    }
    Hwi_enableInterrupt(44);

    snipped....

    void sysCtlInterruptFn(void)
    {
    uint32_t ui32VoltageEvents;
    //
    // Read the current voltage event status.
    //
    ui32VoltageEvents = SysCtlVoltageEventStatus();
    //
    // Clear all the current voltage events.
    //
    SysCtlVoltageEventClear(ui32VoltageEvents);

    //

    // Add your user code on how to handle BOR event

    }

  • Thanks for clarifying.