Timers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timers

1,205 Views
naresh
Contributor I
can any body explain about capture and compare timers in the mc9s12xdp512 controller.........what are the applications of these timers......what is the exact meaning here capture and compare....... how these used
thanks advance for your answers
Labels (1)
0 Kudos
1 Reply

339 Views
bigmac
Specialist III
Hello, and welcome to the forum.
 
The ECT module contains a 16-bit, free-running counter and a number of capture/compare channels associated with this counter.
 
When a channel is setup for input capture, the counter value that is current when an external transition takes place will be stored in the channel register, and an interrupt optionally generated.  Conversely, an output compare event utilizes the value pre-loaded to the channel register, and will generate an output transition when the counter reaches the pre-loaded value, and may also optionally generate an interrupt.
 
Basically, input capture is used to measure the time interval between transitions occurring at the channel pin, and output compare is used to generate an accurately timed output sequence at the pin.  The major advantage of this timing method is that software interrupt latencies do not affect the input measurement or output waveform generation, provided the interrupt to process the current event, or setup the next event,  can be completed prior to the next event.
 
Regards,
Mac
0 Kudos