Академический Документы
Профессиональный Документы
Культура Документы
CERTIFICATE
Date:
Place: Bangalore.
CONTENTS
SYNOPSIS
INTRODUCTION
NETWORKING GOALS
ABOUT HARDWARE
ABOUT SOFTWARE
CODE
OUTPUT
FEATURES
ADVANTAGES
CONCLUSION
SYNOPSIS
INTRODUCTION
There is always a need to transfer or share information from one computer to
other. This is done in two ways.
Firstly, the data is transferred to a portable storage medium like floppies, CD‟s
etc and then copied to a target system.
Secondly, both the system are linked through a cable and data is transferred
either in serial or parallel mode.
The prototype model developed in this project the data from one pc to other pc
without any cable connection between them.
The term Communication refers to sending, receiving and processing of
information by electronic means. Communication started with Wire Telegraphy in the
1840s, developing with telephony some decades later and radio at the beginning of
this century. Communication subsequently became even more widely used and
refined through the invention and use of transistors, integrated circuits and other
semiconductor devices. Thus a communication System has tree basic components.
1. Transmitter
A transmitter is equipment, which converts a physical message into an
electrical message
2. Receiver
A receiver on the other hand is equipment, which converts the
electrical signal back to the physical signal.
3. Channel
The electrical signal from transmitter is conveyed to file receiver through
the channel.
This project basically deals with communication between Computers i.e.
transferring data between two computers using infrared beam.
The computer networks, in which the transmission media used is cables, wires
or optical fibers, comes in the category of solid transmission line computer network.
The attenuation using solid transmission line is more than that of wireless
transmission. The systems become expensive due to large number of repeaters for
large distances.
The alternative, wireless communication, is cheaper and more efficient as the
media is cost free. The new tech communication systems are adopting this technology
due to its very advantages. The bandwidth available is infinite and thus giving room
for a lot of channels to frequency multiplexed. Less number of repeaters are required
than that of wire communication thus reducing the maintenance cost. Wireless LANs
are easy to install as compared to wired networks. On contrary, they require complex
electronics circuitry and antennas. They have the capacity of 1-2 Mbps, which is
much slower than wired LAN. The error rates are often much higher.
Parallel Transmission:
In parallel data transmission each bit of message has its own path and the total
message is transmitted at the same time.
This means that an n-bit message must be transmitted through n separate
conductor paths.
Parallel transmission is faster but requires many wires. It is used for short
distances and where speed is important, if a system has n parallel transmission lines
then it will more than n times faster than that of serial transfer.
For example in computers, parallel data transfer scheme is used for fast
processing. The deciding feature of speed of any microprocessor is number of data
lines in it and the clock frequency. The data lines are actually parallel conductor‟s
paths, which makes the parallel communication channel in computer architecture.
Serial Transmission:
In serial data transmission each bit in message is sent in sequence one at a time.
This method requires use of one pair of conductors or one conductor and a common
ground.
Serial transmission is slower but is less expensive since if requires only one pair of
conductors.
For example, all Public Telephone Networks are used for serial transmission of data
as the transmission path length is very from few meters to many kilometers. All
computer networks use serial transmission technique as it requires less out system
space and is cheap.
Although this makes the speed slower but the advantages out weights the
disadvantages. In account of load offered by any network, serial transmission is
capable of handling the load with bearable failures and sufficient efficiency.
RS–232 SPECIFICATIONS
RS–232 is a “complete” standard. This means that the standard sets out to
ensure compatibility between the host and peripheral systems by specifying
1) Common voltage and signal levels,
2) Common pin wiring configurations, and
3) A minimal amount of control information between the host and peripheral systems.
NETWORKING GOALS.
1. RESOURCE SHARING:
Computer network provides shared access to resources (program or data) to
everyone on the network.
2. HIGHLY RELIALIBILITY:
A second goal is to provide high reliability by having alternative source of
supply. For example, files could be stored on two or more machines on the
network. Even if one machine fails due to hardware problem, the files can be
retrieved from other machines and work can progress.
3. COMMUNICATION MEDIUM:
A computer network provides a powerful communication medium among
widely separated people.
COMPONENT DESCRIPTION
The component as an interfacing circuit facilitating the convert the electrical
signals in to infrared radiation with modulating unit. Detailed description of the
interfacing unit is presented below based on the interfacing, circuit diagram shown in
Figure 2.
The interfacing unit consists of following main parts:
1. 9 pin „D‟ connector.
2. Voltage level converter[IC MAX232]
3. Modulator and transmitter [555 timer in Astable Mode]
4. Receiver [Infrared RXR Module]
WORKING OF HARDWARE :
Transmitter:
Data singles transmitted through pin 3 of 9 pin „D‟ connector of RS 232 COM
1 port are sent to pin 8 of MAX 232 and it converts these EIA( Electronics Ind ustry
Association) RS232 compatible levels of 9 volts to 0/5 TTL levels as given in table 1.
The output pin of MAX 232 TC (pin no. 9) drives the BC 547 npn transistor and
powers the base of transistor. Now, depending on the input at pin 8 of IC MAX232,
the transistor goes in active region or in cutoff. Let us take this one by one.
1. With input at pin 8 is +9v:
The output at pin 9 of MAX232 will be 0v and thus the transistor T1 will be in
cutoff. This supply voltage (+5v) will thus appear on collector of trans istor T1 and
the 555 timer will reset as collector is connected to pin 4 of 555 timer (reset pin). This
output thus goes to logic 1 at pin 3 of 555 timer and IR LEDs will glow.
2. With input at pin 8 is -9v:
The output in this case on pin 9 of MAX232 will be +5 volts thus driving the
transistor T1 in active region. The voltage at pin 4 of 555 timer will goes to zero and
output at pin 3 of 555 timer goes low thus the LEDs will not glow. The electrical
pulses send by the COM port are now converted into corresponding modulated pulses
of IR light.
The a stable multivibrator is set to generate square wave of 38 kHz as the IR
module used in the circuit is tuned to 38 kHz. The range of 38kHz is widely used in
practical purposes as most Television remote controls operates on this frequency thus
providing extra tool for testing.
Receiver:
A visible LED 1 at pin 7 of Max 232 IC indicates that the signals are being
received. Pin is also connected to pin2 (receiving pin) of 9-pin(or pin 3 of 25 pin) „D‟
connector used for the serial port in the PC so that the data may be read. The optical
signals received by the IR Module are in fact converted to the electrical pulses and
both PCs „think‟ that there is a null modem cable connected between them in some
PCs the serial port is terminated it to a 9 pin „D‟ connector and in some others in to a
25 pin „D‟ connector.
The module used works in active low and thus when receives TR radiation
gives output low. With low logic at base of transistor T2 the emitter of it will be at
low voltage level voltage and then the received low voltage signal is converted into
+9 voltage level by IC232.
When there is no IR radiation on the module it gives high output. With high
logic at base of transistor T2 the emitter of it will be at high voltage level and then the
received high voltage signal is converted into -9 voltage level by IC232.
The port base address and IR’s for com ports are as follows:
Name Address IR Int (Hex)
COM1 3F8 4 0C
COM2 2F8 3 0B
COM3 3E8 4 0C
COM4 2E8 3 0B
We use inport ( ) and outport ( ) instructions to read and write to the registers
used for serial communication. Various registers with their addresses (related to their
port base addresses) are shown in table II .Though there are only eight addresses , we
are able to control twelve registers by using divisor latch –enable bit (DLAB) , i.e.,
bit 7 of the line control register. Bit functions of the line control register are shown in
TableIII.
UART settings
As the computer works with data in parallel form, we need the serial
transmission converted back to parallel format so that data could be used .This can be
done using universal asynchronous receiver transmitter (UART) chip.
In order to use the UART, we first need to make certain register settings. The
sequential steps for polling method are given below:
1. Stop interrupts generation on the UART, so that the UART doesn‟t interrupt the
initialization.
2. Now the interrupt vector is set.
3. The next step is to set the speed at which the communication takes place. This is
done by setting bit 7 (DLAB) of the LCR (refer TableIII) to logic 1, so as to have
an access to divisor latch high and low bytes. Some common baud rates and the
corresponding hex values we used to set the high & low bytes are shown in table
iv .(Baud rates are based on the assumption that the UART utilizes a 1.832 MHz
crystal , which is divided by 16 inside the UART to obtain basic baud rate of
115,200 bits/sec.)
4. Then we set the divisor latch -low byte in the registers as per the address shown in
TableII.
5. The next step is to reset /turn off the divisor latch access bit (DLAB) and set the
word length and parity in the LCR .Here we‟ve selected the word length as 8 bits,
no parity, and one stop bit. This is done by moving 0x03 to the line control
register .As this will also turn off the LAB, we can access the interrupt enable
register and receiver and transmitter buffers.
6. Now the FIFO buffers are turned „on‟ and cleared.
7. DTR, RTS, and OUT 2 are made high in modem control register.
COMPUTER A COMPUTER B
PIN SIG. SIG. PIN
3 TD RD 2
2 RD TD 3
5 SG SG 5
4 DTR DTR 4
6 DSR DSR 6
1 CD CD 1
7 RTS RTS 7
8 CTS CTS 8
9 RI RI 9
TABLE I
D-Type 9-Pin Connector Details
D-Type 9-Pin No. Abbreviation Full Name
Pin3 TD Transmit data
Pin2 RD Receive data
Pin7 RTS Request to send
Pin8 CTS Clear to send
Pin6 DSR Dataset ready
Pin5 SG Signal ground
Pin1 CD Carrier detect
Pin 4 DTR Data terminal ready
Pin9 RI Ring indicator
TD – This pin is used to send the data.
RD – This pin is used to receive data.
RTS - Used in modem communication, this pin tells that the UART
Is ready to send data.
CTS- It indicates that the modem is ready to exchange data.
DSR- It tells the UART that the modem is ready to establish a link.
SG- Signal ground.
CD - This pin is high when the modem detects a carrier from the
Modem at the other end of the phone.
DTR- It tells the modem that the UART is ready to link.
RI- This pin is high when the modem receives a ring from the public
Switched telephone network (PSTN).
TABLE II
Registers With Their Addresses
Base address DLAB* Read/Write Abbreviation Register name
+0 =0 Write ---- Transmitter holding buffer
+0 =0 Read ---- Receive buffer
+0 =1 Read/ Write ---- Device latch-low byte
+1 =0 Read/ Write IER Interrupt enable register
+1 =1 Read/ Write ---- Device latch-high byte
+2 --- Read IIR Interrupt Identification register
+2 --- Write FCR FIFO control register
+3 --- Read/Write LCR Line control register
+4 --- Read/ Write MCR Modem control register
+5 --- Read LSR Line status register
+6 --- Read MSR Modem status register
+7 --- Read/ Write ---- Scratch register
*DLAB- Divisor latch access bit
#include<io.h>
#include<graphics.h>
#include<stdlib.h>
#include<ctype.h> //for toupper
#include<time.h> //for clock
#include<string.h>
#include<conio.h> //for
getch,putch,textcolor...
#include<bios.h> //for bioscom
#include<stdio.h> //for file functions
#include<dos.h> //for
delay,inport,outport...
char temp='\n',t2;
int t1=10;
/*main funtion*/
void main(void)
{
char ch,chr,chs;
clrscr();
if(flag==0)
{
flag++;
welcome(); // calls the welcome
function
}
clrscr();
textbackground(0);
textcolor(4);
gotoxy(30,6);
cprintf("INFRARED COMMUNICATION");
gotoxy(34,9);
textcolor(10);
cprintf("R");
textcolor(7);
cprintf("eceive mode");
textcolor(14);
gotoxy(35,12);
cprintf("S");
textcolor(7);
cprintf("end mode");
textcolor(9);
gotoxy(36,15);
cprintf("C");
textcolor(7);
cprintf("hatting");
gotoxy(38,18);
textcolor(6);
cprintf("E");
textcolor(7);
cprintf("xit");
ch=getch();
switch(toupper(ch))
{
case 'R':R:clrscr(); //Enters to the
receive menu
textcolor(4);
gotoxy(30,6);
cprintf("INFRARED
COMMUNICATION");
textcolor(138);
gotoxy(33,9);
cprintf("RECEIVE MODE");
textcolor(9);
gotoxy(33,12);
cprintf("A");
textcolor(7);
cprintf("lign device");
textcolor(11);
gotoxy(33,15);
cprintf("F");
textcolor(7);
cprintf("ile receive");
textcolor(6);
gotoxy(36,18);
cprintf("Q");
textcolor(7);
cprintf("uit");
chr=getch();
switch(toupper(chr))
{
case 'A':ralgn();
break;
case 'F':f_rcv();
break;
case 'Q':main();
default:clrscr();
printf("Wrong key
pressed");
delay(2000);
goto R;
}
break;
chatting();
main();
break;
case 'E':clrscr(); //Exits from main
menu
textcolor(143);
gotoxy(35,13);
splash();
delay(2000);
exit(1);
break;
default:clrscr();
printf("Wrong key pressed");
main();
return;
}
}
int ralgn(void)
{
char st = ' ';
clrscr();
gotoxy(30,2);
textcolor(10);
cprintf("RECIVE MODE");
textcolor(9);
cprintf("ALIGN DEVICE");
printf("\n");
initial();
loop:
if (!kbhit())
{
if(st==0x04)
{
clrscr();
textcolor(140);
gotoxy(30,12);
cprintf("Aligned properly");
gotoxy(48,24);
printf("press any key to quit");
getch();
main();
}
status=inp(0x3fd);
if((status && 0x01)==0x00)
goto loop;
else if(!kbhit())
{
st=inp(COM);
printf("%c",st);
goto loop;
}
else
main();
}
main();
return 0;
}
int f_rcv()
{
int flag=0,bytecount=0,count;
float ot=0.00,nt=0.00;
char ch,st[5500],fnm[30];
clrscr();
initial();
ot=clock()/18.2;
gotoxy(2,2);
printf("FILE NAME?:");
fp=fopen(gets(fnm),"wb");
gotoxy(26,10);
printf("(Ready for)RECEIVING DATA");
gotoxy(47,24);
textcolor(138);
cprintf("Don't Press any KEY data may loss");
loop:nt=clock()/18.2;
status=inp(0x3FD);
,fnm,count);
gotoxy(50,24);
textcolor(7);
cprintf("press any key to quit:");
getch();
main();
}
goto loop;
}
else if(!kbhit())
{
st[flag]=inp(COM);
flag++;
bytecount++;
ot=clock()/18.2;
goto loop;
}
else
{
clrscr();
for(count=0;count<flag;count++)
{
gotoxy(26,3);
textcolor(11);
cprintf("Saving data in");
textcolor(12);
cprintf("%s",fnm);
fprintf(fp,"%c",st[count]);
}
fclose(fp);
gotoxy(26,13);
textcolor(11);
cprintf("file %s of %d bytes
created"
,fnm,count);
sleep(5);
main();
}
return 0;
}
int salgn(void)
{
int flag=0;
char st[27];
clrscr();
initial();
textcolor(14);
cprintf("type the sentence( <27 chars)");
puts("\n");
gets(st);
loop:status=inp(0x3FD);
if((status & 0x20)==0x00)
goto loop;
else
do
{
if(!kbhit())
{
outport(COM,0x0D);
outport(COM,0x0A);
if(flag==strlen(st))
{
printf("/n");
flag=0;
outport(COM,0X0D);
delay(5);
outport(COM,0X0A);
delay(5);
}
else
{
outport(COM,st[flag]);
printf("%c",st[flag]);
flag++;
delay(DEL);
}
}
if(kbhit())
{
delay(1);
outport(COM,0X04);
main();
}
}
while(!kbhit());
return 0;
}
int f_snd()
{
int flag=0,count=0,fl;
char ch,st[55000],fnm[20];
clrscr();
initial();
gotoxy(2,2);
printf("FILE NAME ? : ");
gets(fnm);
fp=fopen(fnm,"rb");
if(fp==NULL)
{
clrscr();
gotoxy(35,13);
printf("FILE NOT FOUND!");
delay(1000);
main();
}
else
{
fl=filelength(5);
gotoxy(23,20);
printf("file being transfered has %ld
bytes",fl);
clrscr();
do
{
ch=fgetc(fp);
printf("%c",ch);
st[count]=ch;
count++;
}
while(ch != EOF);
}
fclose(fp);
loop:status=inp(0x3fd);
if((status & 0x20)==0x00)
goto loop;
else
do
{
if(flag==count)
{
gotoxy(50,24);
printf("press any key to exit");
getch();
main();
}
else
{
outport(COM,st[flag]);
flag++;
delay(DEL);
}
}
while(!kbhit());
return 0;
}
/*initialisation funtion*/
int initial()
{
inregs.h.ah=0;
//The 0 is used to initialize the specified
serial //communications port to a desired baud
rate, parity, //word length and number of stop
bits.
inregs.h.al=0x63;
//sets the baud rate to 600, none parity, one
stop bit //and word length is 8bits
inregs.x.dx=0;
//DX=communication port number (
0=COM1,1=COM2,etc )
int86(0x14,&inregs,&outregs);
return 0;
}
int splash(void)
{
int d=DETECT,m,j,i;
struct palettetype pal;
initgraph(&d,&m,"c:\\tc\\bgi");
setcolor(15);
settextstyle(1,0,4);
setbkcolor(9);
for(i=0;i<5;i+=2)
{
setcolor(i);
outtextxy(35+i,200+i,"PC TO PC INFRARED
COMMUNICATION
");
}
sleep(2); //suspends the execution for 2
seconds
cleardevice();
for(i=0;i<5;i+=2)
{
setcolor(i);
outtextxy(275+i,200+i,"By");
}
sleep(1);
cleardevice();
for(i=0;i<5;i+=2)
{
setcolor(i);
outtextxy(180+i,160+i,"Jagadish.T.S");
outtextxy(200+i,205+i,"Suman.A");
outtextxy(182+i,250+i,"Adarsha.M.C");
}
getch();
cleardevice();
closegraph();
return 0;
}
void chatwindow()
{
int i,j;
textbackground(0);
clrscr();
cprintf("Esc: Main Menu Enter: Send
:Recieved msg
:Sent msg");
gotoxy(63,1);
textcolor(14);
putch(219);
gotoxy(43,1);
textcolor(10);
putch(219);
window(10,3,70,20);
textbackground(1);
clrscr();
textcolor(3);
window(1,1,80,25);
for(i=0;i<=60;i++)
{
gotoxy(10+i,3);
putch(205); //=
gotoxy(10+i,20);
putch(205); //=
}
for(j=0;j<=16;j++)
{
gotoxy(10,3+j);
putch(186); //
gotoxy(70,3+j);
putch(186); //
}
gotoxy(10,3);
putch(201); //
gotoxy(70,3);
putch(187); //
gotoxy(10,20);
putch(200); //
gotoxy(70,20);
putch(188); //
textbackground(3);
textcolor(1); //BLUE
window(1,22,80,24);
clrscr(); //make
background blue
window(1,1,80,25);
for(i=1;i<=80;i++)
{
gotoxy(i,22);
putch('-');
gotoxy(i,24);
putch('-');
}
gotoxy(2,23);
putch(16); //
}
void chatting()
{
char msg[80],msg_in[80];
int status,out,in,count=0,count_in=0,i,extra;
bioscom(0, SETTINGS, COM); //init. port
//alternative to outportb(),particularly for
RS 232
communication.
window(3,23,80,23); //message entry
window
while (1)
{
status = bioscom(3, 0, COM);
if (status & 0x100)
{
if ((out = bioscom(2, 0, COM) &
0x7F) != 0)
// input message byte.
msg_in[count_in++]=out;
if(out==13)
{
dsply(msg_in,10);
count_in=0;
gotoxy(count+1,1);
}
}
if (kbhit()) //character entered
{
gotoxy(count+1,1);
if ((in = getche()) == 27)
{
textbackground(0);
window(1,1,80,25);
break;
}
if(in==0)
{
in= getch();
//special function key pressed, ignore
continue;
}
if(in==8 && count>0)
{
count-=2;
cprintf(" \b"); //BackSpace
}
else
msg[count]=in;
if(count==70)
{
in=13;
msg[70]=13;
}
count++;
if(in==13 ) //Enter: Send
{
i=0;
dsply(msg,14);
for(i=0;i<count;i++)
{
bioscom(1, msg[i], COM);
}
clrscr();
count=0;
}
}
}
}
int i=0;
static int line=1;
window(11,4,69,19); //Chat display
window
textbackground(1); //BLUE
textcolor(col);
gotoxy(1,line);
putch('\n');
putch(175);
while(str[i]!=13)
{
putch(str[i]);
i++;
}
line=wherey(); //store present line
window(3,23,80,23); //message enter window
textbackground(3);
textcolor(1);
}
void welcome()
{
int i,j;
clrscr();
textcolor(4);
gotoxy(24,5);
cprintf("Welcome to PC to PC Communication");
gotoxy(28,6);
cprintf("Using infrared device");
textcolor(2);
gotoxy(25,7);
cprintf("By Adarsha, Jagadish & Suman ");
sleep(1);
window(10,9,70,23);
textbackground(1);
clrscr();
textcolor(3);
window(1,1,80,25);
for(i=0;i<=60;i++)
{
gotoxy(10+i,3);
putch(205); // =
gotoxy(10+i,23);
putch(205); // =
}
for(j=0;j<=20;j++)
{
gotoxy(10,3+j);
putch(186); //
gotoxy(70,3+j);
putch(186); //
}
gotoxy(10,3);
putch(201); //
gotoxy(70,3);
putch(187); //
gotoxy(10,23);
putch(200); //
gotoxy(70,23);
putch(188); //
sleep(1);
gotoxy(15,10);
window(12,11,68,22);
cprintf("To start wireless communication
between the"
"two computers, connect infrared device
module to "
"serial port COM1 of each computer.");
gotoxy(3,12);
cprintf("Press any key to start....");
window(1,1,80,25);
getch();
}
OUTPUT:
CHATTING
Choose the chatting mode from the main menu to chat with the person on other
computer
FEATURES:
Maximum transmission rate of 2400 bps .
Half duplex operation.
Efficient conversion of RS232 –TTL by a single chip
Simple interface through standard 9-pin cable.
IR modulating frequency is 36 KHZ
ADVANTAGES:
The advantage of this project over traditional wired networks is
1. This system provides the users to access the information any where in the
organization.
2. Installing this system is fast & easy & can eliminate the need to pull cable through
walls and ceilings.
3. This system is suited for the organization requiring frequent moves and changes.
If the distance and the speed of the data transfer are increased in this project, it can
be used for many applications like
1. Sending data from computer to printer.
2. It can be used in fax machine overhead projectors etc.
Using higher version ports can increase the speed of data transfer.
It is very much applicable to use in sensitive areas like gas stations, oil refineries
etc... Where other forms of wireless communication may be dangerous as they might
produce electrical sparks and may cause disasters.
Infrared wireless communication module is very much safer and cheaper compared
to other systems.
It is highly compatible with all types of PC‟s and it works with all versions of
windows, as it is DOS based.
The software has a user-friendly text interface written in “C”.
CONCLUSION:
This is one of the efficient communicating methods compared to other method
because it is very easy to communicate and also there is no need to have network of
card for communication. Moreover it is very cheaper than compared to other forms
of wireless communication method.
BIBLOGRAPHY