Does the 55 pin of the LPC55S28 have PWM capability?

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

Does the 55 pin of the LPC55S28 have PWM capability?

Jump to solution
750 Views
JJ3
Contributor I

At present, I need three PWM signals to control RGB LED. The 53, 55 and 58 pins of LPC55S28 have been selected as the PWM output signal pins. Is this method feasible?

Tags (1)
0 Kudos
Reply
1 Solution
601 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi JJ3 

No, other two 53 pin (CTIMER0_MATCH1) and 58 pin (CTIMER0_MATCH2) will not affect the GPIO output of 55 pins.

Hope this helps,

Jun Zhang

View solution in original post

0 Kudos
Reply
7 Replies
722 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello @JJ3 

Could you let me know your part package?

Thanks,

Jun Zhang

0 Kudos
Reply
714 Views
JJ3
Contributor I
Hi Jun,
I use the mcu package of LPC55S28JBD64.
Thanks!
0 Kudos
Reply
667 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello JJ3 

Pin 53 and 58 can be used as PWM output pin but Pin55 can be only set as input. see below extacted from DS. If we need PWM output, we need to choose another pin which can support PWM output.

ZhangJennie_1-1722247020367.png

 

Hope this will help you,

Jun Zhang

 

0 Kudos
Reply
648 Views
JJ3
Contributor I
Hi,Jun
Now our PCBA has been completed. Can we control 55PIN by using 53PIN (ctimer0_match1) and simulate output PWM waveform through GPIO output?Is there any other way to do PWM control without changing the hardware?
Thanks!
0 Kudos
Reply
643 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello JJ3 ,

Yes. you can use  53PIN (ctimer0_match1) to output to a spare GPIO. then set 55PIN as GPIO to synchronize 53PIN output.

Hope this can help you,

Jun Zhang

0 Kudos
Reply
612 Views
JJ3
Contributor I
Hi Jun,
Now I'm trying to turn on at pin 60 (CTIMER0_MATCH0) as a PWM signal and then sync with GPIO output at pin 55 so I can use three PWM channels at the same time. Will the other two 53 pins (CTIMER0_MATCH1) and 58 pins (CTIMER0_MATCH2) affect the GPIO output of 55 pins? Here's my code for that


void ctimer0_init(void)
{
ctimer_config_t config;
uint32_t srcClock_Hz;
CLOCK_AttachClk(kFRO_HF_to_CTIMER0);

srcClock_Hz = CTIMER0_CLK_FREQ;
CTIMER_GetDefaultConfig(&config);
timerClock = srcClock_Hz / (config.prescale + 1);

CTIMER_Init(CTIMER0, &config);

CTIMER_RegisterCallBack(CTIMER0, &ctimer_callback[0], kCTIMER_SingleCallback); //kCTIMER_MultipleCallback kCTIMER_SingleCallback
/* Get the PWM period match value and pulse width match value of 2Khz PWM signal */
CTIMER_GetPwmPeriodValue(PWM_FRQ, dutyCycle, timerClock);
CTIMER_SetupPwmPeriod(CTIMER0, CTIMER0_MAT0_PWM_PERIOD_CHANNEL, CTIMER0_MAT0_OUT, g_pwmPeriod, g_pulsePeriod, true);
CTIMER_SetupPwmPeriod(CTIMER0, CTIMER0_MAT0_PWM_PERIOD_CHANNEL, CTIMER0_MAT1_OUT, g_pwmPeriod, g_pulsePeriod, true);
CTIMER_SetupPwmPeriod(CTIMER0, CTIMER0_MAT0_PWM_PERIOD_CHANNEL, CTIMER0_MAT2_OUT, g_pwmPeriod, g_pulsePeriod, true);
pwm_set_duty(global_bright_rgb);
CTIMER_StartTimer(CTIMER0);
}
if (CTIMER_GetOutputMatchStatus(CTIMER0, CTIMER0_MAT0_OUT))
{
bsp_led_off(LED_B);
}
else
{
bsp_led_on(LED_B);
}
void pwm_match_callback(uint32_t flags)
{
(void) flags;
if (times_ms >0)
{
times_ms--;
}
}

Thanks!
0 Kudos
Reply
602 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi JJ3 

No, other two 53 pin (CTIMER0_MATCH1) and 58 pin (CTIMER0_MATCH2) will not affect the GPIO output of 55 pins.

Hope this helps,

Jun Zhang

0 Kudos
Reply