- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear community members,
I've attached an Led to an gpio pin. The led is later driven by a PWM component. But until I reach the state that I can initialize the PWM the control the behavior of the led it's just turned on. Since it's an RGB led it shows some color I don't want.
The initial driving state drop-down in the pin configuration is disabled. How can I achieve that the led is initially powered off?
Thank you for taking your time,
Daniel
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Daniel,
One idea is to keep the pin's drive mode set to Analog High-Z until you start the PWM.
You can either select High impedance analog in the pin component settings, or use software
LED_SetDriveMode( LED_DM_ALG_HIZ );
After starting the PWM, set it to the desired drive mode (e.g. Open-Drain Drive Low) and the LED will light up.
LED_SetDriveMode( LED_DM_OD_LOW );
I hope this is helpful.
Shima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Daniel,
One idea is to keep the pin's drive mode set to Analog High-Z until you start the PWM.
You can either select High impedance analog in the pin component settings, or use software
LED_SetDriveMode( LED_DM_ALG_HIZ );
After starting the PWM, set it to the desired drive mode (e.g. Open-Drain Drive Low) and the LED will light up.
LED_SetDriveMode( LED_DM_OD_LOW );
I hope this is helpful.
Shima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Shima, this perfectly do.