PSoC 4 BLE causes TCPWM output to be inconsistent

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.
Anonymous
Not applicable

Hi there,

   

I'm using the CY8CKIT-042-BLE pioneer kit with the PSoC 4 CY8C4247LQI-BL483 module. I'd like to use a bluetooth app to drive a PWM signal, so I'm using the Android example code "Find Me" service with the "Find Me" target as the PSoC 4 BLE. The app connects to and can send the various alerts to the PSoC 4 BLE with no problem. However, if I add a TCPWM block to the project with an input clock signal at 480kHz, the TCPWM configured with a period of 50Hz (value of 4800), and a compare value of 4400 (approximately 1.5ms), the PWM output to pin 3.4 is completely inconsistent with the TCPWM configuration. The period is around 300ms with a duty cycle of about 16%, instead of a period of 20ms and a duty cycle of 7.5%. If I create a project with only the TCPWM (and no BLE module), the TCPWM behaves exactly as expected. Are there any known issues between the BLE module and TCPWM module? I'm attaching my two projects for reference. Any help would be greatly appreciated. 

   

Thanks,

   

Becky

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum, Becky!

   

In your BLE project the system switches into deep-sleep mode. This disabled the IMO from which the clock for your PWM is generated.

   

The PWM is not sent into sleep-mode to save the states. Have a look at the _Sleep() and _Wakeup() functions for the component you use.

   

 

   

Bob

View solution in original post

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum, Becky!

   

In your BLE project the system switches into deep-sleep mode. This disabled the IMO from which the clock for your PWM is generated.

   

The PWM is not sent into sleep-mode to save the states. Have a look at the _Sleep() and _Wakeup() functions for the component you use.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob! Thanks for the warm welcome and quick response. I commented out all the BLESS sleep state code in the main execution loop (basically, everything after the switch statement that looks at the alertLevel), and the PWM works as expected. I also added PWM_Sleep() and PWM_Wakeup() functions to the StackEventHandler() when the BLE is disconnected and connected, respectively. Everything is working great now. Thanks again for your support!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You are always welcome, Becky!

   

 

   

Bob

0 Likes