
Parallel Input/Output (I/O)
Port C
MC68HC(7)05L16 — Rev. 4.0
Technical Data
MOTOROLA
Parallel Input/Output (I/O)
81
6.5 Port C
Port C pins share functions with several on-chip peripherals. A pin
function is controlled by the enable bit of each associated peripheral.
Bit 7 and bit 6 of port C are general-purpose I/O pins and IRQ input pins.
The DDRC7 and DDRC6 bits determine whether the pin states or the
data latch states should be read by the CPU. Since IRQ1F or IRQ2F can
be set by either the pins or the data latches, when using IRQs, be sure
to clear the flags by software before enabling the IRQ1E or IRQ2E bits.
When configured for output port, PC6 and PC7 are open drain only.
When VDD output is required, a pullup resistor must be enabled.
The PC5 pin is a general-purpose I/O pin and the direction of the pin is
determined by the DDRC5 bit in the data direction register C (DDRC).
When the event output (EVO) is enabled, the PC5 is configured as an
event output pin and the DDRC5 bit has meaning only for the read of
PC5 bit in the PORTC register; if the DDRC5 is set, the PC5 data latch
is read by the CPU. Otherwise, PC5 pin level (EVO state) is read. When
EVO is disabled, the DDRC5 bit decides the idling state of EVO (if
DDRC5 = 1).
The PC4 and PC3 pins share functions with the timer input pins (EVI and
TCAP). These bits are not affected by the usage of timer input functions
and the directions of pins are always controlled by the DDRC4 and
DDRC3 bits. Also, the DDRC4 and DDRC3 bits determine whether the
pin states or data latch states should be read by the CPU.
NOTE:
Since the TCAP pin is shared with the PC3 I/O pin, changing the state of
the PC3 DDR or data register can cause an unwanted TCAP interrupt.
This can be handled by clearing the ICIE bit before changing the
configuration of PC3 and clearing any pending interrupts before enabling
ICIE.
Since the EVI pin is shared with the PC4 I/O pin, DDRC4 should always
be cleared whenever EVI is used. EVI should not be used when DDRC4
is high.