Specifications
CONSTRUCTION
ing corruption of the data. Finally, we
succeeded, after modification of the cir-
cuit as shown in Fig. 3. We were able to
flawlessly transfer files, from about 5-
metre distance, between two 386-based
PCs. We included a 38kHz modulator in
the transmitter section and used IR re-
ceiver module, which includes a bandpass
filter and demodulator for 38kHz carrier.
Please refer to the author’s circuit idea
captioned ‘Proximity Detector’ in this is-
sue for the working principle etc. For bet-
ter understanding of the software pro-
gram given by the author, we have in-
cluded certain additional information in
the succeeding paragraphs.
The base addresses for the serial
communication ports in a PC are shown
in Table III. The offset ad-
dress of the registers used
in serial communication is
given in Table IV.
For serial port
initialisation, the program
makes use of BIOS interrupt
14H service 00H. It
initialises the serial port
pointed to by the contents of
dx register (0 for Com-1 and 1 for Com-2
port). The contents of ‘al’ register
initialise the specific communication port
for baud rate, parity, stop-bit code, and
character-size code as per Table V (and
expanded in Tables VI through IX re-
spectively).
The transmitter holding register
(THR) and receiver data register (RDR)
both at address Base+0 (the former be-
ing write(only) and latter being read
(only)) act as buffers during transmis-
sion and reception, respectively, of a char-
acter. The other most important register,
which is referred to in the software pro-
gram frequently, is the line status regis-
ter (LSR) at Base+5 (i.e. 03FDH for
COM-1 port or 02FDH for COM-2 port).
Meaning of each of the bits of line status
register is given in Table X. Its bit 0 is
set when a byte is logged in the receiver
buffer register and cleared when the byte
is read by the CPU. Its bit 6 is set when
both the transmitter holding register and
the transmitter shift register are empty.
Presently, the software program is
meant for COM-1 port initialised for 600
bauds. It can be changed for 1200, or 2400,
or 4800, etc by changing the contents of
‘al’ register in the initialisation function
to 83H, or A3H, or C3H, etc in place of
63H. Similarly, for using COM-2 port,
change all register addresses starting with
OX3f.. to OX2f.. etc in the program.
With the information included in the
tables and some knowledge of ‘C’ pro-
gramming, the readers would be able to
understand the program with the help of
comments already included at various
places in the program. The executable file
as well as the source code will also be
included in the CD available (optionally)
with EFY Dec. 2000 issue.
The source code as well as executable
files are proposed to be included in next
month’s EFY-CD.
❏
TABLE X
Line Status Register Bits
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
180