3 Replies Latest reply on Oct 20, 2016 12:17 AM by user_1616011

    System Tick in PSoC4 BLE

      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?

        • 1. Re: System Tick in PSoC4 BLE

          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? 

          • 2. Re: System Tick in PSoC4 BLE
            ToPh_1104671

            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.

            • 3. Re: System Tick in PSoC4 BLE

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