4.2 Pinout Description
VCC Power supply voltage (4-6V)
GND Ground ( Negative supply pole)
Port 0 (P0.0-P0.7) If configured as outputs, each of these pins can be connected to up to 8 TTL inputs. If configured as inputs, the pins can be used as high-impedance inputs as their potential is not defined relative to ground, i.e. they are floating. If additional (external) memory is used, these pins are used for accessing it. Signal on the ALE pin determines what and when will be transferred to this port.
Port 1 (P1.0-P1.7) If configured as outputs, each of these pins can be connected to up to 4 TTL inputs. When configured as inputs, these pins act as standard TTL inputs, that is, each of them is internally connected to the positive supply voltage via a resistor of relatively high impedance. Power supply voltage provided on these inputs is 5V. Also, the Port 1 pins have alternate functions as shown in the table below:
PORT PIN |
ALTERNATE FUNCTION |
P1.0 |
T2 (Timer 2 input) |
P1.1 |
T2EX (Timer 2 control input) |
P1.4 |
SS (SPI system control input) |
P1.5 |
MOSI (SPI system I/O) |
P1.6 |
MISO (SPI system I/O) |
P1.7 |
SCK (SPI system clock signal) |
Port 2 (P2.0-P2.7) Whether configured as an input or an output, this port acts the same as Port 1. If external memory is used, the high byte of the address (A8-A15) comes out on the Port 2 which is thus used for addressing it.
Port 3 (P3.0-P3.7) Similar to P1, Port 3 pins can be used as general inputs or outputs. They also have additional functions to be explained later in the chapter.
PORT PIN |
ALTERNATE FUNCTION |
P3.0 |
RXD (serial input) |
P3.1 |
TXD (serial output) |
P3.2 |
INT0 (external interrupt 0) |
P3.3 |
INT1 (external interrupt 1) |
P3.4 |
T0 (Timer 0 external input) |
P3.5 |
T1 (Timer 1 external input) |
P3.6 |
WR (External data memory write signal) |
P3.7 |
RD (External data memory read signal) |
RST Logic one (1) on this pin causes the microcontroller to be reset.
ALE/PROG In normal operation, the ALE pin is activated at a constant rate of 1/16 the oscillator frequency and can be used for external clocking and timing purposes. When external memory is used, a signal from this pin is used to latch the low byte of an address (A0-A7) from P0. During the process of writing a program to the microcontroller, this pin also serves as a control input.
PSEN This pin provides a signal used for accessing external program memory (ROM).
EA/VPP When this pin is connected to ground, the microcontroller reads program instructions from external program memory. If internal program memory is used, which is the common case, this pin should be connected to the positive power supply voltage (VCC). During the process of programming internal Flash mamory, this pin is supplied with +12V.
XTAL 1 This is internal oscillator input. It is used for the purpose of synchronizing the operation of the microcontroller with some other circuit or for connecting external oscillator when used.
XTAL 2 This pin is connected to internal oscillator output. Therefore, it is out of use when using external oscillator.