Datasheet

C515C
Data Sheet 32 2003-02
Digital I/O Ports
The C515C allows for digital I/O on 49 lines grouped into 6 bidirectional 8-bit ports and
one 1-bit 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 through P7 are performed via their corresponding
special function registers P0 to P7. The port structure of port 5 of the C515C is especially
designed to operate either as a quasi-bidirectional port structure, compatible to the
standard 8051-Family, or as a genuine bidirectional port structure. This port operating
mode can be selected by software (setting or clearing the bit PMOD in the SFR
SYSCON).
The output drivers of port 0 and 2 and the input buffers of port 0 are also used for
accessing external memory. In this application, port 0 outputs the low byte of the external
memory address, time-multiplexed with the byte being written or read. Port 2 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.
Analog Input Ports
Ports 6 is available as input port only and provides two functions. When used as digital
inputs, the corresponding SFR P6 contains the digital value applied to the port 6 lines.
When used for analog inputs the desired analog channel is selected by a three-bit field
in SFR ADCON0 or SFR ADCON1. Of course, it makes no sense to output a value to
these input-only ports by writing to the SFR P6. This will have no effect.
If a digital value is to be read, the voltage levels are to be held within the input voltage
specifications (
V
IL
/V
IH
). Since P6 is not bit-addressable, all input lines of P6 are read at
the same time by byte instructions.
Nevertheless, it is possible to use port 6 simultaneously for analog and digital input.
However, care must be taken that all bits of P6 that have an undetermined value caused
by their analog function are masked.