In attached sample code can you help me how to configure PWM in center aligned mode?
Path: LPC824_Example_Code_Bundle_IAR_r1.0\Example_SCT_PWM_2State\src
Original Attachment has been moved to: LPC824_Example_Code_Bundle_LPCXpresso_r1.0.zip
Hi Ranjith Shanbhag,
Thank you for your trust.
Do you just want to configure the counter to up-down mode?
If yes, please modify the SCT control register, BIDIR_L and BIDIR_H to 1.
Just like the user manual, SCT regiser description:
Please try it on your side.
Wish it helps you!
If you still have question, please let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi kerryzhou,
Thank you for your valuable reply.
What all configuration changes required? By modifying SCT control register, BIDIR_L and BIDIR_H to 1 i am unable to aceive it.
Please help me.
Regards,
Ranjith Shanbhag
Hi Ranjith Shanbhag,
I don't know why you said configure BIDIR_L and BIDIR_H to 1 unable to work?
I just modify these two bits, it works on my side.
As you know, CPWM will make the counter to up-down, so the frequency will half of the original counter up.
This is my test result and code is in the attachment.
This project will generate 250hz at PIO0_16, 50khz PWM at PIO0_12.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Ranjith Shanbhag,
How did you know it can't achieve it?
Please give me your test result, and tell me the details how your analysis it. I will check it.
If it is really not OK, I will test it on my side when I have time.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi kerryzhou,
With reference to AN11538 SCTimer/PWM cookbook (page no 15) i have done modification in the code and tested. i am unable to get PWM output.
i need your help to move forward in my project. Please provide your thoughts.
Please find the below link for the project which you shared earlier and in same project i need center aligned configuration.
https://community.nxp.com/message/869082?commentID=869082&et=watches.email.thread#comment-869082
Path: LPC824_Example_Code_Bundle_IAR_r1.0\Shared_Project_Source_Code\Example_SCT_PWM_2State\src
Sorry @Kerry Zhou i attached wrong project. Please find the below link for the project
https://community.nxp.com/message/869082?commentID=869082&et=watches.email.thread#comment-869082
Path: LPC824_Example_Code_Bundle_IAR_r1.0\Shared_Project_Source_Code\Example_SCT_PWM_2State\src