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.

TMS320F28P559SJ-Q1: cannot pull up the gpio normally when set GPIO GPxODR = 1 + input mode +pull up

Part Number: TMS320F28P559SJ-Q1


Tool/software:

Hi Expert

Customer doing I2C simulation through GPIO, in I2C transmission mode(GPIO set as output), customer set the GPxODR  = 1, enable the pullup, the I2C voltage level can be properly toggled.

But in I2C receive mode (GPIO set as input), if customer still set GPxODR  = 1,enable the pullup, the GPIO will pull the I2C bus to the logic low, the I2C cannot transmitted properly, once customer set GPxODR  = 0, enable pullup, the I2C bus can recover.

Is there anything wrong when configure the GPxODR  = 1 when GPIO configured as input?

Thanks

Joe

  • Hello, Joe.

    Firstly, I want to clarify: when you say "GPxODR = 1, enable pullup", you are saying that GPxODR = 1 to enable Open-Drain Output and GPxPUD = 0 to enable to pull up resistor?

    When doing this, please make sure that the customer is following the order of operations listed in TRM Section 10.11:

    "To configure GPIO as open-drain pin, user needs to write 0 to GPxDAT register for the pin followed by a write of 0 to the GPxDIR register. When user writes 0 to GPxDIR register, it will leave pin floating , and when user writes 1 to GPxDIR register, the pin will be driven LOW."

    Best,

    Ryan

  • Hi Ryan

    Firstly, I want to clarify: when you say "GPxODR = 1, enable pullup", you are saying that GPxODR = 1 to enable Open-Drain Output and GPxPUD = 0 to enable to pull up resistor?

    Yes

    There are 2 questions below:

    What's the time order between GPxODR register and other GPIO control register, if I want to configure Pin as OD and Input? TRM section 10.11 only describes the time order of GPxDAT register and GPxDIR register, but does not show the relationship between GPxODR register and other GPIO control register.

    Could you please share the reasons of this configuration time slot? And Why ODR = 1 and GPIO set as output will result in GPIO pulled low?

    Thanks

    Joe

  • Joe,

    What's the time order between GPxODR register and other GPIO control register, if I want to configure Pin as OD and Input? TRM section 10.11 only describes the time order of GPxDAT register and GPxDIR register, but does not show the relationship between GPxODR register and other GPIO control register.

    GPxODR should be enabled following the GPxDAT = 0 and GPxDIR = 0. I am suggesting this to ensure that you are not accidentally placing the GPIO into some form of an incorrect state.

    For the exact reasoning behind this order to set the registers, I do not exactly know. I am talking with one of our GPIO experts to be able to elaborate more, as well as to answer your question on why the input is being set low by the open-drain mode. Thank you for your patience.

    Best,

    Ryan

  • Hi Joe. Following up to fully answer your question.

    And Why ODR = 1 and GPIO set as output will result in GPIO pulled low?

    Effectively, setting GPxODR = 1 and switching to an input mode with the internal pull-up resistor contradicts itself. Open-drain mode will sink current to ground when outputting, but cannot force a "high" value. Because of this circuitry, when input mode is selected, the open-drain can still sink current regardless of the pull-up resistor, which is why you see your input line being forced to ground while GPxODR = 1.

    Please mark this as resolved if the answer satisfies your question.

    Best,

    Ryan