2379548_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2379548_en-US

2379548_en-US

Title: Unable to Generate Orange Color on FRDM-MCXN236 RGB LED Using CTIMER PWM

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:

  1. Is the onboard RGB LED on the FRDM-MCXN236 capable of true independent RGB PWM control?
  2. Which CTIMER match outputs are connected to:
    • PORT4_17 (Blue)
    • PORT4_18 (Red)
    • PORT4_19 (Green)
  3. Do I need separate CTIMER match channels (MAT0, MAT1, MAT2, MAT3) to independently control the RGB channels?
  4. Is the ctimer_pwm_example intended only as a PWM demonstration rather than an RGB color-mixing example?
  5. Has anyone successfully generated orange or arbitrary RGB colors on the onboard RGB LED?

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.

Clock|TimersDevelopment BoardFRDM-TrainingHands-On TrainingMCXNRe: Title: Unable to Generate Orange Color on FRDM-MCXN236 RGB LED Using CTIMER PWM

Hi @syedsahil28803_gmail_com 

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. 

Tags (1)
No ratings
Version history
Last update:
yesterday
Updated by: