JK
microsystems
µFlashTCP-EP
User’s Manual
6
386Ex Port 3
bits 0-5, I/O Address F870 and F872 hex
Port 3 bits 0,1,2 and 5 are available on J6, bits 3 and 4 are available on J5. The data on Port 3
can be read from I/O address F870 hex. The pins default to inputs. Each bit of Port 3 can be
individually configured as an input or output. To configure a bit as an output, write a zero to that
bit position in I/O address F874 hex. To output data on Port 3, write the data to I/O address F872
hex. When used as inputs, these pins can also be configured to generate processor interrupts.
P3PIN:
F870h, Port Pin Status Register (read only), bits 0-5
P3LTC:
F872h, Port Latch Register, bits 0-5
P3DIR:
F874h, Port Direction Register, bits 0-5, 0 for output, 1 for input or open
drain output.
P3CFG:
F824h, Port Configuration Register, bits 0-5 low, route P3.0-P3.5 to chip
pins (BIOS Default)
Be careful to change only the required bits when working with the I/O ports. Pins on both ports
are used to control other on-board functions that can be reprogrammed or disabled through these
configuration registers. See the Intel documentation for more information on configuring these
ports.
REM LED
TheµFlashTCP-EP is equipped with an LED that can be controlled by user software. This LED is
tied to Port 3 bit 0. Writing a one to this bit will turn the LED on, a zero will turn it off. This port
must be explicitly programmed as an output. See the section on Port 3 for I/O locations and
programming of this port.
Programming the Ports
The I/O ports are mapped into the 386Ex I/O space. Using the ports requires the use of functions
unique to the x86 family of processors. Creating a pointer to the location may seem logical, but
that reference would be in memory space, not I/O space. Borland C functions
inport(
port)
and
outport(
port,value)
are 16 bit (word) instructions,
inportb(
port)
and
outportb(
port,value)
are 8 bit (byte) instructions. These functions are part of the
dos.h
header file. Similar functions (and header files) are available for other C compilers and
languages. The following code illustrates the use of
inportb()
and
outportb()
.
unsigned char port;
port = inportb(PORT_DIR);
/* get value of dir. reg */
port |= PORT_DIR_MASK;
/* set dir. bit for input */
outportb(PORT_DIR, port);
/* write value to dir. reg */
printf("PORT: %X\n", (int)inportb(PORT));
/* read & print port value */
Asynchronous Serial (COM) Ports
The µFlashTCP-EP has 2 serial ports, COM1 and COM2. Both ports are internal to the 386Ex
and are compatible with the UARTs on a PC. The maximum data rate is 115k Baud.
Hardware
Summary of Contents for 89-0040
Page 1: ...µFlashTCP EP User s Manual ...
Page 2: ......