SysTic can't work after SleepTimer work

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

cross mob
Anonymous
Not applicable

 If the code only use systic or sleeptimer, they work well, if you use them together, the systic will only work once.

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

Can you please be a bit more specific regarding your problem?

   

Which PSoC do you use?

   

Which development kit have you got or do you use your own board?

   

Which Creator version are you using?

   

Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting .zip file.



Bob
 

0 Likes
Anonymous
Not applicable

 Which PSoC do you use?

   

Which development kit have you got or do you use your own board?

   

CY8CKIT-050 PSoC® 5LP

   

Which Creator version are you using?

   

3.1 and 3.2

   

 

   

Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal) 
and attach the resulting .zip file.

   

 

   

You can use sleeptimer example as base project and add CySysTicStart(),CySysTicSetCallback(callbackFuc),

   

the callbackFuc will never run anymore if you call CyPmSleep() once, the SleepTimer set to 1S~4S, but the code in main() without effect.

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

I do not want to change anything, so when you post your project, I have something to start with.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 It's obviously the SleepTimer work with CyPmSleep caused unstable, even the base SleepTimer example code can't work stable, the interrupt actived by the SleepTimer once or twice.

   

Thanks for your reply! But I've removed the SleepTimer and CyPmSleep function, these function make the MCU out of my control.

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

Did you read the hint that CyPmSleep will not work with debugging?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 I debug by LCD, please focus on the problem.

0 Likes
Anonymous
Not applicable

Please check AN54460 - PSoC® 3 and PSoC 5LP Interrupts (http://www.cypress.com/?rID=38267). This AN has explanation on Systick Timer in Cortex-M3 and has an example project on how to use systick with PSoC 5LP. The systick is clocked  by the BUS_CLK. Please check Section 15 "System Timer (SysTick)" in the System Reference Guide.
So systick cannot be used as a wake-up source and cannot be used in Sleep

   

Please check the function void CySysTickSetClockSource(uint32 clockSource) in the System Reference Guide. You can call this function to run the Systick either using System Clock or using ILO 100 KHz for PSoC 5LP. Change this to ILO and see if it works in low power mode.

   

 

   

-Keerthi

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

 @kylongmu,

   

 

   

Try to re-enable SysTick with code:

   

 

   

 SysTick->CTRL=1; //enable

   

 

   

 //  SysTick->CTRL=0; //disable

   

 

   


   

Each time SysTick is expiring, it fires interrupt AND reenables timer.

   

 

   

If system goes asleep, interrupt will not fire and timer won't reload.

   

 

   


   

Just a theory.

   

 

   

odissey1

0 Likes