Keil Logo

µVISION DEBUGGER: DIFFERENCE BETWEEN SFR AND VTREG


Information in this article applies to:

  • µVision Version 2.30

QUESTION

I don't understand the difference between SFRs and VTREGs.

ANSWER

An SFR is a Special Function Register that is an integral part of the chip you use. The SFR may be programmed to configure the chip or an on-chip peripheral. The embedded programs you write will certainly use some SFRs.

A VTREG is a Virtual Target REGister. This register is NOT directly affected by or accessible to your embedded program. A VTREG is a register that is available only in the simulator. It allows you to change the state or a pin on the simulated device. You may only change a VTREG in the Command Window of the µVision Simulator or in a script that runs in the µVision Simulator.

Your target program may use I/O Port 1 to read the value of some switches. To do that, it must read the P1 SFR.

When you test your program with the µVision Simulator, you may want to set or clear some of the "simulated switches" on Port 1. To do that, you need to change the state (or input level) on the Port 1 input pins. That's what VTREGs allow you to do. The PORT1 VTREG is the value of the pins of Port 1. If you set the PORT1 VTREG to a value of 0xAA (by typing PORT1=0xAA in the Command Window), your target program will read 0xAA from the P1 SFR.

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Wednesday, June 30, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.