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.

AM335X: Open-drain pin question



Hello,

We try to configure GPIO pin as the open drain mode. But based on AM335x document, it looks like GPIO can't be configured as the open drain mode. Can you help me confirm if AM335x GPIO pin can be configured as as the open drain mode? And it looks like there are 2 i/o pin AIN3 and AIN4 available within the AM335x that have what appears to be open drain outputs. Can TI confirm if these pins would suffice electrically for us trying to accomplish with OneWire protocol.Note the onewire protocol based from the TI "application report SLAA196 - Feb 2004" titled "HDQ Protocol Implementation with MSP430".

Thanks,Jian

  • The AM335x GPIO output buffers are push-pull, but software can configure them to operate as open-drain or open-source.

    To configure a GPIO to operate as open-drain, you would permanently set the respective GPIO_DATAOUT register bit and toggle the respective GPIO_OE register bit.

    An open-drain can be implemented by setting the respective GPIO_DATAOUT register bit to "0" and use the respective GPIO_OE register bit to toggle between the high impedance state where a "1" will turn off the output buffer and the low impedance driven low state where "0" will turn on the output buffer and drive it low.

    An open-source can be implemented by setting the respective GPIO_DATAOUT register bit to "1" and use the respective GPIO_OE register bit to toggle between the high impedance state where a "1" will turn off the output buffer and the low impedance driven high state where "0" will turn on the output buffer and drive it high.

    The AIN3 and AIN4 terminals can only be controlled by the Touch Screen Controller and may not provide the best option for implementing an general purpose open-drain output.

    Regards,
    Paul

     

  • Hi Peaves,

    I am sorry for posting on this old topic.

    Just wanted to know if there is any sample code or reference on the above
    mentioned configuration of Open-Drain GPIO pins.

    Could you please confirm if below are the registers that
    need to be used to implement the Open-Drain feature.

    GPIO_OE Register
    GPIO_DATAOUT Register
    GPIO_CLEARDATAOUT Register
    GPIO_SETDATAOUT Register

    Best Regards
    Kummi
  • I only provide hardware support. Therefore, I’m not able to answer any questions about software availability.

     

    The function of all four registers mentioned in your previous post are described in the AM335x Technical Reference Manual (TRM). I have reviewed the register descriptions provided in the TRM and not sure what information I can provide beyond those descriptions. Based on my interpretation, the GPIO_DATAOUT register would be used when updating all associated outputs, and the GPIO_CLEARDATAOUT/GPIO_SETDATAOUT registers would be used when updating a select subset of the associated outputs.

     

    As described in my previous post, you could set the respective GPIO_DATAOUT bit low and toggle the same GPIO_OE to emulate an open-drain output with the push-pull output. However, you must realize the AM335x GPIO buffer will not be a true open-drain output. It only operates in this mode while your software has it configured to emulate an open-drain output.

     

    Regards,

    Paul