2 Replies Latest reply on Oct 3, 2018 3:14 PM by alex.lipkovich

    Can't change the UDB Timer period in software after enabling interrupt

    alex.lipkovich

      If connect the interrupt component to the "interrupt" pin, it not work at all, but if connect to the "tc" pin it work, but can change the period in software only if make it before the interrupt enable..

        • 1. Re: Can't change the UDB Timer period in software after enabling interrupt
          gani

          Hi,

           

          For your first issue "If connect the interrupt component to the "interrupt" pin, it not work at all, but if connect to the "tc" pin it work"

          --> Please ensure you have checked "interrupt on TC" in Timer component GUI. Please find the attached project and test it in your board.

           

          Ideally the change of period is independent of the enabling of interrupt. When you change the value of the Period, please note that you have to manually write the counter value to '0' using the Write counter API. Please go through the following KBA for more details.

           

          http://www.cypress.com/comment/305831

           

          Please try this and check once.

          Thanks

          Ganesh

          1 of 1 people found this helpful
          • 2. Re: Can't change the UDB Timer period in software after enabling interrupt
            alex.lipkovich

            Hi Ganesh
            the timer interrupt work nice, but the period still work strange, it really changed, but if i put the same period value in creator window and in program it work different..

            I put the 4 in timer window,work nice, but if i put the 4 again in function-the speed fall to half..

            if i put 8 in the psoc creator window ..and check if it real 8 in program,

            while(Timer1_ReadPeriod()!=8);

            the program enter to infinity loop and no continue..

             

            PS Look the timer period value for the

            • Timer_WritePeriod(period);

            function want be 1 less of the real period, for example it I want set the timer period to 4 i write

            • Timer_WritePeriod(3);