Professional Documents
Culture Documents
System Description: Microcontroller (AT89S52)
System Description: Microcontroller (AT89S52)
System Description:
7.1 Microcontroller (AT89S52):-
7.1.1. Description:
The AT89S52 is a low power, high performance CMOS 8-bit microcontroller with 8K
byte of in-system programmable Flash Memory. The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By
combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the
Atmel AT89S52 is powerful microcontroller which provides a highly-flexible and cost-effective
solution to many embedded control application. It is 8 bit microcontroller with 8K bytes in
system programmable flash. In addition the AT89S52 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/counter, serial port, and interrupts system
to continue functioning. The Power-down mode saves the RAM contents but freezes the
oscillator, disabling all other chip functions until the next interrupt or hardware reset. It is 40 Pin
IC.
A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a
single integrated circuit containing a processor core, memory, and programmable input/output
peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on
chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded
applications, in contrast to the microprocessors used in personal computers or other general
purpose applications.
Microcontrollers are used in automatically controlled products and devices, such as automobile
engine control systems, implantable medical devices, remote controls, office machines,
appliances, power tools, and toys. By reducing the size and cost compared to a design that uses
a separate microprocessor, memory, and input/output devices, microcontrollers make it
economical to digitally control even more devices and processes. Mixed signal
microcontrollers are common, integrating analog components needed to control non-digital
electronic systems.
Some microcontrollers may use four-bit words and operate at clock rate frequencies as low as
4 kHz , for low power consumption (mill watts or microwatts). They will generally have the
ability to retain functionality while waiting for an event such as a button press or other
interrupt; power consumption while sleeping (CPU clock and most peripherals off) may be just
nanowatts , making many of them well suited for long lasting battery applications. Other
microcontrollers may serve performance-critical roles, where they may need to act more like
a digital signal processor (DSP), with higher clock speeds and power consumption.
A microcontroller can be considered a self-contained system with a processor, memory and
peripherals and can be used as an embedded system. The majority of microcontrollers in use
today are embedded in other machinery, such as automobiles, telephones, appliances, and
peripherals for computer systems. These are called embedded systems. While some embedded
systems are very sophisticated, many have minimal requirements for memory and program
length, with no operating system, and low software complexity. Typical input and output
devices include switches, relays, solenoids, LEDs, small or custom LCD displays, radio
frequency devices, and sensors for data such as temperature, humidity, light level etc.
Embedded systems usually have no keyboard, screen, disks, printers, or other recognizable I/O
devices of a personal computer, and may lack human interaction devices of any kind.
Microcontroller programs must fit in the available on-chip program memory, since it would be
costly to provide a system with external, expandable, memory. Compilers and assemblers are
used to convert high-level language and assembler language codes into a compact machine for
storage in the microcontroller's memory. Depending on the device, the program memory may
be permanent, read-only memory that can only be programmed at the factory, or program
memory may be field-alterable flash or erasable read-only memory.
Types of Microcontroller
ARM processors (from many vendors) using ARM7 or Cortex-M3
PIC (8-bit PIC16, PIC18, 16-bit dsPIC33 / PIC24)
Atmel AVR (8-bit), AVR32 (32-bit), and AT91SAM (32-bit)
The Intel 8051 is an 8-bit microcontroller which means that most available operations are
limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended. The
Short and Standard chips are often available in DIP (dual in-line package) form, but the
Extended 8051 models often have a different form factor, and are not "drop-in compatible". All
these things are called 8051 because they can all be programmed using 8051 assembly
language, and they all share certain features (although the different models all have their own
special features).
Features:
Some of the features that have made the 8051 popular are:
8 KB on chip program memory.
128 bytes on chip data memory (RAM).
4 register banks.
128 user defined software flags.
8-bit data bus
16-bit address bus
32 general purpose registers each of 8 bits
16 bit timers (usually 2, but may have more, or less).
3 internal and 2 external interrupts.
Bit as well as byte addressable RAM area of 16 bytes.
Four 8-bit ports, (short models have two 8-bit ports).
16-bit program counter and data pointer.
1 Microsecond instruction cycle with 12 MHz Crystal.
PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only connect a
crystal at these pins to provide clock pulses to the circuit.
PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip needs +5V
500mA to function properly, although there are lower powered versions like the Atmel 2051
which is a scaled down version of the 8051 which runs on +3V.
PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in flash
memory. In order to program this we need to supply a voltage of +12V at pin 31. If external
memory is connected then PIN 31, also called EA/VPP, should be connected to ground to
indicate the presence of external memory. PIN 30 is called ALE (address latch enable), which
is used when multiple memory chips are connected to the controller and only one of them
needs to be selected. We will deal with this in depth in the later chapters. PIN 29 is called
PSEN. This is "program select enable". In order to use the external memory it is required to
provide the low voltage (0) on both PSEN and EA pins.
Ports
There are 4 8-bit ports: P0, P1, P2 and P3.
PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which can be used
for a variety of interfacing tasks. The other ports P0, P2 and P3 have dual roles or additional
functions associated with them based upon the context of their usage.
PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has additional
functions such as, serial transmit and receive pins, 2 external interrupt pins, 2 external counter
inputs, read and write pins for memory access.
PORT P2 (pins 21 to 28): PORT P2 can also be used as a general purpose 8 bit port when no
external memory is present, but if external memory access is required then PORT P2 will act as
an address bus in conjunction with PORT P0 to access external memory. PORT P2 acts as A8-
A15, as can be seen from fig
PORT P0 (pins 32 to 39): PORT P0 can be used as a general purpose 8 bit port when no
external memory is present, but if external memory access is required then PORT P0 acts as a
multiplexed address and data bus that can be used to access external memory in conjunction
with PORT P2. P0 acts as AD0-AD7.
7.1.2 74LS04:
Description:-
This Device contains six independent gates each of which performs the logic INVERT function.
Connection Diagram:-
Features
• Guaranteed linearity: 0.01% max.
• Low power dissipation: 15mW at 5V
• Wide range of full scale frequency: 1Hz to 100 KHz
• Pulse output compatible with all logic forms
• Wide dynamic range: 100dB min at 10 KHz full scale frequency
LM
331
Applications
• Active filters
• General purpose low voltage applications
• General purpose portable devices
7.1.6 MOC 3011:
Description:
The MOC3011 series is optically isolated triac driver devices. This device contains a GaAs
infrared emitting diode and a light activated silicon bilateral switch, which functions like a
triac. They designed for interfacing between electronic controls and power triacs to control
resistive and inductive loads for 115/240 VAC operations.
Features:
• Excellent IFT stability
• High isolation voltage
• Underwriters Laboratory (UL) recognized
• Peak blocking voltage
• VDE recognized
Applications:
• Industrial controls
• Solenoid/valve controls
• Traffic lights
• Static AC power switch
• Vending machines
• Incandescent lamp dimmers
• Solid state relay
• Motor control
• Lamp ballasts
Features:
- Photo detector and preamplifier in one package.
- Internal filter for PCM frequency
- Low power consumption
- High immunity against ambient light
- Improved shielding against electrical field disturbance
- Continuous data transmission possible (up to 2400 bps
- TTL and CMOS compatibility
- 10 cycles/burst
- Output active low
Figure: TSOP1738
7.1.8 LM 7806:
Description:
The bay linear LM7806 is linear positive linear regulator with three terminals. The LM7806
offer several fixed output voltages making them useful in wide them useful in wide range of
applications. When used as a zener diode/resistor combination replacement, the LM 7806
usually results in effective output impedance improvement of two orders of magnitude lower
quiescent current.
The LM 7806 is available in the TO-252, TO-220, &TO-263 Packages.
Features:
Output Current is 1.5A
Output Voltage tolerance is 5%
Internal thermal overload protection
Internal Short-Circuit Limited
No External Component
Output Voltage 5.0V- 6V
Offer in plastic TO-252, TO-220 & TO-263
Direct Replacement for LM7806.
Applications:
- Post regulator for switching DC/DC convertor.
- Bias supply for analog circuits
7.1.9.3GSM services
Speech or voice calls are obviously the primary function for the GSM cellular system. To
achieve this speech is digitally encoded and later decoded using a vocoder. A variety of
vocoders are available for use, being aimed at different scenarios.
In addition to the voice services, GSM cellular technology supports a variety of other data
services. Although their performance is nowhere near the level of those provided by 3G, they
are nevertheless still important and useful. A variety of data services are supported with user
data rates up to 9.6 kbps. Services including Group 3 facsimile, videotext and teletex can be
supported.
One service that has grown enormously is the short message service. Developed as part of the
GSM specification, it has also been incorporated into other cellular technologies. It can be
thought of as being similar to the paging service but is far more comprehensive allowing bi-
directional messaging, store and forward delivery, and it also allows alphanumeric messages of
a reasonable length. This service has become particularly popular, initially with the young as it
provided a simple, low fixed cost.
The resulting GSM cellular technology that was developed provided for all of these. The
overall system definition for GSM describes not only the air interface but also the network or
infrastructure technology. By adopting this approach it is possible to define the operation of the
whole network to enable international roaming as well as enabling network elements from
different manufacturers to operate alongside each other, although this last feature is not
completely true, especially with older items.
GSM cellular technology uses 200 kHz RF channels. These are time division multiplexed to
enable up to eight users to access each carrier. In this way it is a TDMA / FDMA system.
The base transceiver stations (BTS) are organized into small groups, controlled by a base
station controller (BSC) which is typically co-located with one of the BTSs. The BSC with its
associated BTSs is termed the base station subsystem (BSS).
Further into the core network is the main switching area. This is known as the mobile
switching centre (MSC). Associated with it is the location registers, namely the home location
register (HLR) and the visitor location register (VLR) which track the location of mobiles and
enable calls to be routed to them. Additionally there is the Authentication Centre (AuC), and
the Equipment Identify Register (EIR) that are used in authenticating the mobile before it is
allowed onto the network and for billing. The operation of these are explained in the following
pages.
Last but not least is the mobile itself. Often termed the ME or mobile equipment, this is the
item that the end user sees. One important feature that was first implemented on GSM was the
use of a Subscriber Identity Module. This card carried with it the users identity and other
information to allow the user to upgrade a phone very easily, while retaining the same identity
on the network. It was also used to store other information such as "phone book" and other
items. This item alone has allowed people to change phones very easily, and this has fuelled
the phone manufacturing industry and enabled new phones with additional features to be
launched. This has allowed mobile operators to increase their average revenue per user
(ARPU) by ensuring that users are able to access any new features that may be launched on the
network requiring more sophisticated phones.
Base Transceiver Station (BTS): The BTS used in a GSM network comprises the radio
transmitter receivers, and their associated antennas that transmit and receive to directly
communicate with the mobiles. The BTS is the defining element for each cell. The BTS
communicates with the mobiles and the interface between the two is known as the Um
interface with its associated protocols.
Base Station Controller (BSC): The BSC forms the next stage back into the GSM network.
It controls a group of BTSs, and is often co-located with one of the BTSs in its group. It
manages the radio resources and controls items such as handover within the group of BTSs,
allocates channels and the like. It communicates with the BTSs over what is termed the Abis
interface.
7.1.10.3 Network Switching Subsystem (NSS)
The GSM network subsystem contains a variety of different elements, and is often termed the
core network. It provides the main control and interfacing for the whole mobile network. The
major elements within the core network include:
Mobile Switching services Centre (MSC): The main element within the core network area
of the overall GSM network architecture is the Mobile switching Services Centre (MSC). The
MSC acts like a normal switching node within a PSTN or ISDN, but also provides additional
functionality to enable the requirements of a mobile user to be supported. These include
registration, authentication, call location, inter-MSC handovers and call routing to a mobile
subscriber. It also provides an interface to the PSTN so that calls can be routed from the mobile
network to a phone connected to a landline. Interfaces to other MSCs are provided to enable
calls to be made to mobiles on different networks.
Home Location Register (HLR): This database contains all the administrative information
about each subscriber along with their last known location. In this way, the GSM network is
able to route calls to the relevant base station for the MS. When a user switches on their phone,
the phone registers with the network and from this it is possible to determine which BTS it
communicates with so that incoming calls can be routed appropriately. Even when the phone is
not active (but switched on) it re-registers periodically to ensure that the network (HLR) is
aware of its latest position. There is one HLR per network, although it may be distributed
across various sub-centres to for operational reasons.
Visitor Location Register (VLR): This contains selected information from the HLR that
enables the selected services for the individual subscriber to be provided. The VLR can be
implemented as a separate entity, but it is commonly realised as an integral part of the MSC,
rather than a separate entity. In this way access is made faster and more convenient.
Equipment Identity Register (EIR): The EIR is the entity that decides whether a given
mobile equipment may be allowed onto the network. Each mobile equipment has a number
known as the International Mobile Equipment Identity. This number, as mentioned above, is
installed in the equipment and is checked by the network during registration. Dependent upon
the information held in the EIR, the mobile may be allocated one of three states - allowed onto
the network, barred access, or monitored in case its problems.
Authentication Centre (AuC): The AuC is a protected database that contains the secret key
also contained in the user's SIM card. It is used for authentication and for ciphering on the
radio channel.
Gateway Mobile Switching Centre (GMSC): The GMSC is the point to which a ME
terminating call is initially routed, without any knowledge of the MS's location. The GMSC is
thus in charge of obtaining the MSRN (Mobile Station Roaming Number) from the HLR based
on the MSISDN (Mobile Station ISDN number, the "directory number" of a MS) and routing
the call to the correct visited MSC. The "MSC" part of the term GMSC is misleading, since the
gateway operation does not require any linking to an MSC.
SMS Gateway (SMS-G): The SMS-G or SMS gateway is the term that is used to collectively
describe the two Short Message Services Gateways defined in the GSM standards. The two
gateways handle messages directed in different directions. The SMS-GMSC (Short Message
Service Gateway Mobile Switching Centre) is for short messages being sent to an ME. The
SMS-IWMSC (Short Message Service Inter-Working Mobile Switching Centre) is used for
short messages originated with a mobile on that network. The SMS-GMSC role is similar to
that of the GMSC, whereas the SMS-IWMSC provides a fixed access point to the Short
Message Service Centre.
Features
• 0.6 mA to 15 mA operating current
• 0.8Ω dynamic impedance at any current
• Available with temperature coefficient of 0.01%/°C
• 7μV wideband noise
• 5% initial tolerance
• 0.002% long term stability
• Low cost
• Subsurface zener