Help needed with a Proteus based project

Thread Starter

dameanestdude

Joined Oct 17, 2015
1
I have been trying to simulate a circuit in which the microcontroller will demultiplex the data from Rx and Tx line and continuously send 'YES' and 'NO' to different Virtual Terminals connected to it respectively. Now, the input of one terminal is tapped and sent to a RS232 port via a MAX233 IC. The tapped signal is sent to the COM1 of the system.

A virtual bridge is created between COM1 and COM2 using HDD Free Virtual Serial Port software so that the data sent over the COM1 shall be made available at COM2. The COM2 is again directly connected to another Virtual Terminal with proper configuration.

Now the problem is, the received data on the Virtual Terminal connected at COM2 is suppose to show either 'YES' or 'NO' as shown in any one of the virtual terminal from where the data has been tapped. But it shows some other characters being received on the Virtual Terminal. I want the response of the third virtual terminal to be either a 'YES' or 'NO' being displayed continuously as shown in other Virtual Terminals.

I am uploading the circuit screenshot of Proteus. I am using Proteus 8.1

The P1 port is at COM1 and P2 is at COM2.
All the devices are operating at 9600 baud rate with no pairity and one stop bit and 8 bit communication data.

The microcontroller is coded with the following program:

#include <reg51.h>
#include <stdio.h>

sbit mbit1=P0^0;
sbit mbit2=P0^1;
sbit mbit3=P0^2;
sbit mbit4=P0^3;

void SerTx(unsigned char);
void main(void)
{ unsigned char y;
unsigned int k;
mbit1=1;
mbit2=1;
mbit3=0;
mbit4=0;

k=1;

while(1)
{ mbit1=~mbit1;
mbit2=~mbit2;
mbit3=~mbit3;
mbit4=~mbit4;

TMOD=0x20; //use Timer 1, mode 2
TH1=0xFD; //9600 baud rate
SCON=0x50;
TR1=1; //start timer

k=~k;

if (k==1)
{ SerTx(' ');
SerTx('Y');
SerTx('E');
SerTx('S');
SerTx(' ');
}
else
{ SerTx(' ');
SerTx('N');
SerTx('O');
SerTx(' ');
}
}}


void SerTx(unsigned char x)
{
SBUF=x; //place value in buffer
while (TI==0); //wait until transmitted
TI=0;
}



If possible then please help!
 

Attachments

Top