English
Language : 

MC68HC705JJ7 Datasheet, PDF (61/164 Pages) Freescale Semiconductor, Inc – Microcontrollers
Port B
7.3.6 PB4/AN4/TCMP/CMP1 Logic
The PB4/AN4/TCMP/CMP1 pin can be used as a simple I/O port pin, be controlled by the OLVL bit from
the output compare function of the 16-bit programmable timer, or be controlled directly by the output of
comparator 1 as shown in Figure 7-9. The PB4 data, the programmable timer OLVL bit, and the output of
comparator 1 are all logically ORed together to drive the pin. Also, the analog subsystem input channel 4
multiplexer is connected directly to this pin. The operations of PB4 pin are summarized in Table 7-2.
READ $0005
WRITE $0005
DATA DIRECTION
REGISTER B
R
BIT DDRB4
WRITE $0001
PORT BDATA
REGISTER
BIT PB4
OLVL
(TIMER OUTPUT COMPARE)
CMP1
(COMPARATOR 1 OUT)
READ $0001
WRITE $0011
RESET
PULLDOWN
REGISTER B
R
BIT PDIB4
ANALOG SUBSYSTEM
INPUT AN4 AND
TIMER OUTPUT COMPARE
PB4
AN4
TCMP
HIGH SINK/
SOURCE CURRENT
CAPABILITY
MASK OPTION REG. ($1FF1)
PULLDOWN
DEVICE
COP REGISTER ($1FF0)
Figure 7-9. PB4/AN4/TCMP/CMP1 Pin I/O Circuit
When using the PB4/AN4/TCMP/CMP1 pin, these interactions must be noted:
1. If the OLVL timer output compare function is the required output function, then the DDRB4 bit must
be set, the PB4 data bit must be cleared, and the OPT bit in the COPR must be cleared. The
PB4/AN4/TCMP/CMP1 pin becomes an output which follows the state of the OLVL bit. The
pulldown device will be disabled in this case. The analog subsystem would not normally use this
pin as an analog input in this case.
2. If the PB4 data bit is the required output function, then the DDRB4 bit must be set, the OLVL bit in
the TCR must be cleared, and the OPT bit in the COPR must be cleared. The pulldown device will
be disabled in this case. The analog subsystem would not normally use this pin as an analog input
in this case.
3. If the comparator 1 output is the desired output function, then the PB4 data bit must be cleared, the
DDRB4 bit must be set, the OLVL bit in the TCR must be cleared, and the OPT bit in the COPR
must be set. The PB4/AN4/TCMP/CMP1 pin becomes an output which follows the state of the
OLVL bit. The pulldown device will be disabled in this case. The analog subsystem would not
normally use this pin as an analog input in this case.
MC68HC705JJ7 • MC68HC705JP7 Advance Information Data Sheet, Rev. 4.1
Freescale Semiconductor
61