Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

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

cross mob
YongseokJeon
Level 4
Level 4
Distributor - Changnam (South Korea)
50 replies posted 50 questions asked 25 replies posted

Hi, I'm using CY8CKIT-062-WIFI-BT EVK.

I'm creating a PWM waveform with P0.3 using TCPWM[0].CNT[1].

Is there a way to use another Timer (e.g. TCPWM[0].CNT[0]) to generate an interrupt when TCPWM[0].CNT[1] outputs 100 times (100 PWM cycles)?

In other words, when TCWMP[0].CNT[1] outputs 100 times, can the interrupt of TCPWM[0].CNT[0] occur once?

Thanks and Regards,

YS

0 Likes
1 Solution
ninad_w
Moderator
Moderator
Moderator
50 solutions authored 100 replies posted First like given

Hi @YongseokJeon ,

 

When TCPWM[0].CNT[1] outputs 100 times, the output signal will be sent to the input of TCPWM[0].CNT[0]. After 100 counts, TCPWM[0].CNT[0] will generate an interrupt, which can be used to trigger any other code or operation.

 

  1. Configure TCPWM[0].CNT[1] to generate a PWM waveform on a P0.3 pin to run in a One-Shot mode. This means that it will generate an interrupt once and then stop.
  2. Configure the Compare value for TCPWTM[0].CNT[0] to 100. This will generate an interrupt after 100 counts.
  3. Connect the output of TCPWM[0].CNT[1] to the input of TCPWM[0].CNT[0]. Make sure you enable the interrupts for TCPWM[0].CNT[0].

 

Please refer to the CPWM (Timer Counter PWM) section of the MTB CAT1 Peripheral driver library for more details. Here is the link.

 

Best regards,

Nin

View solution in original post

0 Likes
1 Reply
ninad_w
Moderator
Moderator
Moderator
50 solutions authored 100 replies posted First like given

Hi @YongseokJeon ,

 

When TCPWM[0].CNT[1] outputs 100 times, the output signal will be sent to the input of TCPWM[0].CNT[0]. After 100 counts, TCPWM[0].CNT[0] will generate an interrupt, which can be used to trigger any other code or operation.

 

  1. Configure TCPWM[0].CNT[1] to generate a PWM waveform on a P0.3 pin to run in a One-Shot mode. This means that it will generate an interrupt once and then stop.
  2. Configure the Compare value for TCPWTM[0].CNT[0] to 100. This will generate an interrupt after 100 counts.
  3. Connect the output of TCPWM[0].CNT[1] to the input of TCPWM[0].CNT[0]. Make sure you enable the interrupts for TCPWM[0].CNT[0].

 

Please refer to the CPWM (Timer Counter PWM) section of the MTB CAT1 Peripheral driver library for more details. Here is the link.

 

Best regards,

Nin

0 Likes