ARM Technical Support Knowledge Articles

DIFFERENCE BETWEEN SFR AND VTREG

Applies to: uVision Debugger

Answer


Information in this article applies to:


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 uVision Simulator or in a script that runs in the uVision 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 uVision 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

Article last edited on: 2004-06-30 10:56:25

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential