Gpt Settings And Pin Functions - Motorola ColdFire MCF5281 User Manual

Motorola microcontroller user's manual
Table of Contents

Advertisement

Functional Description
To configure a pin for input capture:
1. Clear the pin's IOS bit in GPTIOS.
2. Clear the pin's DDR bit in PORTTnDDR.
3. Write to GPTCTL2 to select the input edge to detect.
PORTTnDDR does not affect the data direction of an output compare pin. The output
compare function overrides the data direction register but does not affect the state of the
data direction register.
To configure a pin for output compare:
1. Set the pin's IOS bit in GPTIOS.
2. Write the output compare value to GPTCn.
3. Clear the pin's DDR bit in PORTTnDDR.
4. Write to the OMn/OLn bits in GPTCTL1 to select the output action.
Table 20-23 shows how various timer settings affect pin functionality.
1
GPTEN DDR
GPTIOS
4
0
0
X
0
1
X
1
0
0 (IC)
1
1
0
1
0
0
1
1
0
1
0
0
1
1
0
1
0
1 (OC)
1
1
1
1
0
1
20-20
Table 20-23. GPT Settings and Pin Functions
EDGx
OMx/
3
OC3Mx
2
[B:A]
OLx
X
X
X
X
X
X
0 (IC
X
0
disable
d)
0
X
0
<> 0
X
0
<> 0
X
0
<> 0
X
1
<> 0
X
1
(3)
5
X
0
0
X
0
0
X
<> 0
0
MCF5282 User's Manual
Pin
Pin
Pin
Data
Driven
Function
Dir.
by
In
Ext.
Digital input
Out
Data reg.
Digital output
In
Ext.
Digital input
Out
Data reg.
Digital output
In
Ext.
IC and
digital input
Out
Data reg.
Digital output
In
Ext.
IC and
digital input
Out
Data reg.
Digital output
In
Ext.
Digital input
Out
Data reg.
Digital output
Out
OC action Output compare Pin readable only if DDR = 0
Comments
GPT disabled by GPTEN = 0
GPT disabled by GPTEN = 0
Input capture disabled by EDGn
setting
Input capture disabled by EDGn
setting
Normal settings for input capture
Input capture of data driven to output
pin by CPU
OC3M setting has no effect because
IOS = 0
OC3M setting has no effect because
IOS = 0; input capture of data driven
to output pin by CPU
Output compare takes place but
does not affect the pin because of
the OMn/OLn setting
Output compare takes place but
does not affect the pin because of
the OMn/OLn setting
MOTOROLA
(5)

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfire mcf5282

Table of Contents