Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
AUTOMATION
p a r t o f c o l l e g e a u t o m a t i o n , w e h a v e d e c i d e d t o d o a p r oj e c t
i n t e n t i o n o f t h e c o l l e g e a u t h o r i t y . I n t h e h a r d w ar e s i d e
T e l e p h o n e l i n e i s u s e d f or c o m m u n i c a t i o n p ur p o s e . V i s u a l
B a s i c h a s b e e n u s e d f or s o f t w a r e p r o gr a m m i n g . P r e s e n t a t i o n
i n t h e c l a s s a n d o u t c o m e o f t h e u n i v e r s i t y ar e m a d e r e a c h a b l e
t o t h e p a r e n t s b y o u r pr o j e c t . I t w i l l b e v e r y o b l i g i n g t o t h e
the college.
1
1. INTRODUCTION
2
2. PROJECT DESCRIPTION
TELEPHONE
LINE
DTMF DECODER PC
SERIAL
VOLTAGE PORT
CONVERTER
PERSONAL
MICRO COMPUTER
RING DETECTOR
CONTROLLER
PC
SPEAKER
OUT
ON/OFF
HOOK
SIMULATOR
INTERFACING
CIRCUIT
3
2.2 BLOCK DIAGRAM EXPLANATION
1. TELEPHONE
Outgoing Call
4
Multi-Frequency (MF):
Incoming call
5
When a telephone set is called, the local exchange generates a
high ring voltage of about 90-105Volts AC with a frequency of 20Hz
superimposed over the minus (-) 48Volt DC. A capacitor in the phone
passes the AC but block DC. Upon detecting the AC voltage, the
phone provides an audible signal that altos the user of an incoming
call. Each telephone set provide a ringer equivalent number (REN) as
defined within FCC part 68 and EIA RS-470.The REN is used to
ensure that the local exchange can provide the correct amount of
power required to ring the telephone. It describes the frequency
range, power range, and bias voltage range of the telephone set. When
the phone is answered, DC current begins to flow in the loop. The
local exchange the current flow and removes the super imposed ring
voltage. The -48Volts DC that is always on the line operates the
telephone when it is being used.
2 DTMF SIGNALING
6
1209 Hz 1336 Hz 1477 Hz 1633 Hz
Table.2.2.
697 Hz 1 2 3 A DTMF
Keypad
770 Hz 4 5 6 B Frequencies
852 Hz 7 8 9 C
Theory of
941 Hz * 0 # D Operation
7
Figure 2.2 Tone frequencies for key “1”
You can see that the DTMF generated signal is very distinct and
clear. The horizontal axis is in samples. The frequency of the tone is
about 1900 Hz - close to the 1906 Hz predicted by Table 3
(697+1209).
8
Event Low frequency High frequency
Generating DTMF
9
applications. Most often, a PIC micro could be used for the above
purpose.
Decoding DTMF
3. RING DETECTOR:
10
5. MICROCONTROLLER
Microprocessor
A microprocessor, as the term has come to be known, is a
general-purpose digital computer central processing unit (CPU).
Although popularly known as a “computer on a chip”, the
microprocessor is in no sense a complete digital computer.
11
Arithmetic and logic unit
Accumulator
Working Register(s)
12
The hardware design of a microprocessor CPU is arranged so
that a small or very large system can be configured around the CPU as
the application demands. The prime use of a microprocessor is to read
data, perform extensive calculations on the data, and store those
calculations in a mass storage device or display the results for human
use. The programs used by the microprocessor are stored in the mass
storage device and loaded into RAM as the user directs. A few
microprocessor programs are stored in ROM. The ROM-based
programs are primarily small fixed programs that operate peripherals
and other fixed devices that are connected to the system. The design
of the microprocessor is driven by the desire to make it as expandable
and flexible as possible, in the expectation of commercial success in
the marketplace.
Microcontroller
13
ALU I/O
Timer/ counter
port
Accumulater I/O
Register(s) port
Interrupt
Internal circuit
Internal RAM
ROM
Program counter
14
limited calculations. The prime use of a micro-controller is to control
its environment based on those calculations. The prime use of a
microcontroller is to control the operation of a machine using a fixed
program that is stored in ROM and that does not change over the
lifetime of the system.
Microprocessors Vs Microcontroller
15
The fundamental differences between microprocessors and
microcontrollers are these:
Eight bit has proven to be a very useful world size for small
computing tasks.1- byte word is adequate for many control and
monitoring applications. Serial ASCII data is also stored in byte
sizes, making 8 bits the natural choice for data communications. Most
integrated circuit memories and many logic functions are arranged in
an 8- bit configuration that interfaces easily to data busses of 8 bits.
16
Application sophistication can also range from simple appliance
control to high speed machine control and data collection. For these
reasons the microcontroller vendors have established extensive
families of similar models. All feature a common language, but differ
in the amount of internal ROM, RAM, and other cost sensitive
features. Often the memory can be expanded to include off- chip ROM
and RAM; in some cases, the microcontroller has no on-board ROM at
all, or the ROM is an electrically reprogrammable read only memory
[EPROM]. The ROM less or EPROM versions can be used by the
designer to prototype the application, and the designer can order the
ROM version in large quantities from the factory. Many times the
ROM version is never used. The designer makes the ROM less or
EPROM design sufficiently general so that on configuration may be
used many times, or production volumes never justify the cost of a
factory ROM implementation. As a further enticement for the buyer,
some families have members with fewer external pins to shrink the
package and the cost; others have special features such as analog-to-
digital and digital-to-analog converters on the chip.
8051 Derivatives
17
Manufacturers modified the basic 8031 architecture and added
many new peripheral functions to make them attractive to the
designers. Because of the rush, electronic community started getting a
variety of 8031 based devices with range of options. To beat the
competition, manufacturers developed different microcontrollers with
many unique features. These parts are popularly known as ‘8031
Derivatives’. Almost every decent manufacturer boasted of having an
8031 based microcontroller in the line card.
First major manufacturer was the Philips who brought out more
than 40-50 derivatives with a variety of I/O options, memory
combinations, and peripheral functions. Devices became available in
regular DIP and SMD packages. With the basic 8031 core, Philips
ported high capacity Program Memory (upto 32K/64K), its patented
I2C interface bus, 8/10 bit Analog to Digital Converters, CAN Bus,
Capture and Compare registers, Watch dog timer, PWM facilities and
etc. More I/O ports (as many as eight ports), additional timer/counter,
second serial port was also made available in Philips devices.
18
Dallas semiconductor also has got a range of secure
microcontrollers based on 8031 core. This microcontroller family uses
non volatile RAM to keep both program and data. Because of this
RAM, the controller gives the In System Reprogram ability. Dallas
has combined this microcontroller, SRAM and lithium cell in a single
pack. This device guarantees 10+ years of data retention in the RAM
area. This 8031 also boasts the tamper proof security features like
Real Time Memory Encryption, user selected 48 bit Encryption key,
memory contents, security lock and the facility to hide interrupt
vector table. As you can agree, this particular 8031 device has found
a niche market in banking and security related applications.
19
Addressing Modes
Register Addressing
Direct Addressing
20
attached to the opcode. Depending on the highest order bit of the
direct address byte one of two physical memory space is selected.
Immediate Addressing
21
Index Addressing
22
6. VOLTAGE CONVERTER
7. PC SERIAL PORT
A parallel port sends and receives data eight bits at a time over
8 separate wires. This allows data to be transferred very quickly;
however, the cable required is more bulky because of the number of
individual wires it must contain. Parallel ports are typically used to
connect a PC to a printer and are rarely used for much else. A serial
port sends and receives data one bit at a time over one wire. While it
takes eight times as long to transfer each byte of data this way, only a
few wires are required.
23
In fact, two-way (full duplex) communications is possible with
only three separate wires - one to send, one to receive, and a common
signal ground wire.
8. INTERFACING CIRCUIT
3. HARDWARE DECSRIPTION
3.1 MICROCONTROLLER
24
which provides a highly flexible and cost effective solution to many
embedded control applications.
25
Figure.3.1 Pin diagram of AT89C2051
26
Figure.3.2 Block Diagram of AT89C2051
27
3.1.3 Pin Description
VCC
Supply voltage.
GND
Ground.
Port 1
Port 1 is an 8-bit bidirectional I/O port. Port pins P1.2 to P1.7
provide internal pullups. P1.0 and P1.1 require external pullups. P1.0
and P1.1 also serve as the positive input (AIN0) and the negative
input (AIN1), respectively, of the on-chip precision analog
comparator. The Port 1 output buffers can sink 20 mA and can drive
LED displays directly. When 1s are written to Port 1 pins, they can be
used as inputs. When pins P1.2 to P1.7 are used as inputs and are
externally pulled low, they will source current (IIL) because of the
internal pullups. Port 1 also receives code data during Flash
programming and program verification.
Port 3
Port 3 pins P3.0 to P3.5, P3.7 are seven bidirectional I/O pins
with internal pull-ups. P3.6 is hard-wired as an input to the output of
the on-chip comparator and is not accessible as a general purpose I/O
pin. The Port 3 output buffers can sink 20 mA. When 1s are written to
Port 3 pins they are pulled high by the internal pull-ups and can be
used as inputs. As inputs, Port 3 pins that are externally being pulled
low will source current (IIL) because of the pull-ups. Port 3 also
serves the functions of various special features of the AT89C2051 as
listed below:
28
Table 3.1 Alternate Functions of port 3
Port 3 also receives some control signals for Flash programming and
programming verification.
RST
Reset input. All I/O pins are reset to 1s as soon as RST goes
high. Holding the RST pin high for two machine cycles while the
oscillator is running resets the device. Each machine cycle takes 12
oscillator or clock cycles.
XTAL1
Input to the inverting oscillator amplifier and input to the
internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
29
3.1.4 Oscillator Characteristics
30
Figure.3.4 Functional diagram of IC MT8870
31
The time required to detect a valid tone pair tdP is a function of
decode algorithm, tone frequency, and the previous state of the
decoded logic. Est (early, steering output) indicates that two tones of
valid frequency have been detected and initiates an RC timing circuit.
If both tones are present for a minimum guard time, determined by an
external RC network, the DTMF signal is decoded and the resulting
data latched on the output register. The delayed steering output (stD)
is raised to indicate that new data is available. (The output
corresponding to each key pressed is shown in the truth table)
3.2.1Tone detection
After receiving a DTMF tone the DTMF decoder (MT8870)
places the corresponding binary number on its out put (StD) goes high
to state that new data is available. The detection of the delayed
steering output is to the duration of the received DTMF receiver has
already been explained.
32
3.2.2 PIN DIAGRAM OF IC MT8870
33
Pin Description
34
Recommended Operating Condition
Filter Section
35
signals prior to limiting. Limiting is performed by high-gain
comparators which are provided with hysteresis to prevent detection
of unwanted low-level signals. The outputs of the comparators
provide full rail logic swings at the frequencies of the incoming
DTMF signals.
Decoder Section
36
3.2.4 Guard Time Adjustment
37
Differential Input Configuration
Crystal Oscillator
38
3.2.5 Tone Decoding of MT8870
39
3.2.7 Applications
• Paging systems
• Repeater systems/mobile radio
• Credit card systems
• Remote control
• Personal computers
• Telephone answering machine
Feature
40
3.3.1 PIN Diagram
41
3.3.2 Functional Diagram of MAX232
The MAX232 has two sets of line drivers for transferring and
receiving data, as shown in Figure 10-7. The line drivers used for
TxD are called T1 and T2 while the line drivers for Rxd are
designated as R1 and R2. In many applications only one of each is
used for example, T1 and R1 are used together for TxD and RxD of
the 8051 and the second set is left unused. Notice in MAX232 that the
T1 line driver has a designation of T1 in and T1 out on pin numbers
11 and 14, respectively. The T1 in pin is the TTL side and is
42
connected to TxD of the microcontroller, while T1 out is the RS232
side that is connected to the RxD pin of the RS232 DB connector.
3.3.3 APPLICATIONS
• Portable Computers
• Low-Power Modems
• Interface Translation
• Battery-Powered RS-232 Systems
• Multidrop RS-232 Networks
43
4. CIRCUIT DIAGRAM
44
4.1 CIRCUIT OPERATION
When the telephone ring arrives the ring sensor detects it and it
will send a signal to the microcontroller. The Microcontroller will
then take the phone with help of ON/OFF hook simulator and it will
sense the DTMF signal and it will get the DTMF signal and the
Microcontroller will switch on the corresponding Relay.
At normal time the voltage across the telephone line is 48v and
when a ring arrives then a voltage of 74v AC is injected through the
telephone and this AC will pass through the capacitor C4 and though
the zener diodes to the LED in the optocoupler and it will conduct
and this light will conduct the photo transistor and therefore a low
signal was fed to the microcontroller and it will then switch on the
Hook Relay of a telephone.
The DTMF receiver will decode the tone signal into digital
which was fed to the microcontroller for further control. The main
part of the circuit was done by the Microcontroller AT89C2051. The
DTMF signal from the Telephone was decoded by the Decoder IC
MT8870. The Decoder get the DTMF signal from Telephone line and
this decoded digital signal was fed to the Microcontroller. The
microcontroller will sent the decoded DTMF signal to the PC through
its serial port.
45
logic 0 is 0V. There fore for connecting this two section (RS232 and
TTL) we need a converter.
The Converter used in our circuit is IC MAX232. This IC has
two sets of converter in which we are using a set. The data from the
PC is fed to the converter and the converter converts the data into
TTL logic which is fed to the microcontroller.
46
relay by providing the magnetizing current. This will Ceases the DC
voltage across the phone line. The audio signal is extended to the
ON/OFF hook detector (Optocoupler IC).If the telephone hand set is
ON hook condition means the telephone Line consist of 48v, to get a
closed loop connection with the exchange for communication. Here
an optocoupler is used for ON/OFF hook detection, it gets this 48v as
input and the photodiode acquire a conduction voltage around 12v by
the use of resistor R1. The conduction of photodiode emits light
towards photo transistor and there by it gets the GND, which connect
a 10k resistor (R2) across the Telephone Line. So that the exchange
detect a signal from the subscribers, that the subscriber was ready for
communication. If the telephone line is used for message Tx and Rx
means, the hand set is first picked up to conform that the in coming
signal is Voice or Message .After that the subscriber can place the
hand set with the base set. Once the hand set is picked up means the
µc will sent a acknowledgement signal to the µc at the designation
side .so that the hook detector will provide voltage drop in the Land
line voltage, there by a closed loop circuit is formed between
Subscribers and Telephone exchange.
47
Figure.42 Phototransistor Optocouple
Feature
Schematic Diagram
48
PIN 1. ANODE
2. CATHODE
3. NO CONNECTION
4. EMITTER
5. COLLECTOR
6. BASE
Application
49
The operated line voltage is about 50v DC and the incoming
voice voltage to the telephone instrument varies from 0.5v to 1 volt
and the maximum out going voice voltage is abut 2v rms.The ring
signal is 70- 90v rms at 20 -25HZ.In pulse dialing telephones register
signaling is known as DC loop signaling. In this case the dialed
number is conveyed to the exchange by “make” and “break” of loop
circuit.
When a ring signal is present, the microcontroller will switch on
the RELAY to achieve OFF hook condition.
4.1.2.1 RELAY
50
Figure.4.4 Relay
51
Relay Construction
52
The core bar contacts are used for dry circuit (NO or little current
flow) and are made of gold to hinder and oxidation for low level (milli
volts or micro volts) Switching circuit.
A parallel port sends and receives data eight bits at a time over
8 separate wires. This allows data to be transferred very quickly;
however, the cable required is more bulky because of the number of
individual wires it must contain. Parallel ports are typically used to
connect a PC to a printer and are rarely used for much else. A serial
port sends and receives data one bit at a time over one wire. While it
takes eight times as long to transfer each byte of data this way, only a
few wires are required. In fact, two-way (full duplex) communications
is possible with only three separate wires - one to send, one to
receive, and a common signal ground wire.
53
Introduction to Serial Port
The UART serial port (or just "serial port for short" is an I/O
(Input/Output) device. An I/O device is just a way to get data into and
out of a computer. There are many types of I/O devices such as serial
ports, parallel ports, disk drive controllers, ethernet boards, universal
serial buses, etc. Most PC's have one or two serial ports. Each has a
9-pin connector (sometimes 25-pin) on the back of the computer.
Computer programs can send data (bytes) to the transmit pin (output)
and receive bytes from the receive pin (input). The other pins are for
control purposes and ground.
Old PC's used 25 pin connectors but only about 9 pins were
actually used so today most connectors are only 9-pin. Each of the 9
pins usually connects to a wire. Besides the two wires used for
transmitting and receiving data, another pin (wire) is signal ground.
The voltage on any wire is measured with respect to this ground.
54
Thus the minimum number of wires to use for 2-way
transmission of data is 3. Except that it has been known to work with
no signal ground wire but with degraded performance and sometimes
with errors. There are still more wires which are for control purposes
(signaling) only and not for sending bytes. All of these signals could
have been shared on a single wire, but instead, there is a separate
dedicated wire for every type of signal. Some (or all) of these control
wires are called "modem control lines". Modem control wires are
either in the asserted state (on) of +12 volts or in the negated state
(off) of -12 volts. One of these wires is to signal the computer to stop
sending bytes out the serial port cable. Conversely, another wire
signals the device attached to the serial port to stop sending bytes to
the computer. If the attached device is a modem, other wires may tell
the modem to hang up the telephone line or tell the computer that a
connection has been made or that the telephone line is ringing
(someone is attempting to call in).
Bi-Directional Communications
Communicating By Bits
Once the start bit has been sent, the transmitter sends the actual
data bits. There may either be 5, 6, 7, or 8 data bits, depending on the
number you have selected. Both receiver and the transmitter must
55
agree on the number of data bits, as well as the baud rate. Almost all
devices transmit data using either 7 or 8 data bits. Notice that when
only 7 data bits are employed, you cannot send ASCII values greater
than 127. Likewise, using 5 bits limits the highest possible value to
31. After the data has been transmitted, a stop bit is sent. A stop bit
has a value of 1 - or a mark state - and it can be detected correctly
even if the previous data bit also had a value of 1. This is
accomplished by the stop bit's duration. Stop bits can be 1, 1.5, or 2
bit periods in length.
56
even numbers of bits are in error then the parity bit would not reflect
any error at all.
Mark parity means that the parity bit is always set to the mark
signal condition and likewise space parity always sends the parity bit
in the space signal condition. Since these two parity options serve no
useful purpose whatsoever, they are almost never used.
RS-232C
RS232
Connector
1 CD DSR 6
2 RD
3 RTS 7
TD
4 CTS 8
DTR
5 RI 9
GND
57
9 Pin Connector on a DTE device (PC connection)
Pin
Direction of signal:
Number
Carrier Detect (CD) (from DCE) Incoming signal from a
1
modem
2 Received Data (RD) Incoming Data from a DCE
3 Transmitted Data (TD) Outgoing Data to a DCE
4 Data Terminal Ready (DTR) Outgoing handshaking signal
5 Signal Ground Common reference voltage
6 Data Set Ready (DSR) Incoming handshaking signal
7 Request To Send (RTS) Outgoing flow control signal
8 Clear To Send (CTS) Incoming flow control signal
Ring Indicator (RI) (from DCE) Incoming signal from a
9
modem
The TD (transmit data) wire is the one through which data from
a DTE device is transmitted to a DCE device. This name can be
deceiving, because this wire is used by a DCE device to receive its
data. The TD line is kept in a mark condition by the DTE device when
it is idle. The RD (receive data) wire is the one on which data is
received by a DTE device. RTS stands for Request To Send. This line
and the CTS line are used when "hardware flow control" is enabled in
both the DTE and DCE devices.
The DTE device puts this line in a mark condition to tell the
remote device that it is ready and able to receive data. If the DTE
device is not able to receive data (typically because its receive buffer
is almost full), it will put this line in the space condition as a signal
to the DCE to stop sending data. When the DTE device is ready to
58
receive more data (i.e. after data has been removed from it’s receive
buffer), it will place this line back in the mark condition. The
complement of the RTS wire is CTS, which stands for Clear to Send.
The DCE device puts this line in a mark condition to tell the DTE
device that it is ready to receive the data.
59
The last remaining line is RI or Ring Indicator. A modem
toggles the state of this line when an incoming call rings your phone.
The Carrier Detect (CD) and the Ring Indicator (RI) lines are
only available in connections to a modem. Because most modems
transmit status information to a PC when either a carrier signal is
detected (i.e. when a connection is made to another modem) or when
the line is ringing, these two lines are rarely used.
60
4.2.1 Regulator IC (LM 7805)
61
Visual Basic (Visual Beginners All purpose symbolic
Instruction Code) is the most popular programming language for
world’s most popular operating system. Visual Basic is the first
language people consider when they want rapid application
development for the window environment. Visual Basic is evolved
from the original BASIC language, which is widely used language.
Existing objects are dragged & dropped in to the place instead of
writing numerous codes. While writing the programs, we are able to
see how the programs run during the run time. This is great advantage
over other programming language. VB is based on an event driven
method model; it also has a set of debugging tools. The primary
reason behind selecting VB was because the interface was so little
compared to other tools.
Properties
The properties describe the appearance of the GUI component.
When adding a component, the Name property should be set
immediately, according to the three-letter mnemonic naming
conventions. The properties are displayed in the Properties Window in
Name/Value pairs in alphabetical order.
Event Procedures
An event procedure is a piece of code that responds to events
that can occur for that object. Most of the events are generated by the
user, enabling them to dictate the order of execution.
Forms
The Form is the main stage of your application. By default, the
Standard Exe option starts with a form called "Form1". The Name
property of the Form should be named with a three-letter mnemonic
62
prefix of "frm". Each Form will be a Window in your application.
Controls are added to the form by either double-clicking them in the
toolbox, or by selecting the control and drawing a bounding rectangle
on the form. Your application may use more than one form.
Note: In VB.Net, there are two types of Forms - Windows Forms and
Web Forms. Web Forms are based on ASP.Net.
Standard Controls
Controls are added to the Form from the Toolbox. Each control
has a set of properties, and a set of event procedures associated with
63
it. The following lists the control, reading left to right, top to bottom
as they appear in the standard Toolbox.
The Pointer
The Pointer is not a control, but is used to interact with the
controls on the form, allowing you to move and resize them. The
Pointer is selected by default. When a control is added to the form,
the focus reverts back to the Pointer.
PictureBox Control
The PictureBox is used to display images or act as a container
to other controls. The three-letter mnemonic for a PictureBox is pic
(eg. picFace). The main event for a PictureBox is the Click event.
Pictures are loaded into the PictureBox using the LoadPicture
function. The following example toggles between face0.gif and
face1.gif with each click of the mouse.
Label Control
The Label control is used to display text that can't be changed
directly by the user. Labels are more commonly used to place captions
against other controls or store calculated values. The three-letter
mnemonic for a Label is lbl (eg. lblPrompt).
The default property of a Label is Caption. The Caption property may
be set at design-time using the Properties Window, and changed at
run-time.
Label Control
The Label control is used to display text that can't be changed
directly by the user. Labels are more commonly used to place captions
64
against other controls or store calculated values. The three-letter
mnemonic for a Label is lbl (eg. lblPrompt). The default property of a
Label is Caption. The Caption property may be set at design-time
using the Properties Window, and changed at run-time.
Frame Control
The Frame control is used to group controls and provides a
means of sub-dividing the Form visually. The three-letter mnemonic
for a Frame is fra (eg. fraPaymentMethod). The default property is
Caption, which can be used to give context to the grouping (eg.
Payment Method).
When option buttons are used, only one may be selected on the
Form. Option Buttons placed in a Frame are associated with the
Frame, and are treated as a new group.
Checkbox Control
The CheckBox control is used to give the user a choice of
yes/no multiple choice options. The three-letter mnemonic for a
65
CheckBox is chk (eg. chkHobbies). The "Value" property may be used
to determine whether an item has been selected - a value of 1
indicates true, and a value of 0 indicates false. The following
example uses a command button to determine which items have been
selected from a control array of CheckBoxes.
OptionButton Control
The OptionButton control is used to group options where the
user can only select only one. As only one item may be selected
OptionButtons are grouped in containers such as the Form, Frame or
PictureBox. The three-letter mnemonic for an OptionButton is opt (eg.
optPaymentMethod). The "Value" property may be used to determine
whether an item has been selected - either True or False. The
following example uses a CommandButton to determine which item
has been selected from a control array of OptionButtons.
ComboBox Control
Timer Control
66
The Timer control is visible at design-time, but not shown at
run-time. It is used for background processing at intervals specified
by the Interval property. The Interval property takes an integer in the
range 0 to 65,535. The Interval is measured in milliseconds; therefore
a value of 1000 equals an interval of one second. An Interval of 0
disables the Timer control in VB 6, but not in VB.Net. To disable the
Timer, set the Enabled Property to False. Setting it to True will
enable it again. The three-letter mnemonic for a Timer is tmr (eg.
tmrMove). The default event for a Timer is the Timer event.
This example moves a PictureBox around the form. To try the
example, add a PictureBox called picFace, and a Timer called
tmrMove to the form. Set the Interval of the Timer to 1, and add a
picture of a face to the PictureBox.
5.2.1 Introduction
67
files MSCOMM16.OCX (for a 16-bit module) or MSCOMM32.OCX
(for a 32-bit module) must be present in the \WINDOWS\SYSTEM
directory. The class name is MSComm. The communications control
provides the following two ways for handling communications
Event-driven
Polling
Visual Basic uses the standard Windows drivers for the serial
communication ports (such as serialui.dll and serial.vxd). The
communication control is added to the application for each port. The
parameters (such as the bit rate, parity, and so on) can be changed by
selecting Control Panel ? System ? Device Manager ? Ports (COM
and LPT) ? Port Settings. The settings of the communications port
(the IRQ and the port address) can be changed by selecting Control
68
Panel? System? Device Manager? Ports (COM and LPT)? Resources
for IRQ and Addresses.
Properties
Settings
69
The valid parity values are (default is N): E (Even), M (Mark), N
(None), O (Odd), S (Space).
The valid data bit values are (default is 8): 4, 5, 6, 7 or 8.
The valid stop bit values are (default is 1). 1, 1.5 or 2.
An example of setting a control port to 4800Baud, even parity, 7 data
bits and 1 stop bit is: Com1.Settings = "4800,E,7,1"
CommPort
PortOpen
Inputting data
The three main properties used to read data from the receive
buffer are Input, InBuffer Count and InBufferSize.
70
Input
InBufferSize
Outputting data
The three main properties used to write data to the transmit buffer
are Output, OutBufferCount and OutBufferSize.
The Output property writes a string of characters to the transmit
buffer. Its syntax is:
[form.]MSComm. output= [outString$]
71
OutBufferSize
OutBufferCount
Algorithm
72
START
CHECK
RING SENSOR
NO RING
RING
MAKE TELEPHONE
OFF H OOK &
SEND FF TO PC
GET DTMF
SIGNAL
NO IF
PRESSED
#
SENSE THE
DTMF DATA TO
THE PC TH ROUGH YES
THE SERIAL PORT
DISCONNECT
PHONE
73
5.3.2. VISUAL BASIC
Algorithm
74
START
NO CH ECK FOR
DATA "FF"
YES
NO IF FOUR NUMBERS
ARE ENTERED
YES
75
6. PCB DESIGN
76
6.2. PCB Design
77
Transferring the PCB Pattern
The mirror image of the pattern must be carbon copied and to the
laminate the complete pattern may now be made each resistant with
the help of paint and thin brush.
Developing
The board with its copper side facing upward should be placed in
a flat bottomed plastic tray and the aqueous solution of FeCl2 poured
in the etching process would take 40 to 60 min to complete.
Finishing Touches
78
Drilling
Drills for PCB use usually come with either a set of collects of
various sizes or a 3-Jaw chuck. For accuracy however 3-jaw chunks
aren’t brilliant and small drill below 1 mm from grooves in the jaws
preventing good grips.
Soldering
Assembling
79
7. CONCLUSION
9. FUTURE ENHANCEMENT
80
APPENDIX 1
81
Table: 2 Logical Operations
82
Table: 3 Data Transfer Instruction
83
84
Table: 4 Boolean Variable Manipulations and Machine Control
Instructions
REFERENCES
85
1. Kenneth.J.Ayala (Second edition). “The 8051 Microcontroller
Architecture, programming and applications”.
86