Does the 55 pin of the LPC55S28 have PWM capability?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Does the 55 pin of the LPC55S28 have PWM capability?

跳至解决方案
751 次查看
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?

标记 (1)
0 项奖励
回复
1 解答
602 次查看
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 项奖励
回复
7 回复数
723 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello @JJ3 

Could you let me know your part package?

Thanks,

Jun Zhang

0 项奖励
回复
715 次查看
JJ3
Contributor I
Hi Jun,
I use the mcu package of LPC55S28JBD64.
Thanks!
0 项奖励
回复
668 次查看
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 项奖励
回复
649 次查看
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 项奖励
回复
644 次查看
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 项奖励
回复
613 次查看
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 项奖励
回复
603 次查看
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 项奖励
回复