Timer corrupted after 1 minute

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,

I am interfacing an ble to one led , i want to set blink the led for 1sec,it's blinking.but after 1 minute led stops working and pwm also starts working...

Even if i make my code to blink led for 1 minute ,the led blinking for 1 sec only.

please help me to resolve the issue

find the attachment

Thanks in advance.

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

You are using deep sleep mode where the high frequency components do not run.

Bob

View solution in original post

0 Likes
10 Replies
Anonymous
Not applicable

Hello,

Please do not create many posts for the same issue.

I believe your problem lies with the BLE Advertisement timeout. You have it set to 30 seconds fast advertising and then afterwards 30 seconds slow advertising (See picture). Together you have a 1 minute timeout.

pastedImage_0.png

What happens after this 1 minute timeout? Your code has the following:

        case CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP:

            if(CYBLE_STATE_DISCONNECTED == CyBle_GetState())

            {  

                  Advertising_LED_Write(LED_ON);

                  CyBle_GappStopAdvertisement();

                  CySysPmHibernate();

            }

So your system hibernates after one minute of advertising. While hibernating the system turns off and your Timer/PWM/WDT are going to stop working.

The solution to this problem depends on the purpose of your device.

You could turn off the timeouts in the BLE settings but your device will permanently advertise, which could use a lot of power when it is not needed.

You could add a button to start advertising again and remove the Hibernate function from the timeout.

Regards,

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

i am trying to blink an led exactly for 1 sec but  led blinks for 2sec .

please help me

0 Likes

See timer datasheet for explanation of "Period". Must be set to 0 in your case.

Bob

0 Likes
Anonymous
Not applicable

can you tell me the formula to calculate the required timeperiod.

i worked for pic controllers in that

reuired time=prescaler*period*(1/f)

in case psoc4 bles what is the formula to calculate the time period

0 Likes
Anonymous
Not applicable

thanks for your reply sir

i made          CySysPmHibernate();  as commented  ,now it,s working.

once again thanks alot.

0 Likes
Anonymous
Not applicable

can you please tell me the formula for calculating dutycycle of PWM.

Thanks in advance.

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi

Please refer this < http://www.cypress.com/file/220361/download >

Best Regards,
VSRS

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

You are using deep sleep mode where the high frequency components do not run.

Bob

0 Likes
Anonymous
Not applicable

thanks for your reply sir.

i made a lowpowerimplementation()  api as commented  then how device go to deep sleep mode

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

i am trying to blink an led exactly for 1 sec but  led blinks for 2sec .

please help me

0 Likes