EasyManuals Logo
Home>Texas Instruments>Microcontrollers>Tiva TM4C123GH6PM

Texas Instruments Tiva TM4C123GH6PM User Manual

Texas Instruments Tiva TM4C123GH6PM
352 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #231 background imageLoading...
Page #231 background image
Timer
21 Timer
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
21.1 Introduction
The timer API provides a set of functions for dealing with the timer module. Functions are pro-
vided to configure and control the timer, along with functions to modify timer/counter values, and to
manage interrupt handling for the timer.
The timer module provides two 16-bit timer/counters that can be configured to operate indepen-
dently as timers or event counters, or they can be configured to operate as one 32-bit timer or one
32-bit Real Time Clock (RTC). For the purpose of this API, the two timers provided by the timer are
referred to as TimerA and TimerB.
When configured as either a 32-bit or 16-bit timer, a timer can be set up to run as a one-shot timer
or a continuous timer. If configured as a one-shot timer, when it reaches zero the timer will cease
counting. If configured as a continuous timer, when it reaches zero the timer will continue counting
from a reloaded value. When configured as a 32-bit timer, the timer can also be configured to
operate as an RTC. In that case, the timer expects to be driven by a 32 KHz external clock, which
is divided down to produce 1 second clock ticks.
When in 16-bit mode, the timer can also be configured for event capture or as a Pulse Width
Modulation (PWM) generator. When configured for event capture, the timer acts as a counter. It
can be configured to either count the time between events, or it can count the events themselves.
The type of event being counted can be configured as a positive edge, a negative edge, or both
edges. When a timer is configured as a PWM generator, the input line used to capture events
becomes an output line, and the timer is used to drive an edge-aligned pulse onto that line.
The timer module also provides the ability to control other functional parameters, such as output
inversion, output triggers, and timer behavior during stalls.
Control is also provided over interrupt sources and events. Interrupts can be generated to indicate
that an event has been captured, or that a certain number of events have been captured. Interrupts
can also be generated when the timer has counted down to zero, or when the RTC matches a
certain value.
21.2 Functions
Functions
void ROM_TimerConfigure (uint32_t ui32Base, uint32_t ui32Config)
void ROM_TimerControlEvent (uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Event)
void ROM_TimerControlLevel (uint32_t ui32Base, uint32_t ui32Timer, bool bInvert)
void ROM_TimerControlStall (uint32_t ui32Base, uint32_t ui32Timer, bool bStall)
void ROM_TimerControlTrigger (uint32_t ui32Base, uint32_t ui32Timer, bool bEnable)
void ROM_TimerControlWaitOnTrigger (uint32_t ui32Base, uint32_t ui32Timer, bool bWait)
April 8, 2013 231

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments Tiva TM4C123GH6PM and is the answer not in the manual?

Texas Instruments Tiva TM4C123GH6PM Specifications

General IconGeneral
BrandTexas Instruments
ModelTiva TM4C123GH6PM
CategoryMicrocontrollers
LanguageEnglish

Related product manuals