AN1740 Freescale Semiconductor / Motorola, AN1740 Datasheet - Page 22

no-image

AN1740

Manufacturer Part Number
AN1740
Description
Applications Using the Analog Subsystem on MC68HC05JJ/JP Series Microcontrollers
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
Shared Functions
on PB4
22
Comparator 1 output
Port B data register
driving function
Desired output
output compare
16-bit timer
on PB4
data bit state
in testing the state of the comparator following the initiation of a static
flag or simply to check that the comparator state is steady. Since there
is no latching of the outputs, the user should be cautious about using the
CMP1 or CMP2 bits when inputs to the comparator are changing at
frequencies greater than the rate at which the software is sampling the
ASR.
One pin of port B, PB4, can be shared with the output of comparator 1,
the output compare of the 16-bit timer, and the PB4 port I/O buffer itself.
All of these functions are OR’ed together to drive the pin when it is
configured as an output by setting the DDRB4 bit in the port B data
direction register at location $0005.
When the PB4 pin is configured as an output, the pulldown device is
automatically disabled and the output compare and port B data register
are OR’ed together. The output of comparator 1 can be added to the OR
function if the COE1 bit is set and the additional analog options are
selected by the OPT mask option.
Once the OR function is active, the user must disable the functions that
are not wanted by clearing the correct bits as given in
data bit,
Port B
PB4
PB4
Freescale Semiconductor, Inc.
0
0
Table 3. Logical OR Function on PB4
For More Information On This Product,
Go to: www.freescale.com
16-bit timer
level, OLVL
Timer OLVL
compare
output
state
0
0
Register bit requirements
MOR or ROM
OPT mask
option,
0
1
0
1
1
Comparator 1
enable, COE1
output
X
0
1
X
0
1
1
Table
Comparator 1
output, CMP1
CMP state
MOTOROLA
3.
X
X
X
X
0
0
AN1740

Related parts for AN1740