Timers and counters

Timers and counters - Timers and counters What is it? A...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Timers and counters
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What is it? A counter Some logic to perform comparisons Add 1 to count Trigger / Clock source Count value
Background image of page 2
Main system timer 16 bit (value) timer counter Uses registers to determine behaviour Several options for the clock source. Can be used to generate output waveforms Provides 4 selectable interrupts Can be used for input capture. Pages 106 – 134 in datasheet
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Input capture Captures the timer counter value when selected events occur. TCCR1B contains the flag to indicate rising or falling edge. Common usage is to measure the duration of a pulse. Example shows start of pulse at 0x0100 and end at 0x8000. The duration is 0x7F00 pulses. TCNT1 TCNT1= 0x0100 TCNT1= 0x8000 PD0
Background image of page 4
Tricky bits Timer can count 0x0000 to 0xFFFF then wraps. If pulse is guaranteed to be shorter there is the possibility of overlapping the overflow. The true duration is
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/21/2012 for the course COMP EE357 taught by Professor Vanloon during the Fall '10 term at Mohawk College.

Page1 / 15

Timers and counters - Timers and counters What is it? A...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online