Keil Logo

Peripheral Simulation

For Infineon C167CR-16RM — Port 4 (8-bit I/O)

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 Port 4 Dialog

Parallel Port 4

This dialog displays the SFR and pins of Port 4. This port has several alternate functions but it may be used as an 8-bit general purpose I/O port.

  • P4 represents the P4 SFR. The HEX value and value of each bit is displayed and may be changed from this dialog.
  • DP4 is the port direction SFR for P4. When DP4.x=0, P4.x is an input. When DP4.x=1, P4.x is an output.
  • Pins represents the states of the pins on the simulated MCU. When used as outputs, these have the same value as the P4 SFR. When used as inputs (DP4.x is 0) you may set the level of the input pin to high (1) or low (0).

PORTx VTREG
Data Type: unsigned int

The PORTx VTREGs represent the I/O pins of the simulated MCU for Port 0, Port 1, and so on. You may read PORTx to determine the state of the output pins of that port. For example, in the command window, you may type,

PORT8

to obtain the value corresponding to the set pins of Port 8. You may also change the input values of port pins by changing the value of the VTREG. For example,

PORT7=0x00F0

sets bits 4-7 and clears bits 0-3 and 8-15. You may use the bitwise operators AND(&), OR(|) and XOR(^) to change individual bits of the PORTx VTREGs. For example:

PORT2 |=  0x0001;  /* Set P2.0 Pin */
PORT8 &= ~0x0002;  /* Clr P8.1 Pin */
PORT7 ^=  0x0080;  /* Toggle P7.7 Pin */
Get more information about the
Peripheral Simulation Capabilities
of the µVision Debugger.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.