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.

TMS320F28P659DH-Q1: GPIO internal pullup resistors enable

Part Number: TMS320F28P659DH-Q1

Tool/software:

Hi Champ,

Reading from this post, it is answered by all GPIOs have internal pullup enabled by default at reset except AIOs and and EPWM-capable pins.

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1453315/tms320f28022-q1-is-gpio-pin-must-to-enable-pullup/5575499#5575499

Then, reading the F28P65x TRM GPIO configuration overview, it is written all pullups are disabled by default.

(1). Do we have a GPIO structure change from time to time ?

(2). In our example (i.e. epwm / GPIO / ecap), even if the GPIO direction is set as output, we would always enable the pullup with  GPIO_setPadConfig(GPIOx, GPIO_PIN_TYPE_PULLUP); every times in the beginning ? What is the purpose for ? 

(3). Any effect to do with GPIO as output w/ and w/o internal pullup enable ?

(4). If the GPIO is set as below,

GPIO_setPadConfig(0, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO0
GPIO_writePin(0, 0);                        // Load output initial
GPIO_setPinConfig(GPIO_0_GPIO0);            // GPIO0 = GPIO0
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);// GPIO0 = output

Then, I/O pin is either configure to EPWM or GPIO output, and there is an "external" pulldown resistor (~4.7k-10 Ohm) connected to pin, in such scenario, considering IO internal weak pullup here, what would the pin behave like GPIO with pullup or pulldown or should be push-pull mode ?

Thanks and regards,

Johnny

  • Hi Champ,

    Any chance to have some input ?

    Add a new question #4 in the thread.

    Thanks for the input.

    Johnny

  • Hello,

    (1). Do we have a GPIO structure change from time to time ?

    Yes, the default behavior of GPIO can differ a bit between device families. For the F28P65x, pull-ups are turned off when the device resets. This helps reduce power consumption and ensures a more controlled startup.

    (2). In our example (i.e. epwm / GPIO / ecap), even if the GPIO direction is set as output, we would always enable the pullup with  GPIO_setPadConfig(GPIOx, GPIO_PIN_TYPE_PULLUP); every times in the beginning ? What is the purpose for ? 

    It's a good practice to set up the pad configurations, including pull-ups and pull-downs, early on to prevent any floating states during the setup phase (before the direction is fully established).

    (3) Any effect to do with GPIO as output w/ and w/o internal pullup enable ?

    You have two choices for GPIO: push-pull or open-drain. If you go with the push-pull option, the pin can actively drive the signal both high and low, effectively "pushing" it to the power supply voltage (high) or "pulling" it down to ground (low). So, you won't need it much.

    On the other hand, if you opt for the open-drain configuration, the output can only pull the signal low (to ground). When it's not actively driven, the pin remains floating (high impedance), which means you'll need a pull-up resistor to establish a logical high state.

    (4) Then, I/O pin is either configure to EPWM or GPIO output, and there is an "external" pulldown resistor (~4.7k-10 Ohm) connected to pin, in such scenario, considering IO internal weak pullup here, what would the pin behave like GPIO with pullup or pulldown or should be push-pull mode ?

    In your case, you're using an internal pull-up and an external pull-down. The external pull-down will take precedence over the internal pull-up unless the GPIO is driving high.

    Best Regards,

    Masoud