µVision4 User's Guide

Technical Support

On-Line Manuals

µVision4 User's Guide

About µVision User Interface Creating Applications Utilities Debugging Using the Debugger Simulation Start Debugging Application Program Execution Debug Windows and Dialogs Breakpoints Window Call Stack and Locals Window Code Coverage Command Window Disassembly Window Event Viewer Execution Profiler Instruction Trace Window Logic Analyzer Setup Setup in Detail Restrictions Using the Logic Analyzer Memory Map Memory Window Performance Analyzer Registers Window Serial Window Symbols Window System Viewer Adding System Viewer Windows Toolbox Trace Data Window Trace Navigation Watch Window Expressions Constants System Variables Peripheral Variables I/O Ports Serial Ports Program Variables (Symbols) Fully Qualified Symbols Non-Qualified Symbols Literal Symbols Using Symbols Line Numbers Bit Addresses Type Specifications Operators Memory Type Specifiers Differences Between µVision4 and C Expression Examples Tips and Tricks Review Peripherals and CPU Configuration Simulate I/O Ports Simulate Interrupts and Clock Inputs Simulate external I/O Devices Assign Serial I/O to a PC COM Port Check Illegal Memory Access Command Input from File Preset I/O Ports or Memory Contents Write Debug Output to a File Keyboard Shortcuts TPIU Initialization after RESET (Cortex-M) Debug Commands Debug Functions Simulation Flash Programming Dialogs Example Programs Command Line Appendix

Peripheral Variables

µVision4 automatically defines a number of symbols depending on the CPU you have selected for your project. There are two types of symbols that are defined: Peripheral Registers (or special function registers, SFRs) and Virtual Simulation Registers (VTREGs). Debug Functions that may be used to automate input to peripherals are provided under Simulation Script Templates.

See also

Peripheral Registers

µVision4 defines symbols for the peripheral registers. The peripheral register symbols available depend on the microcontroller you have selected. The peripheral register symbols and have an associated address and may be used in expressions.

Virtual Simulation Registers (VTREGs)

Virtual Simulation registers, or VTREGs, let you use the CPU's simulated pins for input and output. VTREGs are not public symbols nor do they reside in a memory space of the CPU. They may be used in expressions, but their values and utilization are CPU dependent. VTREGs provide a way to specify signals coming into the CPU from a simulated piece of hardware. You can list these symbols with the DIR VTREG command.

The following table describes the VTREG symbols. The VTREG symbols that are actually available depend on the selected CPU.

VTREGDescription
ADxAn analog input pin on the chip which are typically A/D converter inputs. Your target program may read values you write to ADx VTREGs.
DAxAn analog output pin on the chip. This values typically reflect the output of a D/A converter.
xxVREFInput for voltage reference pins.
PORTxA group of I/O pins for a port on the chip. For example, PORTA refers to all pins of PORTA. These registers allow you to simulate port I/O.
SxINThe input buffer of serial interface x. You may write 8-bit or 9-bit values to SxIN. These are read by your target program. You may read SxIN to determine when the input buffer is ready for another character. The value 0xFFFF signals that the previous value is completely processed and a new value may be written.
SxOUTThe output buffer of serial interface x. µVision4 copies 8-bit or 9-bit values (as programmed) to the SxOUT VTREG.
SxTIMEDefines the baudrate timing of the serial interface x. When SxTIME is 1, µVision4 simulates the timing of the serial interface using the programmed baudrate. When SxTIME is 0 (the default value), the programmed baudrate timing is ignored and serial transmission time is instantaneous.
CLOCKThe real clock frequency of the simulated CPU.
XTALThe crystal frequency of the simulated CPU as defined in the Options – Target dialog.

Notes

  • You may use the VTREGs to simulate external input and output including interfacing to internal peripherals like interrupts and timers. For example, if you toggle bit 2 of PORT3 (on the 8051 drivers), the CPU driver simulates external interrupt 0.