ARM Technical Support Knowledge Articles

SIMULATING AN OUTPUT CONNECTED TO AN INPUT

Applies to: uVision Debugger

Answer


Information in this article applies to:


QUESTION

Is it possible to "connect" an output pin in the simulator to an input pin?

ANSWER

Yes, you can do this with an access breakpoint. The following 8051 example program assumes that P1.0 is an output connected to P3.0 (the input).

#include <reg51.h>

unsigned char val;

void main (void) {
  while (1) {
    P1 ^= 0x01;  // toggle output pin P1.0
    val = P3;    // read input value from P3
  }
}

The following breakpoint definition copies the value of P1.0 (the output) to P3.0 (the input). This breakpoint is triggered when P1 is changed.

bs write PORT1, 1, "PORT3 = (PORT3 & 0xFE) | (PORT1 & 0x01)"

MORE INFORMATION

SEE ALSO

Article last edited on: 2004-12-17 05:17:02

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