![](http://datasheet.mmic.net.cn/340000/C508_datasheet_16463212/C508_30.png)
C508
Data Sheet
26
2000-08
outputs the high byte of the external memory address when the address is 16 bits wide.
Otherwise, the Port 2 pins continue emitting the P2 SFR contents. In this function, Port 0
is not an open-drain port, but uses a strong internal pullup FET.
Port 4 provides the analog input channels to the A/D converter.
Port Structures
The C508 generally allows digital I/O on 32 lines grouped into 4 bi-directional 8-bit ports
and analog/digital input on one uni-directional 8-bit port. Except for Port 4 which is the
uni-directional input port, each port bit consists of a latch, an output driver and an input
buffer. Read and write accesses to the I/O ports P0-P5 (except P4) are performed via
their corresponding special function registers.
When Port 4 is used as analog input, an analog channel is switched to the A/D converter
through a 3-bit multiplexer, which is controlled by three bits in SFR ADCON. Port 4 lines
may also be used as digital inputs. In this case they are addressed as an input port via
SFR P4. Since Port 4 has no internal latch, the contents of SFR P4 only depends on the
levels applied to the input lines. It makes no sense to output a value to these input-only
port by writing to the SFR P4. This will have no effect.
The parallel I/O ports of the C508 can be grouped into four different types which are
listed in
Table 4
.
Type A and B port pins are standard C501 compatible I/O port lines, which can be used
for digital I/O. Type A port (Port 0) is also designed for accessing external data or
program memory. Type B port lines are located at Port 2, Port 3 and Port 5 to provide
alternate functions for the serial interface, LED drive interface, PWM signals, or are used
as control outputs during external data memory accesses. Type C port (Port 4) provides
the analog input port. Type D port lines can be switched to push-pull drive capability
when they are used as compare outputs of the CAPCOM unit.
Table 4
Type
C508 Port Structure Types
Description
Standard digital I/O ports which can also be used for external address/data bus.
Standard multifunctional digital I/O port lines.
Digital/analog uni-directional input port.
Standard digital I/O with push-pull drive capability.
A
B
C
D