The Texas Instruments MSPM0 microcontroller has a few open drain GPIOs. TI calls them ODIO. These are 5V tolerant, and can switch up to ( see jc2048 comment below) +-8 mA. The main purpose is to support multi-level IO.
They can do general low side switching too. That's what I'm checking out in this post. I use a ODIO to blinky an LED.

image: EasyL1105 controling an LED with open drain IO
The standard GPIOs can source 3.3V, 6 mA (with caveats). Can be used to modestly blink efficient LEDs. But if you want to control a small LCD's backlight, this 5V, 8 mA capability can save a few components.
|
From TI's documentation:
"... the open drain IO only implement a low-side NMOS driver and no high-side PMOS driver. The 5V-tolerant "ODIO can be used to implement communication with a 5V device."
|
What does this project do?
It's the blinky. TI calls it gpio_toggle_output. It blinks an LED every second. The only change I made, is to define open drain pin PA0 as the LED pin. The code is just a simple loop that toggles the pin, then delays half a second.
But what it actually allows you to do, is test that the MSPM0 ODIOs are capable to switch a 5V powered load.
Hardware resources
| LED1 | PA0 | Led with 330R resistor in series Powered by 5V |
The circuit is simple. A red LED with a 330V resistor in series. When PA0's gate is driven high, the current in this circuit, and through PA0's channel, will be around 10 7 mA.
I used the 5V of my EasyL1105 kit. If you use a LaunchPad: they have a 5V supply too.

Testing
Program the MSPM0LL05 with the attached CCS project code. If you have a debugger, you can do this from CCS. I've also provided a .hex firmware that can be used with shabaz ' bootloader utility.
Code highlights
In SysConfig, PA0 is set up as an open drain output.:

The code is extremely simple:
/* This results in approximately 0.5s of delay assuming 32MHz CPU_CLK */
#define DELAY (16000000)
int main(void)
{
SYSCFG_DL_init();
while (1) {
delay_cycles(DELAY);
DL_GPIO_togglePins(GPIO_GRP_ODIO_PORT,
GPIO_GRP_ODIO_PIN_ODIO_0_PIN);
}
}
What's next? PA0 can be driven from a PWM peripheral. That allows you to dim a small LCD's backlight without external transistors.
Have fun!
ccs project adapted to EasyL1105 (with bootloader compatible .hex firmware): EasyL1105_odio_sink_20251118.zip


-
shabaz
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Comment-
shabaz
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Children