The Texas Instruments MSPM0 microcontroller has a few open drain IOs. TI calls them ODIO. In this post, I show that they can be controlled by a timer. More specific: one of the MSPM0 PWM peripherals will control the duty cycle of an open drain IO, and dim an LED.
What does this project do?
It dims an LED. But what it actually tries to showcase: the 5V tolerant open drain IOs can directly be controlled from a timer.
Hardware resources
| LED1 | PA0 | Led with 330R resistor in series Powered by 5V |
| PWM_0 | TIMG1 channel 0 |
one of the PWM channels |
The circuit is simple. A red LED with a 330Ohm resistor in series. When PA0's gate is driven high by one of the controller PWM peripherals, the current in this circuit, and through PA0's channel, will be around 6.9 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
It's TI's pwm_led_driver example. An LED dimmer demo. But I routed the PWM output to open drain pin PA0.
In SysConfig:

I usually show some code highlights in this section. But I didn't change TI's example. So skipping it in this post.
Have fun!
ccs project adapted to EasyL1105 (with bootloader compatible .hex firmware): pwm_led_driver_EasyL1105_20251119.zip
-
DAB
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Comment-
DAB
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Children