Peripheral Simulation
For Atmel AT91M42800A — Parallel I/O Controller B (24 I/O Lines)
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.
Parallel I/O Controller B Dialog
The PIO Dialog box allows you to configure the parallel I/O port
using checkboxes. Controls in this dialog are presented in groups
which are described below.
PIO/Input Filter/Output/Data/Multi Driver
-
The PIOB_PSR check boxes indicate which pins are
controlled by the associated peripheral (0-unchecked) and which
pins are controlled by the PIO (1-checked). Changing the values of
these check boxes changed the values of the PIOB_PER and
PIOB_PDR peripheral registers.
-
The PIOB_IFSR check boxes indicate that glitch filtering
is enabled (1-checked) for the corresponding pin. Changing these
check boxes writes to the PIOB_IFER or PIOB_IFDR
peripheral registers.
-
The PIOB_OSR check boxes indicate the output status
(0-unchecked for input, 1-checked for output) of the corresponding
pin. Changing these check boxes writes to the PIOB_OER or
PIOB_ODR peripheral registers.
-
The PIOB_ODSR check boxes indicate the output value for
each port pin. Changing these check boxes writes to the
PIOB_SODR or PIOB_CODR peripheral registers.
-
The PIOB_MDSR check boxes indicate whether each port pin
is open drain (1-checked) or not (0-unchecked). Changing these
check boxes writes to the PIOB_MDER or PIOB_MDDR
peripheral registers.
Pin Data Status
-
The PIOB_PDSR check boxes indicate the pin data status
of the pins on the simulated MCU.
I/O Pins
-
The Pins check boxes indicate the states of the pins on
the simulated MCU. When used as outputs, these have the same value
as the PIOB_ODSR check boxes. When used as inputs you may
set the level of the input pin to high (1) or low (0).
Interrupt Mask & Status
-
The PIOB_IMR check boxes indicate the interrupts enabled
for each corresponding pin. Changing these check boxes writes to
the PIOB_IER or PIOB_IDR peripheral registers.
-
The PIOB_ISR check boxes allow you to view the interrupt
status registers for the PIOA pins.
PORTx VTREG
Data Type: unsigned long
The PORTx VTREGs represent the I/O pins of the simulated
MCU for Port A, Port B, and so on. PORTA represents Port A, PORTB
represents Port B, 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,
PORTA
to obtain value corresponding to the set pins of Port A. You may
also change the input values of port pins by changing the value of
the VTREG. For example,
PORTA=0x000000F0
sets the upper four port pins of Port A 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:
PORTA |= 0x00000001; /* Set PA0 Pin */
PORTB &= ~0x00000200; /* Clr PB9 Pin */
PORTA ^= 0x00800000; /* Toggle PA23 Pin */