Keil Logo

Peripheral Simulation

For NXP (founded by Philips) P89LPC9301 — I²C Interface

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.

I²C Interface Communication Dialog

I²C Interface Communication

The I²C Communication Dialog allows you to view the data sent or received on the I²C bus.

I²C Message Generator Group

  • Address contains address of the sending or receiving device.
  • Direction selects the direction of the message to be sent or received.
  • Bytes is the length of the last message in bytes.
  • Data is the message data sent or received.
  • Generate starts message transmission.
  • Stop suspends I²C bus communication.

To clear the message display, double-click anywhere in the message display area.

I²C Interface Hardware Dialog

I²C Interface Hardware

The I²C Hardware Interface dialog displays all configuration options for the on-chip I²C controller. You may interactively alter and view these options using the dialog controls.

I2C_CLK VTREG
Data Type: unsigned long

The I2C_CLK VTREG specifies the clock frequency (in Hz) to use in SLAVE mode. For example:

I2C_CLK = 100000

specifies a clock frequency of 100KHz.

I2C_IN VTREG
Data Type: unsigned int

The I2C_IN VTREG contains data sent from an I²C peripheral to the simulated MCU. The following values may be written to this register:

  • 0x0000-0x00FF: An address or data byte transfer.
  • 0x0100: START byte. This initiates a SLAVE transmit or receive. The next byte sent is the address.
  • 0xFF00: ACK.
  • 0xFF01: NACK.
  • 0xFFFF: IDLE or STOP condition.

I2C_OUT VTREG
Data Type: unsigned int

The I2C_OUT VTREG contains data sent from the simulated MCU to the I²C peripheral. The following values are possible:

  • 0x0000-0x00FF: An address or data byte transfer.
  • 0x0100: START byte. This initiates a MASTER transmit or receive. The next byte sent is the address.
  • 0xFF00: ACK.
  • 0xFF01: NACK.
  • 0xFFFF: IDLE or STOP condition.
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.