Microcontroller

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

8.

MICROCONTROLLER
A microcontroller is a self-contained system with peripherals, memory and a
processor that can be used as an embedded system. Most programmable
microcontrollers that are used today are embedded in other consumer products
or machinery including phones, peripherals, automobiles and household
appliances for computer systems. Due to that, another name for a
microcontroller is "embedded controller." Some embedded systems are more
sophisticated, while others have minimal requirements for memory and
programming length and a low software complexity. Input and output devices
include solenoids, LCD displays, relays, switches and sensors for data like
humidity, temperature or light level, amongst others.

A microcontroller is a small and low-cost computer built for the purpose of dealing
with specific tasks, such as displaying information in a microwave LED or receiving
information from a televisions remote control. Microcontrollers are mainly used in
products that require a degree of control to be exerted by the user

Microcontroller v/s microprocessor

Microprocessors are used to execute big and generic applications, while


a microcontroller will only be used to execute a single task within one
application. Some of the benefits of microcontrollers include the
following:

Cost advantage: The biggest advantage of microcontrollers against


larger microprocessors is that the design and hardware costs are much

lesser and can be kept to a minimum. A microcontroller is cheap to


replace, while microprocessors are ten times more expensive.

Lesser power usage: Microcontrollers are generally built using a


technology known as Complementary Metal Oxide Semiconductor
(CMOS). This technology is a competent fabrication system that uses
less power and is more immune to power spikes than other techniques.

All-in-one: A microcontroller usually comprises of a CPU, ROM, RAM


and I/O ports, built within it to execute a single and dedicated task. On
the other hand, a microprocessor generally does not have a RAM, ROM
or IO pins and generally uses its pins as a bus to interface to peripherals
such as RAM, ROM, serial ports, digital and analog IO. Read more about
the

Difference between Microprocessor and Microcontroller


The term microprocessor and microcontroller have always been
confused with each other. Both of them have been designed for real time
application. They share many common features and at the same time
they have significant differences. Both the ICs i.e., the microprocessor
and microcontroller cannot be distinguished by looking at them. They
are available in different version starting from 6 pin to as high as 80 to
100 pins or even higher depending on the features.

Difference between microprocessor and microcontroller


Microprocessor is an IC which has only the CPU inside them i.e. only the
processing powers such as Intels Pentium 1,2,3,4, core 2 duo, i3, i5 etc.
These microprocessors dont have RAM, ROM, and other peripheral on
the chip. A system designer has to add them externally to make them
functional. Application of microprocessor includes Desktop PCs,
Laptops, notepads etc.

But this is not the case with Microcontrollers. Microcontroller has a CPU,
in addition with a fixed amount of RAM, ROM and other peripherals all
embedded on a single chip. At times it is also termed as a mini computer
or a computer on a single chip. Today different manufacturers produce
microcontrollers with a wide range of features available in different
versions. Some manufacturers are ATMEL, Microchip, TI, Freescale,
Philips, Motorola etc.

Microcontrollers are designed to perform specific tasks. Specific means


applications where the relationship of input and output is defined.
Depending on the input, some processing needs to be done and output
is delivered. For example, keyboards, mouse, washing machine,
digicam, pendrive, remote, microwave, cars, bikes, telephone, mobiles,

watches, etc. Since the applications are very specific, they need small
resources like RAM, ROM, I/O ports etc and hence can be embedded on
a single chip. This in turn reduces the size and the cost.

Microprocessor find applications where tasks are unspecific like


developing

software,

games,

websites,

photo

editing,

creating

documents etc. In such cases the relationship between input and output
is not defined. They need high amount of resources like RAM, ROM, I/O
ports etc.
The clock speed of the Microprocessor is quite high as compared to the
microcontroller. Whereas the microcontrollers operate from a few MHz to
30 to 50 MHz, todays microprocessor operate above 1GHz as they
perform complex tasks. Read more about what is microcontroller.

Comparing microcontroller and microprocessor in terms of cost is


not justified. Undoubtedly a microcontroller is far cheaper than a
microprocessor. However microcontroller cannot be used in place of
microprocessor and using a microprocessor is not advised in place of a
microcontroller as it makes the application quite costly. Microprocessor
cannot be used stand alone. They need other peripherals like RAM,

ROM, buffer, I/O ports etc and hence a system designed around a
microprocessor is quite cost

How does a Microcontroller work?

Microcontroller has an input device in order to get the input and an


output device (such as LED or LCD Display) to exhibit the final process.
Let us look into the illustration of how a microcontroller works in a
Television.

The Television has a remote control as an Input device and the TV


screen as the output device. The signal sent from the remote control is
captured by the microcontroller. The microcontroller controls the channel
selection, the amplifier system and picture tube adjustments such as
hue, brightness, contrast etc.
General architecture of a microcontroller

The architecture of a microcontroller depends on the application it is built


for. For example, some designs include usage of more than one RAM,
ROM and I/O functionality integrated into the package.

The architecture of a typical microcontroller is complex and may include


the following:
1. A CPU, ranging from simple 4-bit to complex 64-bit processers.
2. Peripherals such as timers, event counters and watchdog.
3.

RAM (volatile memory) for data storage. The data is stored in the

