Hi everyone,
I am currently learning embedded systems using the NXP FRDM-MCXN236 development board and experimenting with the onboard RGB LED using the MCUXpresso SDK ctimer_pwm_example.
My goal is to generate an orange color on the onboard RGB LED. Since orange is typically created by mixing red at a high brightness and green at a lower brightness while keeping blue off, I expected to achieve this through PWM duty cycle control.
Here is what I have discovered so far.
The original example configures:
PORT4_19 -> CT3_MAT3
and the onboard RGB LED illuminates green.
I then experimented by changing only the pin number in:
PORT_SetPinConfig(PORT4, XX, &port4_19_pinR10_config);
Observations:
PORT4_19 illuminates Green
PORT4_18 illuminates Red
PORT4_17 illuminates Blue
If I configure both PORT4_17 and PORT4_18 using the same configuration, I get Magenta (Red + Blue).
This makes me think that the same CTIMER output signal is being routed to multiple RGB channels.
The main issue is that changing DUTY_CYCLE values such as 0, 25, 50, 75, 99, or 100 does not appear to produce meaningful brightness changes. Because of this, I cannot independently control the intensity of the red and green channels and therefore cannot generate orange.
My understanding at the moment is that I may be driving multiple RGB channels using the same PWM output, meaning all channels receive the same duty cycle and cannot have independent brightness levels.
I would appreciate help with the following questions:
Any explanation regarding the RGB LED hardware routing, pin multiplexing, and recommended approach for RGB color mixing on this board would be greatly appreciated.
Thank you.
Thank you for the post!
1. The RGB could be controlled independently the brightness of each color.
2.
P4_17 : CTimer 3 MAT 1
P4_18 : CTimer 3 MAT 2
P4_19 : CTimer 3 MAT 3
3. You could select the same channel to control the PWM period for the other 3 signals.
4. Yes, the expected use of the example is PWM demonstration.
5. I tried out at my end, the PWM successfully control the brightness, but the combination of the colors does not result in orange, it is more like yellow. This could be a limitation of the RGB Led on the board.