1 Reply Latest reply on Feb 26, 2016 3:26 AM by user_1377889

    how to generate Timer

    dinaline_1572371

      Hi. i have a question about Timer.

         

      compared to other program, 'PSoC Creator' used wdt mostly by creating Timer.

         

      but I think that side effect of this program could only 3 wdt.

         

      but I want to use such as '1sec, 1min' Timer.

         

      here's the example

         

      ***********************************************

         

      SysTimer10ms++;
       if(!(SysTimer10ms%600)) { // 1 min
        SysTimerMin++;
       }
       if(!(SysTimer10ms%100)) { // 1 sec
        SysTimerForDHCP++;//DHCP LEASE TIME CHECK NO
       }
       if(!(SysTimer10ms%10)) { //100 ms
        SysTimer100ms++;
       }

         

      ***************************************************

         

       

         

      please teach me in detail.

        • 1. Re: how to generate Timer
          user_1377889

          Using the systick timer or the WDT as you showed is the usual ARM M0 way. But in PSoCs (or PRoCs) is a bit more: there are components. Open the Topdesign view and drag a Timer Counter PWM - component onto your schematic screen. You may add a new page beforehand to better overview what you do. This component together with a clock component can be used to generate a one minute timer quite easy. The output can be connected to an isr component to get interrupted. With the component's APIs you are able to control (start/stop/reset etc) the TCPWM.

             

           

             

          Bob