- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have learned that using CyDelay in a BLE program makes the iOS device disconnect from the PSoC. So now I use a Timer module that repeats every 1 millisecond (IMO clock frequency = 24 MHz). However, I am unable to do precise timings in microseconds that was previously done using CyDelayUs. What I need to do is make a stepper motor go 700 us ON, and then 1 us OFF.
How do I accomplish this using the Timer module?
Thanks,
AC
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @AC ,
You can make use of TCPWM component, configured in PWM mode for your application using the below given steps -
1. Drag and drop the TCPWM component in the TopDesign.cysch. Add the clock component to its' clock input.
2. Configure the clock to be 1 MHz as shown below.
3. Double click on the PWM component and set the period as 701 and compare value as 700. This will help you generate pulses with high state for 700 us and low for 1 us. Feed this PWM line output signal as the stepper motor input.
Please follow the above steps and let us know in case of any further query.
Best Regards,
Aashita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @AC ,
You can make use of TCPWM component, configured in PWM mode for your application using the below given steps -
1. Drag and drop the TCPWM component in the TopDesign.cysch. Add the clock component to its' clock input.
2. Configure the clock to be 1 MHz as shown below.
3. Double click on the PWM component and set the period as 701 and compare value as 700. This will help you generate pulses with high state for 700 us and low for 1 us. Feed this PWM line output signal as the stepper motor input.
Please follow the above steps and let us know in case of any further query.
Best Regards,
Aashita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Aashita,
I followed your steps and I have gotten the PWM module to work correctly!
However, when I turn it on (using PWM_Start()), I do not know how to turn it off after a set amount of periods. What I need to do is after 1000 pulses, the PWM needs to turn off by itself.
Do you know how to do this?
Thanks,
AC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @AC ,
I apologise to miss your last query. However, I see that you have this discussion going on this thread : Solved: Re: How to Stop a PWM after a certain amount of pu... - Infineon Developer Community .
Please feel free to create a newer thread for any new issue.
Best Regards,
Aashita