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.

RTOS/TM4C1294NCPDT: GPIO_CFG_OUT_OD_PU

Part Number: TM4C1294NCPDT

Tool/software: TI-RTOS

Hi Folks,

is it possible that the GPIO configuration entry in the array GPIO_PinConfig gpioPinConfigs[]  containing:

GPIOTiva_PD_1 | GPIO_CFG_OUT_OD_PU | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH,

isn't setting the pullup resistor? Didn't found a hint somewhere about a bug.
Fact is, the RTOS driver gpio_init() is not working in my application. When I change the GPIO_PUR register and enable the pullup, it starts working and the port gets high.

I hope some guru out there can check that out and tell me about.

best regards Klaus-Michael

  • Hi,

    What version of TIRTOS are you using?

    Judah
  • Dear Judah,

    thanks for the reply. I'm using 2.16.0.08. It isn't an urgent issue. Alas, I wasn't able to debug the RTOS driver itself. The sourcecode i have, is quite different than the things the firmware really does

    For now, my work around looks like:

    GPIO_PinConfig gpioPinConfigs[] = {
        GPIOTiva_PD_1 | GPIO_CFG_OUT_OD_PU | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH
    };
    /*
     *  ======== BASISK3A_initGPIO ========
     */
    void BASISK3A_initGPIO(void)
    {
        /* Initialize peripheral and pins */
        GPIO_init();
        HWREG(GPIO_PORTD_BASE + GPIO_O_PUR) = 2;   // work around for pullup not set
    }

    regards to everybody - klaus-michael

  • Hi Claus,

    There was a little mix-up. Judah is out for a couple days. He'll respond on Monday.

    Todd
  • Klaus,

    In which file are you seeing the following from the TIRTOS release?

    GPIO_PinConfig gpioPinConfigs[] = {
    GPIOTiva_PD_1 | GPIO_CFG_OUT_OD_PU | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH
    };

    I'm not seeing that in my installation.

    Judah
  • Good Morning Judah,
    I suppose, it is morning wherever You'll read this...

    To be earnest, I don't understand Your question. This GPIO_PinConfig structure is common to all example code distributed with the RTOS. It is for example in the EK_TM4C1294XL.c file for the evaluation board I have. The GPIO_CFG_OUT_OD_PU itself can be found in GPIO.h in ti/tirtos_tivac_2_16_00_08/products/tidrivers_tivac_2_16_00_08/packages/ti/drivers

    The code snippet itself is out of a piece of firmware for my custom board. If the Pin PD1 is not usable in the board You have at your desktop - well just take another one. What I would be interested in, is why, the pull-up is not enabled. I don't want to blame anybody of making a mistake. I only want to avoid, that another one relies on the pull-up resistor as I did. This small detail has caused a lot of smoke filling my lab.

    Best regards and thanks for the answer   Klaus-Michael

  • Klaus,

    I misread your comment.  I thought you were implying that the TIRTOS itself had the following code set:

    GPIO_PinConfig gpioPinConfigs[] = {
    GPIOTiva_PD_1 | GPIO_CFG_OUT_OD_PU | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH
    };

    I looked deeper into the issue and I figured out that its a known limitation that the driver does not support
    GPIO_CFG_OUT_OD_PU and GPIO_CFG_OUT_OD_PD on the tiva devices.

    If you look at GPIOTiva.c it has the following comments:

    /* Table of GPIO output types */
    static const uint8_t gpioCfgOutputTypes [] = {
    GPIO_PIN_TYPE_STD, /* GPIO_CFG_OUT_STD */
    GPIO_PIN_TYPE_OD, /* GPIO_CFG_OUT_OD_NOPULL */
    GPIO_PIN_TYPE_OD, /* GPIO_CFG_OUT_OD_PU not supported by TivaWare */
    GPIO_PIN_TYPE_OD /* GPIO_CFG_OUT_OD_PD not supported by TivaWare */
    };

    Judah

  • Hello Claus,

    Judah's explanation linking the issue back to TivaWare is accurate. Please review Table 10-4 of your device datasheet that indicates for Open Drain that the PUR and PDR bits are don't care's. The device is not supposed to support the ability to be set with an Open Drain and was not designed to have either Pullup or Pulldown functionality. You need to use external pullups/pulldowns if you need that functionality when using the Open Drain setting for TM4C devices.

    Also from the DS: "Program each pad in the port to have either pull-up, pull-down, or open drain" - note the 'or', indicating there isn't a combination of pullup or pulldown to work with the open drain setting.

    So with that in mind, even though it seems you are somewhat successful getting the pull-up functioning, the device is not intended to actually have the pull-up function. Therefore you may experience undefined behavior as a result. I did searching on E2E on the topic and the consensus feedback we have been delivering for years is to use an external pullup with open drain setting.
  • Thanks to all, this is another secret of the chip. The pullup seems to work, even it isn't supported, when set directly in the register.  Best regards Klaus-Michael