form of registers, and the general-purpose registers store information


that interacts with the arithmetic logical unit (ALU).
4. ROM, EPROM, EEPROM or flash memory for program and operating
parameter storage.
5. Programming capabilities.

6. Serial input/output such as serial ports.


7. A clock generator for resonator, quartz timing crystal or RC circuit.
8. Analog-to-digital convertors.
9. Serial ports.
10. Data bus to carry information.

Types of Microcontrollers
There are several different kinds of programmable microcontrollers at Future
Electronics. We stock many of the most common types categorized by several
parameters including Bits, Flash size, RAM size, number of input/output lines,
packaging type, supply voltage and speed. Our parametric filters will allow you
to refine your search results according to the required specifications.
Programmable microcontrollers contain general purpose input/output pins. The
number of these pins varies depending on the microcontroller. They can be
configured to an input or an output state by software. When configured to an
input state, these pins can be used to read external signals or sensors. When they
are configured to the output state, they can drive external devices like LED
displays and motors.

Microcontrollers from Future Electronics


Future Electronics has a wide range of programmable microcontrollers,
including pic, low power, LCD, USB and wireless microcontrollers from several
manufacturers. Once you decide if you need 8 bit, 16 bit general purpose, 16 bit
digital signal controllers or 32 bit microcontrollers, you will be able to choose

from their technical attributes and your search results will be narrowed to match
your specific microcontroller application needs.
We deal with several manufacturers such as Cypress, Microchip, NXP, Renesas
Electronics, STMicroelectronics or Zilog. You can easily refine your
programmable microcontroller product search results by clicking your preferred
microcontroller brand from the list of manufacturers below.

Applications for Microcontrollers:


Programmable microcontrollers are designed to be used for embedded
applications, unlike microprocessors that can be found in PCs. Microcontrollers
are used in automatically controlled devices including power tools, toys,
implantable medical devices, office machines, engine control systems,
appliances, remote controls and other types of embedded systems.

Choosing the Right Microcontroller:


Three criteria in Choosing a Microcontroller
1. Meeting the computing needs of the task efficiently and cost
effectively
speed, the amount of ROM and RAM, the number of I/O
ports and timers, size, packaging, power consumption
easy to upgrade
cost per unit
2. availability of software development tools

assemblers, debuggers, C compilers, emulator, simulator,


technical support
3. wide availability and reliable sources of the microcontrollers.

Architecture
The architecture of a typical microcontroller is complex and may include
the following:
1. A CPU, ranging from simple 4-bit to complex 64-bit processers.
2. Peripherals such as timers, event counters and watchdog.
3.

RAM (volatile memory) for data storage. The data is stored in the

form of registers, and the general-purpose registers store information


that interacts with the arithmetic logical unit (ALU).
4. ROM, EPROM, EEPROM or flash memory for program and operating
parameter storage.
5. Programming capabilities.
6. Serial input/output such as serial ports.
7. A clock generator for resonator, quartz timing crystal or RC circuit.
8. Analog-to-digital convertors.
9. Serial ports.
10. Data bus to carry information

Some of the MCS-51 family microcontrpller is shown in the Table.

8052
The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer
with 8Kbytes of Flash programmable and erasable read only memory (PEROM).
The device is manufactured using Atmels high-density nonvolatile memory
technology and is compatible with the industry-standard 80C51 and 80C52

instruction set and pinout. 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 Flash on a monolithic chip, the Atmel
AT89C52 is a powerful microcomputer which provides a highly-flexible and
cost-effective solution to many embedded control applications.

The AT89C52 provides the following standard features: 8K bytes of Flash, 256
bytes of RAM, 32 I/O lines, three 16-bit timer/counters, a six-vector two-level
interrupt architecture, a full-duplex serial port, on-chip oscillator, and clock
circuitry. In addition, the AT89C52 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.

Features
Compatible with MCS-51 Products
8K 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
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight Interrupt Sources
Programmable Serial Channel
Low-power Idle and Power-down Modes

General Block Diagram of a 8051 Microcontroller


T0

/INT0 /INT1

T1

Other
interrupts
128 bytes
Data Memory
(RAM)

4K byte Program
Memory (ROM)

Timer/Counter
(Timer 0 &
Timer 1)

8051 CPU

Oscillator
&Timing

From Crystal
Oscillator or RC
network

64 K Bus
Expansion Control

ALE

/PSEN

I/O ports

P3 P2 P1 P0
(Address/data)

Serial Port

TxD

RxD

Block Diagram of the Original 8051


-------------------------------------------------------------------------------------

Harici Kesmeler
Program Bellei

INT0 INT1

Zamanlayclar

Veri Bellei

Dahili
Kesmeler
KESME
KONTROL

TF1
TF2
TF0
RI/TI

Zamanlayc-2

256 bytes
RAM

8K ROM

T2, T2 EX

Zamanlayc-1

T1

Zamanlayc-0

T0

CPU

OSC

YOL(BUS)
KONTROL

P0

Block Diagram of the 80C52

80C52 pin diagram

SERI
HABERLEME
ARABRM

GR/IKI
(I/O) PORTLARI

P2

P1

P3

TXD
RXD

You might also like