- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have two questions about PWM component for one shot pulse on GPIO.
Can I resolve problems below.
1. I would like to generate one shot pulse output on GPIO with PSoC4000S.
but, we won't get it with PWM component.
2. And I need to change both period and compare settings immediately.
but, we must wait TC once after changing both period and compare settings of PWM.
Best regards,
Yocchi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YoIs_1298666,
For the first question you have posted you can look at the thread which will meet your requirements of generating one shot pulse output on the gpio pin. I have shared the link of the thread where you can follow the steps to do the same.
How do I create a 10us pulse on the PSoC4 TCPWM component and have it come out to a GPIO pin
For the second question in the PWM component you have an option of generating an interrupt for TERMINAL COUNT whenever an interrupt is triggered you can write the period and compare values inside the ISR which might help to solve your issue.
You can get back if your still facing any issues.
Regards
Alakananda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YoIs_1298666,
For the first question you have posted you can look at the thread which will meet your requirements of generating one shot pulse output on the gpio pin. I have shared the link of the thread where you can follow the steps to do the same.
How do I create a 10us pulse on the PSoC4 TCPWM component and have it come out to a GPIO pin
For the second question in the PWM component you have an option of generating an interrupt for TERMINAL COUNT whenever an interrupt is triggered you can write the period and compare values inside the ISR which might help to solve your issue.
You can get back if your still facing any issues.
Regards
Alakananda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Alakananda-san,
Thank you very much for your advice.
I can output the one shot pulse below.
And I can confirm to reflect the change of both period and compare settings immediately.
I have a question.
If PWM and Timer_1 start with "PWM_Start() ,Timer_1_Start() and Clock_Start()" , Pin_OneShot is output the one shot pulse immediately. There is no one shot pulse because I execute "Timer_1_TriggerCommand(Timer_1_MASK|PWM_MASK, Timer_1_CMD_STOP)" befor "Clock_Start()".
Is this correct?
Best regards,
Yocchi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YoIs_1298666,
The top design whatever you have done is correct since you have given a hardware trigger in your top design a software trigger command in your main.c is not required.
The Clock_Start command which you have used in your main.c is also not required as when the timer starts the clock starts automatically and hence starting the clock is not required.
Regards
Alakananda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Alakananda-san,
I fogot to add the PWM component configuration.
It can run well.
Now, I select the manual setting to configure Clock start.
Best regards,
Yocchi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YoIs_1298666,
According to your reply if we give CLOCK_START before or after the PWM_START it will work.
Regards
Alakananda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Alakananda-san,
Thank you very much.
Best regards,
Yocchi