| ||||||||
Technical Support Support Resources Product Information | µVISION DEBUGGER: HOW TO CONNECT TWO PORT PINSInformation in this article applies to:
QUESTIONI need to simulate a connection between two port pins. Is this possible to do in the µVision simulator? ANSWERYes. You must create a signal function that copies the output port pin to the input port pin. In general, the steps to do this are:
The following example connects the Output Pin (PORT1.7) to the Input Pin (PORT2.1). The application must configure P1.7 as an output and P2.1 as an input:
/* define port_loopback function */
signal void port_loopback (void) {
printf("loopback signal function is started\n");
while (1) {
wwatch (PORT1); /* wait for PORT1 (VTR) access */
if (PORT1 & 0x80) { /* set PORT2.1 depending on PORT1.7 */
PORT2 |= 0x02;
} else {
PORT2 &= ~0x02;
}
}
}
/* start port_loopback function */
port_loopback()
SEE ALSO
Last Reviewed: Wednesday, October 12, 2005 | |||||||
| ||||||||