Hello everyone I am using a LPC1549 and I am trying to create 4 PWM signals all running at the same frequency with the same duty cycle but 90 degrees out of phase from each other.
I am trying to configure the SCT to run by itself and move from state to state, and change the duty cycle by using the MATCHREL reg. But I cannot configure the SCT correctly or I am not understanding something correctly. I will paste my init file here so you guys can find what I am doing wrong.
Thanks in advance
Original Attachment has been moved to: LPC1549-4PWM-Init.txt.zip
Set up four match registers at <time_period>/4, <time_period>/2, 3*<time_period>/4 and <time_period>,
and another four at <time_period>/4+<pulsewidth> and <time_period>/2+<pulsewidth> etc.
Set up four events, one for each match register.
Use EVENT1 to SET output 1,
Use EVENT2 to SET output 2
Use EVENT3 to SET output 3
Use EVENT4 to SET output 4
Use EVENT5 to CLEAR output 1
Use EVENT6 to CLEAR output 2
Use EVENT7 to CLEAR output 3
Use EVENT8 to CLEAR output 4
Use EVENT4 to LIMIT the counter.
Everything stays in STATE 0.
If not clear from this, let me know your clock frequency and PWM frequency.
When you change the pulsewidth, you need to update four registers.
If that's inconvenient, then it probably CAN be done using states, but this is a lot easier to understand!
Hi Mario Rod ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I was wondering if you can exemplify the Flow of implementation, it help me get a completely knowledge.
I'm looking forward to your reply.
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------