Keil Logo

Peripheral Simulation

For STMicroelectronics STM32F101C8 — I2C1 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.

I2C Interface 1 - Communication Dialog

I2C Interface 1 - Communication

I2C Interface 1 - Hardware Dialog

I2C Interface 1 - Hardware

ADC2 Input VTREG
Data Type: float

The ADC2_INx VTREGs set the analog input voltages for simulated A/D converters. The ADC2_INx VTREGs represent the inputs to the analog input pins of the MCU for analog input 0, 1, 2, and so on. ADC2_IN0 sets the input voltage for analog input #0, ADC2_IN1 sets the input voltage for analog input #1, etc. If you have properly configured the analog inputs, the following commands (typed in the debugger's Command Window) input the voltages specified.

ADC2_IN0 = 0.000  /* Analog Input 0 = 0.000 volts */
ADC2_IN1 = 2.500  /* Analog Input 1 = 2.500 volts */
ADC2_IN2 = 4.999  /* Analog Input 2 = 4.999 volts */

You may create a debugger signal function to periodically change the value of the A/D input. The following signal function increases the A/D Channel 1 input voltage by 0.1 volts each second.

signal void ADC2_IN1_sig (void) {
float f;

for (f = 0.0; f < 5.0; f += 0.1)
  {
  swatch (1.0);                  // Delay 1 second
  ADC2_IN1 = f;                  // Set ADC2_IN1 Voltage
  }
}

I2C1 Output VTREG
Data Type: unsigned short

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.