beautypg.com

Parallel i/o – Maxim Integrated Secure Microcontroller User Manual

Page 99

background image

Secure Microcontroller User’s Guide

99 of 187

12. PARALLEL I/O

The secure microcontroller provides four 8-bit bidirectional ports for general-purpose I/O functions. Each
port pin is bit and byte addressable using four SFRs that control the respective port latch. Each bit has an
associated latch (accessed via SFR), input buffer circuit, and output driver circuit. Ports 0, 2, and 3 also
have alternate functions that can be used in place of general I/O. All of the SFR latches for the parallel
port pins are written with 1’s during a hardware reset.

Figure 12-1

through

Figure 12-4

illustrates

functional circuit diagrams for bits within each of the four I/O ports. Port 1 has no alternate function; it is
always available for parallel I/O functions.

Ports 0 and 2 can serve as a multiplexed Expanded Memory bus for applications needing memory
mapped I/O. In the DS5001/2FP the Ports 0 and 2 can also serve as a slave RPC interface to a host
microprocessor. Port 3 pins each have individual, optional functions described below. Enabling the
optional function by writing a 1 to the associated latch bit in the Port 3 SFR automatically converts the
I/O pin into its alternate function. For example, enabling the serial port automatically converts P3.0 and
P3.1 into the RXD and TXD function. Alternate functions pins and general I/O pins can be enabled
independent of each other. Enabling selected pins to perform their alternate function leaves the other as
bit addressable I/O pins.

PIN

NAME

FUNCTION

P3.7

RD

Expanded Data Memory Read Strobe

P3.6

WR

Expanded Data Memory Write Strobe

P3.5

T1

Timer/Counter 1 Input

P3.4

T0

Timer/Counter 0 Input

P3.3

INT1

External Interrupt 1 Input

P3.2

INT0

External Interrupt 0 Input

P3.1

TXD

Serial Port Transmit Data

P3.0

RXD

Serial Port Receive Data


In many cases it may be desirable to use a combination of pure I/O and alternate function pins on port 3.
For example, a user may decide to use the serial port and INTO pins, leaving 5 pins available for use as
general purpose I/O (assuming P3.6 and P3.7 are not being used to access external memory). SETB and
CLR commands can be used to access the general I/O pins without any effect on the pins being used in
their alternate function. If the MOV command is used to write to port 3, however, software must always
write a logic 1 to the pins that are being used in their alternate function. Failure to do so will disturb their
function, resulting in serial port data corruption or disabling of the alternate function in the case of other
pins.