PWM Counter value when PWM Alignment is Center Aligned

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello members

Please tell me how the Counter value changes when PWM Alignment is Center Aligned.
I read the datasheet but I could not understand it.
I have written a question with concrete examples in the attached file(PWM.pdf), so I would like you to answer.

Best Regards

0 Likes
1 Solution

Hello shimizu.hiro-00_1679296​,

To your questions -

1. Note that reload can be used only when the counter is in stop mode (otherwise it will not have any impact). PWM output will be in stopped state before the reload event and after the reload event, it will toggle every-time the counter reaches the compare value (in center-aligned mode).

2. Reload sets the counter to '1' and sets the mode to 'up', so it will be 1->2

You can refer to Section 27.3.4 in PSoC® 6 MCU: PSoC 63 with BLE Architecture Technical Reference Manual - it has all the details

Regards,

Meenakshi Sundaram R

View solution in original post

0 Likes
3 Replies
MeenakshiR_71
Employee
Employee
100 likes received 50 likes received 25 likes received

Hello shimizu.hiro-00_1679296​,

In center aligned mode, the counter increments to the period value. On reaching the period value (Overflow), it starts decrementing/down-counting. On reaching 0 (Underflow), it starts incrementing/up-counting.

So to your question, counter will go like this on every clock 0>1>2>3>2>1>0... So your actual PWM period will 2*Period value you set.

Let me know if this answers.

Regards,

Meenakshi Sundaram R

0 Likes
Anonymous
Not applicable

Hello Meenakshi Sundaram R-san.

Thank you for your reply.

I understood how to change Counter value.

Please tell me about the change of Counter value when Reloaded.

In the data sheet, it is described as follows.

reload[1]*  For Center/Asymmetric alignment modes the counter is initialized with “1”

Q1. Although the count before reloading starts from 0, the count starts from 1 after reloading.Will the PWM output waveform change before and after reloading?

Q2.After reloading, the count value changes in 1 → 0 or 1 → 2 direction?

Best Regards

0 Likes

Hello shimizu.hiro-00_1679296​,

To your questions -

1. Note that reload can be used only when the counter is in stop mode (otherwise it will not have any impact). PWM output will be in stopped state before the reload event and after the reload event, it will toggle every-time the counter reaches the compare value (in center-aligned mode).

2. Reload sets the counter to '1' and sets the mode to 'up', so it will be 1->2

You can refer to Section 27.3.4 in PSoC® 6 MCU: PSoC 63 with BLE Architecture Technical Reference Manual - it has all the details

Regards,

Meenakshi Sundaram R

0 Likes