Keil Logo

µVISION DEBUGGER: SIMULATING AN OUTPUT CONNECTED TO AN INPUT


Information in this article applies to:

  • C166 Version 4 and Later
  • C251 Version 3 and Later
  • C51 Version 6 and Later
  • µVision Version 2 and Later

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

  • µVision Getting Started User's Guide

SEE ALSO

Last Reviewed: Friday, December 17, 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.