Peripheral Simulation
For Silicon Laboratories, Inc. C8051F352 — A/D Converter (8x16-bit)
Simulation support for this peripheral or feature is comprised of:
- VTREGs (Virtual Target Registers) which support I/O with the peripheral.
These simulation capabilities are described below.
AINx VTREG
Data Type: float
The AINx VTREGs set the analog input voltages for simulated A/D
converters. The AINx VTREGs represent the inputs to the analog input
pins of the MCU for analog input 0, 1, 2, and so on. AIN0 sets the
input voltage for analog input #0, AIN1 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.
AIN0 = 0.000 /* Analog Input 0 = 0.000 volts */
AIN1 = 2.500 /* Analog Input 1 = 2.500 volts */
AIN2 = 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 AIN1_sig (void) {
float f;
for (f = 0.0; f < 5.0; f += 0.1)
{
swatch (1.0); // Delay 1 second
AIN1 = f; // Set AIN1 Voltage
}
}
DAC0 VTREG
Data Type: float
The DAC0OUT VTREG represents the analog output voltage for
simulated D/A converter. The DAC0OUT VTREG represents the outputs
from the DAC 0 output pin of the MCU.
TEMP VTREG
Data Type: float
TEMP contains the on-chip temperature sensor in degrees
(centigrade). The on-chip temp sensor measures temperature of the
chip die. TEMP is used as the VTEMP output voltage to the PGA. The
following command (typed in the debugger's Command Window) sets the
die temperature.
TEMP = 30.5
VREF0 VTREG
Data Type: float
VREF0 contains the voltage at the ADC voltage reference input
pin.
VREFD VTREG
Data Type: float
VREFD is the D/A Converter voltage reference input.
VTEMP VTREG
Data Type: float
VTEMP is the the voltage input to the PGA when the Temperature
Sensor is selected.