PWM signal measurement on PSOC6

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.
haor_4285216
Level 1
Level 1
First like given

Hello.

I am new to PSOC 

I am trying to measure the duty cycle of PWM signal, and I do get the high count right, but I do not get the low count and the period.

I attached the Oscilloscope screen, from the PWM module output on pin m_2.

Attached the main C file.

Attached the UART output.

Thanks.


Hanan.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Hi Hanan,

I attached the new project which can measure the duty cycle of PWM signal.

You need to check the PWM capture and reload trigger signal. And the getcapture API parameters.

capture2 = Cy_TCPWM_Counter_GetCapture(Counter_2_HW, Counter_2_CNT_NUM);  

capture = Cy_TCPWM_Counter_GetCapture(Counter_1_HW, Counter_1_CNT_NUM);

pastedImage_0.png

View solution in original post

3 Replies
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

Could you attached your test project?

lock attach
Attachments are accessible only for community members.

Thanks.

The project is attached.

Hanan.

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Hanan,

I attached the new project which can measure the duty cycle of PWM signal.

You need to check the PWM capture and reload trigger signal. And the getcapture API parameters.

capture2 = Cy_TCPWM_Counter_GetCapture(Counter_2_HW, Counter_2_CNT_NUM);  

capture = Cy_TCPWM_Counter_GetCapture(Counter_1_HW, Counter_1_CNT_NUM);

pastedImage_0.png