English
Language : 

MC68HC908LB8_05 Datasheet, PDF (138/234 Pages) Freescale Semiconductor, Inc – M68HC08 Microcontrollers
Input/Output (I/O) Ports
Table 14-2. Port B Pin Functions
DDRB PTB
Bit
Bit
I/O Pin
Mode
Accesses
to DDRB
Read/Write
0
X(1)
Input, Hi-Z(2)
DDRB7–DDRB0
1
X
Output
DDRB7–DDRB0
NOTES:
1. X = Don’t care
2. Hi-Z = High impedance
3. Writing affects data register, but does not affect input.
Accesses
to PTB
Read
Write
Pin
PTB7–PTB0(3)
PTB7–PTB0
PTB7–PTB0
14.4 Port C
Port C is a 3-bit, general-purpose bidirectional I/O port. Port C shares its pins with the oscillator (OSC)
module, high resolution PWM (HRP), and the external interrupt module (IRQ). See Table 1-1 . Pin
Functions for a description of the priority of these functions. Port C also has software configurable pullup
devices if configured as an input port.
NOTE
PTC2 is input only.
When the IRQ function is enabled in the configuration register 2 (CONFIG2), bit 2 of the port C data
register (PTC) will always read 0. In this case, the BIH and BIL instructions can be used to read the logic
level on the PTC2 pin. When the IRQ function is disabled, these instructions will behave as if the PTC2
pin is a logic 1. However, reading bit 2 of PTC will read the actual logic level on the pin.
14.4.1 Port C Data Register
The port C data register (PTC) contains a data latch for each of the seven port C pins.
Address: $0002
Bit 7
6
5
4
3
2
1
Bit 0
Read:
0
0
0
0
0
PTC2
PTC1
PTC0
Write:
Reset:
0
0
0
0
0
0
0
0
= Unimplemented
Figure 14-9. Port C Data Register (PTC)
PTC2–PTC0 — Port C Data Bits
These read/write bits are software-programmable. Data direction of each port C pin is under the control
of the corresponding bit in data direction register C. Reset has no effect on port C data.
14.4.2 Data Direction Register C
Data direction register C (DDRC) determines whether each port C pin is an input or an output. Writing a
1 to a DDRC bit enables the output buffer for the corresponding port C pin; a 0 disables the output buffer.
MC68HC908LB8 Data Sheet, Rev. 1
138
Freescale Semiconductor