1 Reply Latest reply on Mar 28, 2018 5:34 AM by abga

    fx3s timer

    Geethanjali_3054931

      Hi,

      How to generate one mili second using timer in fx3s?

      thank you...

        • 1. Re: fx3s timer
          abga

          Create a new callback function named say, Timercb()

           

          CyU3PTimer Timer;     // define this handle

          void TimerCb()

          {

          // Here you get the callback after  Time_in_millisecond

          }

           

          void TimerInit(void)

          {

          CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

          apiRetStatus = CyU3PTimerCreate(&Timer, TimerCb, 0, Time_in_millisecond, Time_in_millisecond, 1);

          if (apiRetStatus != CY_U3P_SUCCESS)

          {

             CyU3PDebugPrint (2, "TimerCreate failed, Error Code = %d\r\n", apiRetStatus);

          }

          }

          Note: For further understanding you can refer to CyU3PTimerCreate() API in API Guide

           

          Regards

          Abhinav

          1 of 1 people found this helpful