




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















Engr. Zeba Idrees
(^) Many Application require microcontroller (M.C) to operate at different frequency depending on the mode of operation. (^) Each M.C has two types of timing interface (^) One is used to generate system clock to operate M.C at desired frequency. (^) Second interface is based on a timer, which is a peripheral module. (^) Primary use is to generate timing intervals of desire value. (^) Also timer module can be configure to operate either as I/ P or an O/P device.
(^) M.C become complex and provide different options for clocking. (^) Generally an oscillator use to generate clock signal for M.C. (^) 2 Types of oscillator (^) Crystal oscillator (^) High f accuracy and low f variation w.r.t temperature (^) RC oscillator (^) Fast startup and relatively cheaper (^) Poor f accuracy in presence of variation in supply or temperature.
(^) M.C generally have 1 or more built in Oscillator. (^) No need of external unless need to produce a range of frequencies, in that case need external crystal to select particular f. (^) Applications requiring the processor to operate at different f for different operating states PLL based approach is used. (^) Used to multiply the fixed f from oscillator by a configurable factor.
(^) Fig 10. (^) fs=(N1/N2)fi
(^) Fig 10. (^) Registers (^) Run mode clock configuration (RCC) (^) Run mode clock configuration 2 (RCC2)
(^) Comprises of an up (down) counter with an associated counter overflow (underflow) detection capability. (^) Can be enable and disable using a control signal. (^) When enabled, an input clock signal is applied to the counter, which increments (decrement) counter value. (^) The timer size or timer width is the number of bits allocated for its count. (^) In 16 bit timer: (^) Over flow when reach 0xFFFF (^) After over flow is loaded either with 0x0000 or with user specified value from the timer reload register. (^) Also set timer overflow flag (should be clear by user software to check for next time).
(^) If timer is counting down: (^) Over flow when reach 0x (^) After over flow is loaded either with 0xFFFF or with user specified value from the timer reload register. (^) Fig 10.
(^) Equipped with different timer modules. (^) Can be used as independent device or in combination. (^) Different timer modules integrated in TM4C (^) Systick timer (^) GP timer module (^) PWM timer module (^) Watchdog timer module
(^) Cortex-m processor integrate system timer called systick. (^) Based on 24 bit down counter and reloads on counting to zero. (^) Also termed as wrap in zero. (^) Counter current value is cleared by write operation. (^) Referred as clear on write. (^) Can be used for different purpose. (^) To generate timer ticks of specified interval for real time operating system ( RTOS) (^) As a simple counter to measuring time for finish or time elapsed while exe a task (^) Can be configured as high speed alarm timer based on sysclock.
(^) Use of timer to generate periodic interval, this is implemented by trigging an interrupt on each timer overflow (^) A timer can be configured as in put as well as o/p device. (^) There are two possible choice for timer i/p signals (^) One possibility is to use an integral periodic clock signal operating at known frequency as timer i/p 2 nd (^) is to use an external signal either periodic or a periodic but digital as timer i/p. (^) External signal is aperiodic we might be interested in its accumulated count. (^) The use of timer for this purpose is termed as external event counter. (^) Other possibility is external signal is periodic but of known frequency. (^) The timer operating as an i/p capture device can be used to measure this unknown f of the external signal.
(^) It is also possible to measure pulse duration or width when timer is operating as i/p capture device. (^) Summery: when i/p is external signal, following task can be done using one or more timers (^) External event counting (^) Pulse duration measurement (^) Signal frequency measurement
(^) Technic to generate variable width pulses while maintaining a constant f signal. (^) The time period Tp and pulse width Tw are two parameters that must be specified to generate the desire PWM signal Tw <Tp. (^) Duty cycle, d =(Tw/Tp) x 100.
(^) Typical PWM signal for 3 different duty cycle with constant f. (^) Applications of PWM signals (^) Motor speed control (^) Power converters (^) Brightness control for LED (^) Encoded data transmission