G P I O
3 6
D i g i C o n n e c t W i - M E & D i g i C o n n e c t M E H a r d w a r e R e f e r e n c e
GPIO
General Information
The NS7520 processor supports 16 general purpose I/O (GPIO) lines, some of which are
reserved for specific functions and some of which can be customized. These GPIO lines
fall into three categories:
Those labeled “Reserved” in the following table are reserved for a specific use
and must not be reprogrammed, or the unit might not operate correctly. Often,
these lines are not connected to external interfaces.
Those labeled “Allocated” in the following table are exposed to an external
interface and allocated to a specific use by the software, but can be customized
safely with code modifications.
Those labeled “Available” are exposed to an external interface, not controlled
directly by the software, and can be customized.
Two registers govern the 16 GPIO lines. These registers are named PORTA and PORTC.
Each GPIO pin has four bits which completely describe its behavior, and each register is
responsible for eight GPIO pins. The four bits that describe the GPIO behavior are its mode
(CMODE), its direction (CDIR), its special function (CSF--only applicable to PORTC),
and the data value. The first three bits describe the functionality of the GPIO pin. The
"data" bit provides the current value of the pin when read and allows one to control the
value of an output pin when written.
In order to configure any GPIO pin as a GPIO input, the corresponding bit positions in the
appropriate register must be configured as:
CMODE = 0 CDIR = 0 CSF = 0
In order to configure any GPIO pin as a GPIO output, the corresponding bit positions
in the
appropriate register must be configured as
:
CMODE = 0 CDIR = 1 CSF = 0
Since each register controls 8 GPIO lines, it is safest to read the full 32 bit register, modify
the bits corresponding to the GPIO line of interest, and then write the full 32 bits back. In
this way, the behavior of the other GPIO lines will be preserved. For more information
regarding the format and programming of the GPIO registers, see the NS7520 Hardware
Reference.
DC_ME-HWR.book Page 36 Thursday, July 1, 2004 11:12 AM
Summary of Contents for Digi Conntect ME
Page 1: ...TM TM 90000631_A DC_ME HWR book Page 1 Thursday July 1 2004 11 12 AM...
Page 2: ...DC_ME HWR book Page 2 Thursday July 1 2004 11 12 AM...
Page 4: ...DC_ME HWR book Page 4 Thursday July 1 2004 11 12 AM...
Page 63: ...DC_ME HWR book Page 63 Thursday July 1 2004 11 12 AM...
Page 64: ...DC_ME HWR book Page 64 Thursday July 1 2004 11 12 AM...