1 Reply Latest reply on Mar 13, 2018 2:21 AM by nidh

    How to look at the count value of the Timer / Counter component


      Hello members.


      I want to create a project shown in the attached file (H Pulse Count) and measure the H width of Input_Signal.



      1.How can I read the captured current count value?

      2.Is there a register that saves the count value?

      3.Is the component configure (Capture_Input = Falling Edge, Count Input = Rising Edge) correct?


      Best Regards

        • 1. Re: How to look at the count value of the Timer / Counter component



          1. You can use the Cy_TCPWM_Counter_GetCapture() API to read the captured count value.

          2. Yes, TCPWMx_CNTy_CC register stores the captured count (x is the TCPWM group number - 0 or 1, and y is the counter number). Please use the API mentioned above instead of direct register reads since PSoC Creator may re-assign the Counter to a different TCPWM address when you make changes to the TopDesign schematic.

          3. The logic looks ok to me. However, I'd recommend examining the following code example for component settings and API reference, which documents a similar technique used for frequency measurement:

          CE220692 - PSoC 6 MCU: Frequency Measurement Using TCPWM


          Please let me know if you have more questions.