Lecture 16 Flashcards
Timers and counter
What is a Timer/counter
A register that counts up (or down) with every transition on an input signal
Option 1 Input signal is a Periodic signal with known frequency
Count register can be used for time-keeping or performing actions with controlled timing.
Option 2: Input signal is an external signal without known timing
Count register can be used to count number of pulses on input signal.
The 2 ways the Auto-reload value is used.
- Counter from ARV - resets back when overflows
From Zero, resets when hits ARV
Interrupt generated every iteration.
Set-up of timer/counter module is through memory mapped registers
- Counter/timer clock source selection
- up/down direction
- Prescale value
- Auto-reload value
- Interrupt enable
What is the count register latched to when an external event occurs
The Capture register
What can the input capture be used to measure
The leading (or trailing) edges in external signal
In output compare mode, the counter register value is continuously compared to what?
The Capture/Compare Register (CCR)
Timers with 32-bit timer modules (2)
TIM2
TIM5
Timers with 16-bit timer moduels (6)
TIM1 TIM3 TIM4 TIM9 TIM10 TIM11
What bit timer is the SysTick timer
24-bit downcounter with autoreload
Timers - in Slave mode.
Reset
Register is reinitialized on trigger input
Timers - in Slave mode.
Gated
timer/counter is enabled depending on level of selected input
Timers - in Slave mode.
Triggered
Timer/counter starts in response to event on selected input
What is a Watchdog TImer (WDT)
A hardware timer that automatically generates a system reset if the main program neglects to periodically service it.