2. WHAT IS A MICROCONTROLLER?
,. A microcontroller is an integrated circuit (IC) that can be
programmed to perfo1
1n a set of functions to control a
collection of electronic devices.
,. A self-conta ined systen1 in which a processor, support,
memory, and input/output (1/0) are all contained in a single
package.
,.. Being program1
nable is what 1
nakes the n1icrocontroller
.
uruque.
4. Types of Microcontrollers
Ml
croc on1roll1rt
Bits Memory/devices
4 8 16 32 Embedded External
lrlstrucllon se1 Memory 1rcl'lllecture
CISC RISC Princeton Harvard
F1mlty
8051 Motorola PIC Texas National ARM others
l
nlel Atmel oanas S
iemens
Ptul s
5. 1 - ACCORDING TO BITS
4-BTTMICROCONTR OLLERS
·
:
· ALU perforn1s a1ith1netic and logical operations on a nibble
(4-bits) at an instruction .
·
:
· Internal bus width of 4-bit.
·
=
· S1nall size, 1ninimu1
n pin count and low cost controllers.
·
:
· Low power consun1ption and used for low end applications
like LED & LCD display drivers, portable battery chargers.
Jes: Renasa M3450 I
MEL.
256 and ATAM862 series from
6. 8-BIT MICROCONTROLLER
·
:
· ALU performs arith1
netic and logical operations on a byte
(8-bits) at an instruction.
·
:
· Internal bus width of 8-bit.
·
:
· Examples: Intel 8051 family
fa1
uily.
and Motorola MC68HC11
7. 16-BIT MICROCONTROLLER
·
:· ALU perfonn s arithrnetic and logical operations on a word
(16-bits) at an instruction.
·
:· internal bus width of 16-bit microcontroller is of 16-bit.
:
· Enhanced performance, computing capability and greater
precision as co1
npared to the 8-bit 1
nicrocontro llers.
·
:
· Examples: Intel 8096 falnily, Motorola MC68HC12 and
MC68332 farnilies.
8. 32-BIT MICROCONTROLLER
·
:
· ALU perfonns arithn1etic and logical operations on a double
word (32-bits) at an instruction.
·
:
· Internal bus width of 32-bit.
·
:
· Much more enhanced performan ce, computing capability with
greater precision as compared to 16-bit microcontrollers.
·
:
· Examples: Intel 80960
Intel/Atmel 25 1family.
family, Motorola M683xx and
9. 2 - ACCORDING TO MEMORY/DEVICES
EMBEDDED MICROCONTROLLERS
,. An embedded system has a 1
nicrocontroller unit that has all the
functiona l blocks (including progran1 as well as data n1e1nory)
available on a the same chip.
,. Exainple: 8051 having Prograin & Data Memory, 1
/0 Ports,
Serial Commu nication, Counters and Timers and Interrupt
Control logic on the chip.
10.
11. EXTERNAL MEMORY MlCROCONTROLLERS
,,. An external systen1 has a microcontroller unit that does not
have all the functional blocks available on a chip.
,,. AU or part of the memory units are externally interfaced using
an interfacing circuit called the glue circuit.
,,. Exa1
nple: 8031 has no progra1
n memo1
y on the chip.
12.
13. 3 - ACCODING TO INSTRUCTION SET
CISC (COMPLEX INSTRUCTION SET COMPUTER)
ARCHITECTURE MICROCONTROLLERS
• Has an instruction set that supports many addressing modes for
the arithmetic and logical instructions, data transfer and
me1
nory accesses instructions.
• Many of the instJuctions are macro like.
• Allows the progra1nmer to use one instruction
many simpler instructions.
in place of
• Example: Intel 8096 fa1
nily.
14. RISC (REDUCED INSTRUCTION SET COMPUTER)
ARCHITECTURE MlCROCONTROLLERS
• Contains an instruction set that supports fewer addressing
modes for the arithmetic and logical instructions and for data
transfer instructions.
• Allows si1
nultaneous access of program and data.
• lnstruction pipelining increases execution speed
• Allow each instruction to operate on any register or use any
addressing 1node.
• Smaller chip and pin count.
• Very low power consumption.
15. 4 - ACCORDING TO MEMORY ARCHITECTURE
The architectures of inicrocontrollers differ in the way data and
programs are stored and accessed.
1. VON-NEUMAN /PRINCETON ARCIDTECTURE
o Single data bus that is used to fetch both instructions and data.
o Program instructions
tnen1ory.
and data are stored in a common main
o Wben such a controller addresses 1
nain me1
nory, it first fetches
an instruction, and then it fetches the data to support the
instruction.
16. o Simplifies the 1
nicrocontroller
memory is accessed.
design because only one
o The weakness is that two separate fetches can slow up the
controller's operation.
o Example: Motorola 68HC1 I.
18. 2. HARV
ARD ARCHITECTURE
oSeparate data bus and an instruction bus.
o Execution occur in parallel.
oMuch faster execution than Von-Neuman architecture.
o Design complexity.
o Example: intel MCS-51 fa1
nily and PIC microcontroUers .
20. GENERAL MTCROCONTROLLER ARCffiTECTUR E
EPR0'.1 Progron•
C:OUnle!r
Sl!lek
n t t a
ROM
• a,,,.-
ln stru<:tiooal
reg >lcr
O sclllaior
I
G<:n" " 'I
purpo
1'<1
>
, h l t t
Vatchdog
tlnlcr
lnstruct1on
decoder -
a a 1
A L U Purt c
Port A P
on B
22. Central Processing Unit (CPU)
The central processing unit processes the program. It executes the
instructions stored in the program 1
ne1nory pointed to by the
program counter in synchronization with the clock signal.
ALU
The arithn1etic/logic unit (ALU) performs 1
nath e1
natical and logical
operations on data.
Oscillator
A complex digital device that generates steady pulse rate required
for timing. All of the separate functions are controlled by one
central timing syste1n. The ti1
ning pulse provides the basis for
proper sequence of all the separate sections of the n1icrocontroller
hip.
23. Read Only Memory (ROM)
ROM holds the prograin instructions and the constant data.
Microcontrollers use one or n1ore of the following 1
ne1nory types
for this purpose:
• ROM (n1ask-programmed ROM),
• PROM (one-time programmable ROM, whjch is not field
progra1nn
1able),
• EPROM (field progra1nmable and usually UV erasable),
• EEPROM (field progra1
nmable, electrically erasable,
erasable) and flash (sin1ilar to EEPROM technology).
• Microcontrollers can have 4K, 8K and l6K, etc. of ROM
byte
24. Random Access Memory (RAM)
• is used to hold intennediate results and oth er temporary data
during the execution of the program. Typically, 1
nicrocontrollers
have a few hundreds of bytes of RAM.
Special-Function Registers
• control various functions of a microcontroller. These are divided
into two groups:
• Registers vi.red into the CPU
- Do not necessarily fonn part of addressable rnemory.
- Used to control progra1n flow and arith1netic functions.
- Exarnples, status register, progra1ncounter, stack
pointer, etc.
25. Registers
• Register is used
manipulated.
to hold the contents of data being
• Registers required by peripheral components
- The contents of these registers include set a timer or enable
serial con1munication.
-Exa1
1
1ples, a progratn counter, stack pointer, RAM address
register, program address register and PC i11cre1nenter.
26. Peripheral Components
• The analogue-to-digital converter - provides an interface
between the mjcrocontroller and the sensors that produce analogue
electrical equivalents
controlled.
of the actual physical parameters to be
• The digital-to-analogue converter - provides an interface
between the mjcrocontroller and the actuators
control function.
that provide the
• 1/0 ports - provide an interface between the nlicrocontroller and
the periphera l 1
/0 devices such as the keyboard, display, etc.
• Counters/timers - are used to keep time and/or nleasure the
ti1ne terval between events, count the number of events and
generate
- . . .r n r the serial potis.
27. Watchdog timer
A specialized program found as pait of the microcontroUer
designed to prevent the 1
n icrocontroller from halting or "locking
up" because of a user-written program since the instructions are
processed step-by-step.
Uses a routine that is based on tuning. If a program has not been
completed or repeated as a loop within a certain ainount of time,
the watchdog timer issues a reset command.
Asystem reset sets all the register values to zero.
The reset feah1re allows the controller to recover from the crash .
It releases the program and sets the controller to start over again.
28. Stack Pointer and Program Counter
• Stack pointer - keeps track of the last stack location used
while the processor is busy manipulating data values,
checking ports, or checking interrupts.
• Program counter - is used to hold the address of the
instruction to be executed next.
Buses
• Bus represents a physical connect ion used to carry a signal
from one point to another inside a microcontroller. The signal
carried by a bus may represen t address, data, control signa l,
or power.
29. MJCROCONTROLLER OPERATION
MODULE
• When a tnicrocontroller is mounted on a circuit board with
other compon ents function as a single unit, is referred as a
module or a microcontroller board.
• A n1icrocontroller n1odu le typica lly consists of microcontroller ,
a power source, an interface for connecting to a progra1
nrning
device, I/O ports, and additional 1
nen1ory.
30. • A power source - powers the microcontroller and any
accompanying components located on the printed circuit board.
• An interface - communicate with the controller.
• A set of input/output (l/O) ports - send and receive signa ls
from the devices the microcontroUer is designed to control.
• I/0 ports when progra tnlned as an output pin, each pin can
output digital signals. When programmed as an input pin, each
pin can receive digital signals.
• Digita l-to-analog and analog-to-digital converters change the
digital pulses into analog signals.