PSoC 4 BLE Timer Module

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

cross mob
AC
Level 1
Level 1
5 replies posted 5 sign-ins 5 likes given

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

0 Likes
1 Solution
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

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.

Aashita_Raj_3-1639933334159.png

 

2. Configure the clock to be 1 MHz as shown below.

Aashita_Raj_2-1639933301327.png

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.

Aashita_Raj_5-1639933777858.png

 

Please follow the above steps and let us know in case of any further query.

Best Regards,

Aashita

 

 

 

 

View solution in original post

3 Replies
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

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.

Aashita_Raj_3-1639933334159.png

 

2. Configure the clock to be 1 MHz as shown below.

Aashita_Raj_2-1639933301327.png

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.

Aashita_Raj_5-1639933777858.png

 

Please follow the above steps and let us know in case of any further query.

Best Regards,

Aashita

 

 

 

 

AC
Level 1
Level 1
5 replies posted 5 sign-ins 5 likes given

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

0 Likes
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

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

0 Likes