You are here

System Tick in PSoC4 BLE | Cypress Semiconductor

System Tick in PSoC4 BLE

Summary: 3 Replies, Latest post by carlsmith.sms_1616011 on 20 Oct 2016 12:17 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
carlsmith.sms_1616011's picture
User
14 posts

Hi Everyone,

Can I use the system tick timer in PSoC4 BLE for periodic interrupt in my program. I want to get an interrupt for every 100ms and in ISR, I check the flag for each task and then I will perform the task according to the flag for periodic operation but I am afraid that it will interfere the bluetooth operation.How can I avoid it?

yssu's picture
Cypress Employee
20 posts

The systick timer uses the Cortex M0 internal clock for counting. So if you are implementing low power code, this would not be the best way to switch task. Why don't you use Watch Dog Timers instead? 

tonyp12's picture
User
17 posts

I use 1/8sec WDT ISR on PROC BLE, as main wakes up after any ISR, the ISR itself just clears its flag and nothing more.

main then OR regular event flag with 125ms flag

unsigned int temp = event.all;                  // atomic way to copy & clear
check.all = temp | ms125.all;                   // OR both
event.all &= ~temp;                        
ms125.all = 0;

It then a row of if-statment to gosub to each statemachines that told the system to come back after this 125ms delay.
​A copy of the flag structure is also used for sleep and deepsleep if it's needs PWM to stay on etc.

 

carlsmith.sms_1616011's picture
User
14 posts

Really thanks for your pieces of advice and I will work on it.

Log in to post new comments.