mc68hc05bs8 Freescale Semiconductor, Inc, mc68hc05bs8 Datasheet - Page 23

no-image

mc68hc05bs8

Manufacturer Part Number
mc68hc05bs8
Description
Mc68hc05 Family Of Low-cost Single-chip Microcontrollers.
Manufacturer
Freescale Semiconductor, Inc
Datasheet
The MC68HC05BS8 has 24 I/O lines, arranged as three 8-bit ports (Port A, B, and C). Each I/O
line is individually programmable as either input or output, under the software control of the Data
Direction registers. Port C also shares with keyboard interrupt and the software supported M-Bus
functions.
To avoid glitches on the output pins, data should be written to the I/O Port Data register before
writing “1”s to the corresponding Data Direction register bits to set the pins to output mode.
3.1
Bidirectional port lines may be programmed as an input or an output under software control. The
direction of the pins is determined by the state of the corresponding bit in the port data direction
register (DDR). Each port has an associated DDR. Any I/O port pin is configured as an output if
its corresponding DDR bit is set to a logic one. A pin is configured as an input if its corresponding
DDR bit is cleared to a logic zero.
At power-on or reset, all DDRs are cleared, configuring all port pins as inputs. The data direction
registers are capable of being written to or read by the MCU. During the programmed output state,
a read of the data register actually reads the value of the output data latch and not the I/O pin. The
operation of the standard port hardware is shown schematically in Figure 3-1.
This is summarized in Table 3-1 which shows the effect of reading from or writing to an I/O pin in
various circumstances.
MC68HC05BS8
Note: R/W is an internal signal.
R/W
Input/Output Programming
0
0
1
1
DDR
0
1
0
1
INPUT/OUTPUT PORTS
The I/O pin is in input mode. Data is written into the output data latch.
Data is written into the output data latch and output to the I/O pin.
The state of the I/O pin is read.
The I/O pin is in an output mode. The output data latch is read.
Table 3-1 I/O Pin Functions
INPUT/OUTPUT PORTS
3
I/O Pin Function
TPG
3

Related parts for mc68hc05bs8