Home

Difference between Timer and Counter in PSoC1

E-mail Print PDF
( 1 Vote )

Question: What is the difference between the Timer and Counter user modules in PSoC 1?

Answer: The Timer is essentially a super-set of the counter.  It can perform all the functions that a Counter can perform, like frequency divider, PWM, generate interrupt on Terminal Count or Compare True etc.


The most important difference between the Timer and Counter is the Capture input of the Timer.  When the Capture input is made HIGH, it acts as enable input like the enable input of a Counter.  When a digital signal is connected to the Capure input, the content of the Timer's count register is latched to the Compare register on the rising edge of the input signal.  By setting the interrupt type to Capture, an interrupt can also be generated on capture event.  This can be used to measure the time difference between two rising edges of the input signal for frequency measurement.


By setting the InvertCapture parameter to "Invert", the capture event will occur on the falling edge of the capture input.  By changing the InvertCapture to Rising and Falling edge (by controlling the "Data Invert" bit in the DxBxxFN register), the timer can be used to measure the pulsewidth of a signal.

Comments (4)
  • hema413  - what difference will it make wheher capture is hig
    I made it high and low to generate a 1msec pulse.
    But I could see no differnce in output.
    kindly explain more about capture
  • graaja
    In a timer user module, Capture input is used to latch the count value when a rising or falling edge is detected on the capture input. If you want a 1mS pulse at the output, use a PWM or Counter user module instead. You can change the pulse width by using the CompareValue.l
  • siddharthvijay  - PSoC1
    Hello Sir

    Since you have said that timer can be used as counter and pwm then why psoc1 has counter and pwm user modules separately.
  • graaja
    Just as a matter of convenience. Best Regards, Ganesh
Only registered users can write comments!