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

PSoC™ 4 Forum Discussions

Anonymous
Not applicable

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?

0 Likes
1 Solution
Anonymous
Not applicable

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? 

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

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? 

0 Likes
ToPh_1104671
Level 2
First like received
Level 2

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.

0 Likes
Anonymous
Not applicable

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

0 Likes