1. INTROUDUCTION The advances in the technologies related to wireless communication has led to the emergence of several engineering designs to aid the human requirements. Thus with the creeping interests in the wireless and GSM based projects, we came up with this idea of developing a simpler, multipurpose, cost-effective design to control the on-off mechanism of various devices in the field via short message service (sms). There is a growing interest in intelligent home network as a way to offer a comfortable, convenient and safe environment for occupants [1]. In order to enhance the occupants’ convenience and safety, home security system is indispensable in the field of intelligent home network. The requirements of a home security system include low cost, low power consumption, easy installation and rapid response to alarm incidents. According to connecting mode, home network can be divided into two kinds: wireless network and non-wireless network. The wireless technology has some remarkable benefits comparing with non-wireless technology. For example, it makes the installation and maintenance easier and reduces the system cost. Bluetooth, Zigbee, and wireless USB are the most popular technologies in the field of home wireless network Introduces a method to 1
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1. INTROUDUCTION
The advances in the technologies related to wireless communication has
led to the emergence of several engineering designs to aid the human
requirements. Thus with the creeping interests in the wireless and GSM based
projects, we came up with this idea of developing a simpler, multipurpose,
cost-effective design to control the on-off mechanism of various devices in the
field via short message service (sms).
There is a growing interest in intelligent home network as a way to offer a
comfortable, convenient and safe environment for occupants [1]. In order to
enhance the occupants’ convenience and safety, home security system is
indispensable in the field of intelligent home network. The requirements of a
home security system include low cost, low power consumption, easy
installation and rapid response to alarm incidents. According to connecting
mode, home network can be divided into two kinds: wireless network and non-
wireless network. The wireless technology has some remarkable benefits
comparing with non-wireless technology. For example, it makes the
installation and maintenance easier and reduces the system cost. Bluetooth,
Zigbee, and wireless USB are the most popular technologies in the field of
home wireless network Introduces a method to form a home network which
provides flexible and dynamic services via Bluetooth. However, the system
mentioned in is high power consumption and high cost so that it is not
convenient to use in security system.
How to inform user in real time when alarm incidents occur has become a
crucial feature of home security system. This can be done via internet or
GSM/GPRS. GSM/GPRS is more convenient than internet. The main reason
is that the GSM/GPRS network has wide spread coverage making the whole
system available for almost all the time. Furthermore, GSM/GPRS network
has high security infrastructure which makes sure that the information sent or
received cannot be monitored. The network examples mentioned in and send
1
the information to remote users via internet. And are examples of home
systems using GSM/GPRS network for remote controlling. However, only
illustrates that GSM is communication method between remote user and
home network server but doesn’t apply it to home security system. The
system in [9] only applies GSM/GPRS technology to intrusion detecting and its
communication is non-wireless.
2
USERMOBILE
Gsm/gprsModem
DB 9 connecter Max 232
Micro ControllerAt89c51
LCD Display
Load 1
Load 2
2. BLOCK DIAGRAM
3
3. CIRCUIT DIAGRAM
4
4. CIRCUIT DISCRIPTION
This project consists of GSM modem, microcontroller, Motor, led, and
display. If the user wants to control some devices in his house he/she have to
send the SMS indicating the operation of the device and then the system
password, while the MODEM embedded with the system microcontroller
receives SMS. The microcontroller will read SMS and check for the password
the user had sent with the SMS.
The DB 9 connecter is used to interface between the gsm modem and
micro controller. Gsm modem is a follows the USART protocol means it
follows the serial communication protocol.
The output of the DB 9 connecter is given to the max 232 IC to drive the
micro controller and to convert the signal levels, the data received from the
modem is converted to digital voltage levels is converted by using max 232 ic.
The output of the max 232 is given to the port 1 of the micro controller,
according to the message retrieved from the gsm modem next function will be
performed. Commands given to the gsm modem are through the sms, which
is sent by the user or any gsm subscriber.
AT commands are sent to gsm modem to operate the devices and switch
on and switch off on loads, devices etc,
According to the commands received from the modem to micro controller,
micro controller will read the sms(message) which is in the memory of the
micro controller, it follows the commands like switch on and switch off the
devices which are connected to the micro controller.
Port o of the micro controller is connected to Lcd display, port 0 is
connected to pull up resisters, the out put of port 0 is open drain configured so
the value of 10K is connected to port 0. Read, write, enable pins of micro
controller are connected to the write, read, EA pins of the LCD display.
In this project dc motor, led is used as a peripherals. These two devices
are switched on and switched off, according to the message received from
5
the user the modem will sends that signals to micro controller. Micro controller
will drive all the peripherals which are connected to the micro controller.
Commands which are used in gsm modem are called as AT commands.
To switch on the led .........................................#LON!
To switch off the led...........................................#LOF!
To switch on the dc motor................................ #FON!
To switch off the dc motor..................................#FOF!
6
5. LIST OF COMPONENTS
RESISTORS:
1 KΩ-----------------1 no.
8.2 kΩ----------------1 no.
CAPACITORS:
22 µf----------------2 no.
10 µf----------------3 no.
30 pf----------------2 no.
Semiconductors:
Max 232 ------------------IC 1 no.
89c51 -----------------------IC 1 no.
Crystal---------------------1 no.
Diodes (1n4007) ----------1 no.
Regulator (7805) ----------1 no.
Miscellaneous:
Dc motor(5v)---------------1 no.
Db 9 connecter pin--------2 no.
2x16 LCD display----------1 no.
Gsm modem----------------1 no.
5.1 Global System for Mobile Communication (GSM) :
7
Definition:
GSM, which stands for Global System for Mobile communications,
reigns (important) as the world’s most widely used cell phone technology. Cell
phones use a cell phone service carrier’s GSM network by searching for cell
phone towers in the nearby area. Global system for mobile communication
(GSM) is a globally accepted standard for digital cellular communication.
GSM is the name of a standardization group
established in 1982 to create a common European mobile telephone standard
that would formulate specifications for a pan-European mobile cellular radio
system operating at 900 MHz. It is estimated that many countries outside of
Europe will join the GSM partnership.
Need of GSM:
The GSM study group aimed to provide the followings through the GSM:
Improved spectrum efficiency.
International roaming.
Low-cost mobile sets and base stations (BS)
High-quality speech
Compatibility with Integrated Services Digital Network (ISDN) and other
telephone company services.
Support for new services.
8
GSM Brief History:
Following table shows many of the important events in the
rollout of the GSM system; other events were introduced, but had less
significant impact on the overall systems.
Years Events
1982CEPT establishes a GSM group in order to develop the standards
for a pan-European cellular mobile system.
1985A list of recommendations to be generated by the group is
accepted.
1986Field tests are performed to test the different radio techniques
proposed for the air interface.
1987
Time Division Multiple Access (TDMA) is chosen as the access
method (with Frequency Division Multiple Access [FDMA]). The initial
Memorandum of Understanding (MoU) is signed by telecommunication
operators representing 12 countries.
1988 GSM system is validated.
1989The responsibility of the GSM specifications is passed to the
European Telecommunications Standards Institute (ETSI).
1990 Phase 1 of the GSM specifications is delivered.
1991Commercial launch of the GSM service occurs. The DCS1800
specifications are finalized.
1992
The addition of the countries that signed the GSM Memorandum of
Understanding takes place. Coverage spreads to larger cities and
airports.
1993 Coverage of main roads' GSM services starts outside Europe.
1994 Data transmission capabilities launched. The number of networks
9
raises to 69 in 43 countries by the end of 1994.
1995Phase 2 of the GSM specifications occurs. Coverage is extended to
rural areas.
1996 June: 133 network in 81 countries operational.
1997July: 200 network in 109 countries operational, around 44 million
subscribers worldwide.
1999Wireless Application Protocol came into existence and 130
countries operational with 260 million subscribers
2000 General Packet Radio Service (GPRS) came into existence.
2001As of May 2001, over 550 million people were subscribers to mobile
telecommunications
The GSM Specifications:
Specifications for different Personal Communication Services
(PCS) systems vary among the different PCS networks. The GSM
specification is listed below with important characteristics.
Modulation:
Modulation is a form of change process where we change the input
information into a suitable format for the transmission medium. We also
changed the information by demodulating the signal at the receiving end.
The GSM uses Gaussian Minimum Shift Keying (GMSK) modulation
method.
Access Methods:
Because radio spectrum is a limited resource shared by all users,
a method must be devised to divide up the bandwidth among as many users
as possible.
10
GSM chose a combination of TDMA/FDMA as its method. The
FDMA part involves the division by frequency of the total 25 MHz bandwidth
into 124 carrier frequencies of 200 kHz bandwidth.
One or more carrier frequencies are then assigned to each BS.
Each of these carrier frequencies is then divided in time, using a TDMA
scheme, into eight time slots. One time slot is used for transmission by the
mobile and one for reception. They are separated in time so that the mobile
unit does not receive and transmit at the same time.
Transmission Rate:
The total symbol rate for GSM at 1 bit per symbol in GMSK produces
270.833 K symbols/second. The gross transmission rate of the time slot is
22.8 Kbps.
GSM is a digital system with an over-the-air bit rate of 270 kbps.
Frequency Band:
The uplink frequency range specified for GSM is 933 - 960 MHz
(basic 900 MHz band only). The downlink frequency band 890 - 915 MHz
(basic 900 MHz band only).
Channel Spacing:
This indicates separation between adjacent carrier frequencies. In
GSM, this is 200 kHz.
Speech Coding:
GSM uses linear predictive coding (LPC). The purpose of LPC is to
reduce the bit rate. The LPC provides parameters for a filter that mimics the
vocal tract. The signal passes through this filter, leaving behind a residual
signal. Speech is encoded at 13 kbps.
Duplex Distance:
The duplex distance is 80 MHz. Duplex distance is the distance
between the uplink and downlink frequencies. A channel has two frequencies,
80 MHz apart.
Misc:
Frame duration: 4.615 ms
11
Duplex Technique: Frequency Division Duplexing (FDD) access mode
previously known as WCDMA.
Speech channels per RF channel: 8.
Send SMS using AT commandsSome advanced GSM modems like WaveCom and Multitech, support the SMS text mode. This mode allows you to send SMS messages using AT commands, without the need to encode the binairy PDU field of the SMS first. This is done by the GSM modem
Check if your GSM phone or modem supports SMS text mode:To check if your modem supports this text mode, you can try the following command:
AT+CMGF=1 <ENTER>
If the modem reponds with "OK" this mode is supported. Please note that using this mode it is onluy possible to send simple text messages. It is not possible to send multipart, Unicode, data and other types of messages.
Setting up the modemIf the modem contains a SIM card with is secured with a PIN code, we
have to enter this pin code first:
AT+CPIN="0000" <ENTER> (replace 0000 with your PIN code).
Please not that in most cases you have only 3 attemps to set the correct PIN
code. After setting the PIN code, wait some seconds before issueing the next
command to give the modem some time to register with the GSM network.
In order to send a SMS, the modem has to be put in SMS text mode first using
the following command:
AT+CMGF=1<ENTER>
In text mode there are some additional parameters that can be set.
Using the following command we can read the current values:
12
AT+CSMP?<ENTER>
The modem will response with a string like this:
+CSMP: 1, 169, 0, 0
OK
To send a message with a validity period of 1 day, the parameters have to be
set like this:
Bit 0 and 4 of the first field has to be set, so the first value will become 1 + 16
= 17.
Send the following command to the modem to set this parameters:
AT+CSMP=17,167,0,16 <ENTER>
If the modem responds with "OK" ,the modem is ready to send (flash) text
messages with a validity period of 1 day.
Sending the message
To send the SMS message, type the following command:
AT+CMGS="+31638740161" <ENTER>
Replace the above phone number with your own cell phone number. The
modem will respond with:
>
You can now type the message text and send the message using the
<CTRL>-<Z> key combination:
Hello World ! <CTRL-Z>
13
After some seconds the modem will respond with the message ID of the
message, indicating that the message was sent correctly:
+CMGS: 62
The message will arrive on the mobile phone shortly.
Sending an Unicode SMS message
Some modems also have the capability to send Unicode or UCS2
messages without encoding a PDU.
You can send Unicode messages by only converting the Unicode data to a
HEX string and send this string to the modem.
To check whether your modem supports this mode, just type the following
command:
AT+CSCS=?
This commands displays the codepages supported by the modem. The
modem will respond like this:
+CSCS: ("GSM","PCCP437","CUSTOM","HEX")
If this string contains "HEX" or "UCS2", Unicode seems to be supported.
To specify that you will use an HEX string to send the message, set the
codepage to "HEX" or "UCS2" depending on the modem response.
In our example we will set the modem to "HEX" :
AT+CSCS="HEX" <ENTER>
Next, we have to specify the correct DCS (Data Coding Scheme) for
Unicode messages, which is 0x08. We can set this value by changing the
fourth parameter of the AT+CSMP command to '8':
AT+CSMP=1,167,0,8 <ENTER>
14
The modem is now ready to send messages as Unicode. Now is the time
to send the actual message:
AT+CMGS="+31638740161" <ENTER>
Replace the above phone number with your own cell phone number. The
modem will respond with:
>
The only thing you have to program by yourself, is a simple routine which
converts the Unicode string to an hexadecimal string like this:
Which is 'Hello' in Arabic will be converted like this:
"06450631062D06280627"
You can send this hexidecimal string to the modem:
06450631062D06280627 <CTRL-Z>
after some seconds the modem will respond with the message ID of the
message, indicating that the message was sent correctly:
+CMGS: 63
The message will arrive on the mobile phone shortly.
15
MICRO CONTROLLERS:
The first microprocessor introduced in 1981/1971, was made possible by
high levels of integration of digital circuits. Continued integration of peripherals
and memory on the same integrated circuit as the microprocessor core led to
the creation of micro controllers.
A micro controller is an integrated circuit composed of a CPU, various
peripheral devices, and typically memory, all in one chip. Using one chip that
contains all the necessary functions in place of a microprocessor and multiple
peripheral chips has reduced the size and the power consumption of control
oriented applications. A micro controller is different from a microprocessor
both in hardware and software. In hardware it includes peripherals such as
I/O, memory, and analog and digital interface. Micro controllers are more
suited for small applications with specific control functions requiring
specialized peripherals and interfaces. They are designed for process control
and are required to interface to the real world processes.
Many of the peripheral devices integrated on a micro controller are for that
specific purpose. Analog to digital converters perform the task of converting
an analog signal to digital for use by the CPU, and digital to analog converters
perform the task of converting digital data into analog value and waveforms to
control analog functions.
In addition to the analog interface, micro controllers contain peripheral
devices that enable them to communicate to other digital components within a
system or to monitor and control digital functions. Communication interfaces,
digital I/O and interrupt controllers fall into this category of peripheral devices.
Other peripheral devices often included on the same chip include clocks and
timers.
In terms of the software, micro controllers have a more compact set of
instructions with commands more suited to process control such as input and
output from. Single bit operations such as set and reset, bit-wise logical
functions or branching instructions that depend on a single bit are commonly
16
available as part of the instruction set to allow for reading input switch status
or on/off control of an external event. Since in a given application the micro
controller is programmed for one task, it only has one control program.
In a microprocessor based system various programs are stored in a mass
storage device and then loaded into the RAM for execution. In contrast the
micro controller program is typically stored in a ROM or PROM and RAM is
used for temporary storage of data.Compared with discrete implementation of
a system, the micro controller based approach provides shorter system
development time, reduced implementation cost, lower power consumption,
and higher reliability.
The only drawback, which is often not important, is the lower speed of
execution. For example, for a micro controller system to perform a logical
operation, several clock cycles are needed to read the inputs, perform the
function and output the results. The same operation when implemented with
discrete components will provide the results as soon as the signals have
propagated through the logic gates.
Micro-controllers are used in a variety of process control applications,
replacing complex digital circuits and sometimes-analog functions while
providing more flexibility due to their programmability. Portable electronic
devices such as personal audio devices (CD players, MP3 players), mobile
telephones, digital cameras and video camcorders rely heavily on the reduced
size and low power consumption of micro controller based electronics.
These features are crucial to applications like implantable medical devices
such as pacemakers, or personal medical monitoring devices like gluco
meters (electronic devices used for the measurement of blood glucose).
In other applications such as appliances, home audio and video,
automotive, power management, and temperature control, using a micro
controller results in reduced board level circuit complexity and consequently
reduced cost. With the growing number of applications using micro controllers,
it is not surprising that there are such a wide variety of these components. In
17
addition to those commonly available, many manufacturers custom-design a
micro controller to suit a specific application.
Architecture
Architecturally all micro controllers share certain features. They all contain
a CPU, memory and I/O on the same chip. Another common feature is the
interrupt handling capability. What sets them apart from one another is the
choice of CPU, the structure of memory, and choice of peripheral devices, I/O
and interrupt handling hardware. The major distinguishing architectural
characteristic of micro controllers is the word size. Micro-controllers are
available in 4, 8, 16, or 32 bit wide words. The width of the data path impacts
several features of the micro controller. The complexity of the instruction set
(number of available instructions and addressing modes), program efficiency
(code generation and storage space), execution speed, as well as chip
implementation and interfacing complexity are all influenced by the width of
the data path.
For simple control tasks 4-bit, and for a vast number of control and
measurement applications 8-bit micro controllers would be sufficient. For
higher precision and speed applications like speech and video processing, or
complex instrumentation, 16-bit and 32-bit micro controllers are more
appropriate.
Another distinction between micro controllers is the instruction set. Micro-
controllers with complex instruction set (CISC) provide capability to perform
complex computations rapidly. The extensive set of instructions, allow
complex operations to be performed with few instructions. On the other hand
reduced instruction set computers (RISC) decrease program execution time
by having fewer less complex instructions. Fewer available instructions results
18
in faster execution due to smaller size of the op-code and less decoding time
needed for each instruction.
The trade-off depends on the complexity of operations needed for a
specific application. In simple control applications a RISC based micro
controller is more suitable because of its lower overhead for each instruction.
In more complex applications, the availability of a more diverse instruction set
results in a more efficient and faster executing code because fewer
instructions are needed to accomplish a complicated task. For micro controller
applications the instruction set should include common computational
instructions plus instructions optimized for the specific application at hand.
Just as in microprocessors, micro controllers are also differentiated
according to their memory structure. Von Neumann architecture maps the
data and program to same memory address space. In the Harvard
architecture the instructions are stored in a separate memory space than that
used for data storage. Another memory related architectural characteristic of a
processor is the addressing scheme. In linear addressing there is a one to one
correspondence between an address and a memory location. So with an 8-bit
address register, 28 distinct address locations can be accessed.
In segmented addressing a separate register is used to point to a segment
in memory, and the address register is used to point to an offset from that
segment’s start point. This way if all of the program or data are in the same
segment, in order to access them, only the address register need to be used
and the segment register can remain pointing to the start point of that
segment.
Widely used group of micro controllers is Intel’s MCS51 family. These
micro controllers are also 8-bit processors, but with a separate 64Kbyte of
data and 64Kbyte of program memory space. As implied by this statement,
devices in the MCS51 utilize Harvard architecture. All of I/O addresses as well
as CPU registers and various peripheral devices’ registers are mapped in the
same space as the data.
19
The 8051, which is one of the options in this family, has 5 interrupt
sources, 2 external, two timer interrupts and one serial port interrupt. Interrupt
priority is resolved through a priority scheme and ranking in the polling
sequence. The priority scheme allows each interrupt to be programmed to one
of two priority levels.
Furthermore if two interrupts with the same priority occur simultaneously,
they are serviced based on their rank in the polling sequence. Other
manufacturers such as AMD, Dallas Semiconductor, Fujitsu and Philips also
supply micro controllers in the MCS51 family. Dallas Semiconductor’s
DC87C550 provides increased performance over Intel’s 8051 while
maintaining instruction set compatibility. Many instructions that execute in 12
CPU clock cycles in an 8051, will execute in only 4 clocks for the DC87C550
therefore resulting in increased execution speeds of up to three times.
Additionally, the DC87C550 has a power management mode that allows
slowing of the processor in order to reduce power consumption. This mode
can be utilized in battery operated or otherwise low power applications. The
architecture of the instruction set varies greatly from one micro controller to
another. The choices made in designing the instruction set impact program
memory space usage, code execution speed, and ease of programming.
5.2. Micro controller (at 89c51):
Features
Compatible with MCS-51™ Products
4K Bytes of In-System Reprogrammable Flash Memory
Endurance: 1,000 Write/Erase Cycles
Fully Static Operation: 0 Hz to 24 MHz
Three-level Program Memory Lock
128 x 8-bit Internal RAM
32 Programmable I/O Lines
Two 16-bit Timer/Counters
20
Six Interrupt Sources
Programmable Serial Channel
Low-power Idle and Power-down Modes
Description
The AT89C51 is a low-power, high-performance CMOS 8-bit
microcomputer with 4K
Bytes of Flash programmable and erasable read only memory (PEROM).
The device
Is manufactured using Atmel’s high-density non-volatile memory
technology and is
Compatible with the industry-standard MCS-51 instruction set and pin out.
The on-chip Flash allows the program memory to be reprogrammed in-system
or by a conventional non-volatile memory programmer. By combining a
versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a
powerful microcomputer which provides a highly-flexible and cost-effective
solution to many embedded control applications.
The AT89C51 provides the following standard features: 4K bytes of Flash,
128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, five vector two-level
interrupt architecture, a full duplex serial port, on-chip oscillator and clock
circuitry. In addition, the AT89C51 is designed with static logic for operation
down to zero frequency and supports two software selectable power saving
modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters,
serial port and interrupt system to continue functioning. The Power-down
Mode saves the RAM contents but freezes the oscillator disabling all other
chip functions until the next hardware reset.
21
Fig: pin diagram:
Pin Description:
VCC:
Supply voltage.
GND:
Ground.
Port 0:
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each
pin can sink eight TTL inputs. When 1sare written to port 0 pins, the pins can
be used as high impedance inputs. Port 0 may also be configured to be the
multiplexed low order address/data bus during accesses to external program
and data memory. In this mode P0 has internal pull-ups. Port 0 also receives
the code bytes during Flash programming, and outputs the code bytes during
22
program verification. External pull-ups are required during program
verification.
Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written to Port 1
pins they are pulled high by the internal pull-ups and can be used as inputs.
As inputs, Port 1 pins that are externally being pulled low will source current
(IIL) because of the internal pull-ups. Port 1 also receives the low-order
address bytes during Flash programming and verification.
Port 2:
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port 2
pins they are pulled high by the internal pull-ups and can be used as inputs.
As inputs, Port 2 pins that are externally being pulled low will source current
(IIL) because of the internal pull-ups. Port 2 emits the high-order address byte
during fetches from external program memory and during accesses to external
data memories that use 16-bit addresses (MOVX @DPTR). In this application,
it uses strong internal pull-ups when emitting 1s. During accesses to external
data memories that use 8-bit addresses (MOVX @ RI), Port 2 emits the
contents of the P2 Special Function Register. Port 2 also receives the high-
order address bits and some control signals during Flash programming and
verification.
Port 3:
Port 3 is an 8-bit bi-directional I/O port with internal pullups.The Port 3
output buffers can sink/source four TTL inputs. 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 AT89C51
as listed below:
23
Port 3 also receives some control signals for Flash programming and
verification
Tab 6.2.1 Port pins and their alternate functions
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.
ALE/PROG:
Address Latch Enable output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input
(PROG) during Flash programming. In normal operation ALE is emitted at a
constant rate of 1/6the oscillator frequency, and may be used for external
timing or clocking purposes. Note, however, that one ALE pulse is skipped
during each access to external Data Memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location
8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction.
Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.
PSEN:
Program Store Enable is the read strobe to external program memory.
When the AT89C51 is executing code from external program memory, PSEN
24
is activated twice each machine cycle, except that two PSEN activations are
skipped during each access to external data memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable
the device to fetch code from external program memory locations starting at
0000H up to FFFFH.
Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset.
EA should be strapped to VCC for internal program executions. This pin
also receives the 12-volt programming enable voltage (VPP) during Flash
programming, for parts that require 12-volt VPP.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2:
Output from the inverting oscillator amplifier.
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier which can be configured for use as an on-chip oscillator, as shown in
Figs 6.2.3. Either a quartz crystal or ceramic resonator may be used. To drive
the device from an external clock source, XTAL2 should be left unconnected
while XTAL1 is driven as shown in Figure 6.2.4.There are no requirements on
the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and
maximum voltage high and low time specifications must be observed.