For Analog Devices ADuC7024 — General Purpose Input/Output Port 0 (6-Bit)
Simulation support for this peripheral or feature is comprised of:
- Dialog boxes which display and allow you to change peripheral configuration.
- VTREGs (Virtual Target Registers) which support I/O with the peripheral.
These simulation capabilities are described below.
GPIO Port 0 Dialog
The GPIO Port 0 Dialog controls the direction of the general
purpose port pins. You may use the following controls to select and
configure the GPIO port settings.
GPIO Configuration & Data Group
GP0DAT (Configuration and Data Register) contains the
Direction, Output and At Reset settings.
Direction bits are checked to configure a pin for output
or reset for input.
- Output checkboxes represent the data bits output.
At Reset checkboxes represent the state of the port pins
after a reset.
Input checkboxes show the value of the data on an input
I/O Pins Group
The I/O Pins section allows you to manually set or clear
individual pins for this port.
GPIO Control Group
GP0CON (Control Register) controls the function of each
pin for this port.
P0.x (Port 0 - Pin 0, 3-7) selects the function to be
assigned to this pin from a drop-down list.
Data Type: unsigned char
The PORTx VTREGs represent the I/O pins of the simulated
MCU for Port 0, Port 1, and so on. PORT0 represents Port 0, PORT1
represents Port 1, etc. You may read PORTx to determine the
state of the output pins of that port. For example, in the command
window you may type,
to obtain value corresponding to the set pins of Port 0. You may
also change the input values of port pins by changing the value of
the VTREG. For example,
sets the upper four port pins of Port 1 to a value of 1 and all
other port pins to a value of 0. You may use the bitwise operators
AND(&), OR(|) and XOR(^) to change individual bits of the PORTx
VTREGs. For example:
PORT1 |= 0x01; /* Set P1.0 Pin */
PORT2 &= ~0x10; /* Clr P2.4 Pin */
PORT0 ^= 0x08; /* Toggle P0.3 Pin */