SWRZ136A December 2023 – September 2024 CC2340R5-Q1
Open-Drain Configuration Can Drive a Short High Pulse
Each DIO can be configured to an open-drain mode using the IOCx register.
However, an internal device timing issue may cause the GPIO to drive a logic-high for approximately 1ns–2ns during the transition into or out of the high-impedance state. This undesired high-level can cause the GPIO to be in contention with another open-drain driver on the line if the other driver is simultaneously driving low. The contention is undesirable because it applies stress to both devices and results in a brief intermediate voltage level on the signal. This intermediate voltage level may be incorrectly interpreted as a high level if there is not sufficient logic filtering present in the receiver logic to filter this brief pulse.
If contention is a concern, do not use the open-drain functionality of the GPIOs; instead, emulate open-drain mode in software. Open-drain emulation can be achieved by setting the GPIO data (DOUT31_0.DIOx) to a static 0 and driving the GPIO output enable (DOE31_0.DIOx) to enable or disable the drive low. For an example implementation, see the code below.
#include <ti/devices/cc23x0r5/driverlib/gpio.h>
/* Call driver init functions */
GPIO_init();
//Set GPIO data (DOUT31_0.DIOx) to static 0
GPIOClearDio(CONFIG_GPIO_LED_0);
while(1) //loop below toggles the LED on and off every 1 second
{
GPIOSetOutputEnableDio(CONFIG_GPIO_LED_0, 1);
sleep(1);
GPIOSetOutputEnableDio(CONFIG_GPIO_LED_0, 0);
sleep(1);
}