At present, I need three PWM signals to control RGB LED. The 53(PIO0_3), 55(PIO0_4) and 58(PIO0_19) pins of LPC55S28 have been selected as the PWM output signal pins. Is this method feasible?
I see the specification of the 55 pin only support input mode PWM, 58 pin only support output mode, these two pins can control RGB lights at the same time?
Solved! Go to Solution.
Hi @JJ3
Your approach to using CTIMER0 to generate PWM signals on the specified pins should generally work. However, there are a few considerations to ensure proper operation and avoid conflicts:
1. Pin Multiplexing: Ensure the pins are correctly configured for their respective functions. Pin 55 (PIO0_4) needs to be set as GPIO if you’re synchronizing it manually with the CTIMER0 output on pin 60 (CTIMER0_MATCH0).
2. PWM Synchronization: Manually toggling GPIO based on CTIMER output can work, but there might be timing discrepancies. If exact synchronization is crucial, consider using hardware synchronization features or ensuring your toggling logic is fast and consistent.
3. PWM Configuration: Ensure each CTIMER match output is correctly configured to avoid conflicts. Verify the match register values and ensure the timer and GPIO setup do not interfere with each other.
Hope this will help you.
BR
Hang
Hi @JJ3
The specification you mentioned indicates that the 55th pin (PIO0_4) supports input mode PWM, and the 58th pin (PIO0_19) supports output mode PWM.
To control an RGB LED using PWM signals, you would typically need at least three pins with PWM output capabilities.
So these two pins can not control RGB lights at the same time.
Hope this will help you.
BR
Hang
Hi @JJ3
Your approach to using CTIMER0 to generate PWM signals on the specified pins should generally work. However, there are a few considerations to ensure proper operation and avoid conflicts:
1. Pin Multiplexing: Ensure the pins are correctly configured for their respective functions. Pin 55 (PIO0_4) needs to be set as GPIO if you’re synchronizing it manually with the CTIMER0 output on pin 60 (CTIMER0_MATCH0).
2. PWM Synchronization: Manually toggling GPIO based on CTIMER output can work, but there might be timing discrepancies. If exact synchronization is crucial, consider using hardware synchronization features or ensuring your toggling logic is fast and consistent.
3. PWM Configuration: Ensure each CTIMER match output is correctly configured to avoid conflicts. Verify the match register values and ensure the timer and GPIO setup do not interfere with each other.
Hope this will help you.
BR
Hang