Microcontroller Hardware

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 45

Jyoti Agrawal Embedded Controller

System


A system is a way working, organizing or
doing one or many tasks according to a fixed
plan, program, or set of rules. A system is also
an arrangement in which all its units assemble
and work together according to the plan or
program.

Jyoti Agrawal Embedded Controller
Embedded System
A computer is a system that has the following or more components.
1. A microprocessor
2. A large memory comprising the following two kinds :
(a) Primary memory (semiconductor memories RAM, ROM and
fast accessible caches)
(b) Secondary memory (magnetic memory located in hard
disks, diskettes and carriage tapes and optical memory in CD-
ROM)
3. Input units like keyboard, mouse, digitizer, scanner etc.
4. Output units like video monitor, printer etc.
5. Networking units like Ethernet card, front-end processor-based
drivers. etc.
6. I/O units like a modem, fax cum modem, etc.
Jyoti Agrawal Embedded Controller
Embedded system means the processor is embedded into that
application.
An embedded product uses a microprocessor or microcontroller
to do one task only.
In an embedded system, there is only one application software
that is typically burned into ROM/EPROM.
Exampleprinter, keyboard, video game player, toys etc.
An embedded system is one that has computer
hardware with software embedded in it as one of its
most important component.

Jyoti Agrawal Embedded Controller
Power
Supply
,


Reset




and




Oscillaor
Circuits
System

Applicati
on



Specific
Circuits
Input Devices
Interfacing/ Driver
Circuits
Processor Program Memory
& Data Memory
Timers Serial
Communication
Ports
Interrupt
Controller
Parallel Ports
Outputs Interfacing/ Driver Circuits


The components of an Embedded System hardware
Jyoti Agrawal Embedded Controller



Classification of Embedded System



1. Small Scale Embedded System


2. Medium Scale Embedded Systems


3. Sophisticated Embedded System
Jyoti Agrawal Embedded Controller

PROCESSOR IN THE SYSTEM


An embedded system processor chip or core can be one of the following

.
a.Microprocessor.

b.Microcontroller.

c.Digital Signal Processor (DSP).


Jyoti Agrawal Embedded Controller
Important Microprocessors used in the Embedded Systems

Stream Microprocessor
Family
Source CISC or RISC or
Both Features
Stream 1
Stream 2
Stream 3
Stream 4
68HCxxx
(a)80x86
(b)i860
SPARC
(a)PowerPC
601,604
(b)MPC 620
Motorola
Intel
Intel
Sun
IBM
Motorola
CISC
CISC
CISC with RISC
RISC
RISC
Jyoti Agrawal Embedded Controller
Important Microcontrollers used in the Embedded Systems

Sr.
No.
Microcontroller Family Source CISC or RISC or Both
Features
1

2

3

4


5
68HC11xx, C12xx,HC16xx

8051, 80251

80x86

PIC 16F84 or 16C76,
16F876 and PIC18

Enhancements of ARM9,
ARM7
Motorola

Intel

Intel

Microchip


ARM, Texas,
etc
CISC

CISC

CISC

CISC


CISC with RISC Core
Jyoti Agrawal Embedded Controller
Important Digital Signal Processor Used in the Embedded Systems

Stream DSP Family Source
Stream 1
Stream 2
Stream 3
TMS32OCxx
SHARC
5600xx
Texas
Analog Device
Motorola
Jyoti Agrawal Embedded Controller
CPU
General-
Purpose
Micro-
processor
RAM ROM
I/O
Port
Timer
Serial
COM
Port
Data Bus
Address Bus
General-Purpose Microprocessor System
Microprocessors:
CPU for Computers
No RAM, ROM, I/O on CPU chip itself
ExampleIntels x86, Motorolas 680x0
Many chips on mothers board
General-purpose microprocessor
Jyoti Agrawal Embedded Controller
What is Microcontroller?


A device which integrates a number of components of a
microprocessor system onto a single chip. Only clocking
and power are need to be supplied.

Microcontroller combines various peripherals on the
same chip. Some of them are:
CPU
I/O
Memory
( PROM / EPROM / EEPROM )
RAM
Timer
Serial I/O
ADC
Interrupt capability
Bus /external memory interfaces.


Jyoti Agrawal Embedded Controller
RAM ROM
I/O
Port
Timer
Serial
COM
Port
Microcontroller
CPU
A smaller computer
On-chip RAM, ROM, I/O ports...
ExampleMotorolas 6811, Intels 8051, and PIC 16X
A single chip
Microcontroller :
Jyoti Agrawal Embedded Controller
Block Diagram
CPU
On-chip
RAM
On-chip
ROM for
program
code
4 I/O Ports
Timer 0
Serial
Port
OSC
Interrupt
Control
External interrupts
Timer 1
Timer/Counter
Bus
Control
TxD RxD
P0 P1 P2 P3
Address/Data
Counter
Inputs
Jyoti Agrawal Embedded Controller
Where Are Microcontrollers Used?
Hand held instrument DVD, TV,
VCR
Computers- PC
Test and Measurement
Cellphones, communication
equipment
Automobiles
Household appliances
Astronauts space suits
Consumer items




And many more.




Jyoti Agrawal Embedded Controller
Features of Intels 8051 Family Microcontrollers:-
8 bit CPU.
It requires single 5V supply.
on chip oscillator and clock circuitry.
32 bidirectional I/O lines ( Four 8 bits I/O ports).
It provides on chip 4 KB of program memory.
It provides on chip 128B of Data memory.
64 Kbytes address space for external data memory.
64 Kbytes address space for program memory.
Two multiple mode 16 bit timer / counters
Five source interrupt structure.
It provides multiple mode high speed programmable
Full duplex serial port.


Jyoti Agrawal Embedded Controller
Members of Family (Comparison):-

ROM/ EPROM Internal
RAM
Por
ts
Time
rs
Interr
upts
Serial
Com
m
Extern
al Prog.
Memor
y
External
Data
Memory
8031 0 (ROMLESS) 128 bytes 4 2,16
BIT
5 UAR
T
64 K 64 K
8051 4K ROM
(MASKED)
128 bytes 4 2,16
BIT
5 UAR
T
60 K 64 K
8751 4 K
EPROM
128 bytes 4 2,16
BIT
5 UAR
T
60 K 64 K
8032 0 (ROM
LESS)
256 bytes 4 3,16
BIT
6 UAR
T
64 K 64 K
8052 8K ROM
(MASKED)
256 bytes 4 3,16
BIT
6 UAR
T
56 K 64 K
8752 8 K EPROM 256 bytes 4 3,16
BIT
6 UAR
T
56 K 64 K


Jyoti Agrawal Embedded Controller
Microprocessor
CPU is stand-alone, RAM,
ROM, I/O, timer are to be
interfaced
designer can decide on the
amount of ROM, RAM and
I/O ports.
expansive
versatility
general-purpose

Microcontroller
CPU, RAM, ROM, I/O and
timer are all on a single chip
fix amount of on-chip ROM,
RAM, I/O ports
for applications in which cost,
power and space are critical
single-purpose
Microprocessor vs. Microcontroller
Jyoti Agrawal Embedded Controller
Processor Architectures:
1. Harvard Architecture
separate memory blocks , which can be accessed
simultaneously:
i) Program Memory
ii) Data Memory

2. VON Neumann

Jyoti Agrawal Embedded Controller
Block diagram

Jyoti Agrawal Embedded Controller
Jyoti Agrawal Embedded Controller
Pins of 8051
Vccpin 40
Vcc provides supply voltage to the chip.
The voltage source is +5V.
GNDpin 20ground
XTAL1 and XTAL2pins 19,18

Jyoti Agrawal Embedded Controller
Pins of 8051

RSTpin 9reset
It is an input pin and is active highnormally low.
The high pulse must be high at least 2 machine
cycles.
It is a power-on reset.
Upon applying a high pulse to RST, the
microcontroller will reset and all values in registers
will be lost.
Reset values of some 8051 registers
Jyoti Agrawal Embedded Controller
Figure (b). Power-On RESET Circuit
30 pF
30 pF
8.2 K
10 uF
+
Vcc
11.0592 MHz
EA/VPP
X1
X2
RST
31
19
18
9

Jyoti Agrawal Embedded Controller
RESET Value of Some 8051 Registers:
0000 DPTR
0007 SP
0000 PSW
0000 B
0000 ACC
0000 PC
Reset Value Register
RAM are all zero.
Jyoti Agrawal Embedded Controller
Pins of 8051
/EApin 31external access
There is no on-chip ROM in 8031 and 8032 .
The /EA pin is connected to GND to indicate the code is
stored externally.
/PSEN ALE are used for external ROM.
For 8051, /EA pin is connected to Vcc.
/ means active low.
/PSENpin 29program store enable
This is an output pin and is connected to the OE pin of the
ROM.
Jyoti Agrawal Embedded Controller
Pins of 8051
ALEpin 30address latch enable
It is an output pin and is active high.
8051 port 0 provides both address and data.
The ALE pin is used for de-multiplexing the
address and data by connecting to the G pin of the
74LS373 latch.
I/O port pins
The four ports P0, P1, P2, and P3.
Each port uses 8 pins.
All I/O pins are bi-directional.
Jyoti Agrawal Embedded Controller
Port structure and operation
Jyoti Agrawal Embedded Controller
General characteristics of ports
Jyoti Agrawal Embedded Controller
Pins of I/O Port
The 8051 has four I/O ports
Port 0 pins 32-39P0P0.0P0.7
Port 1pins 1-8 P1P1.0P1.7
Port 2pins 21-28P2P2.0P2.7
Port 3pins 10-17P3P3.0P3.7
Each port has 8 pins.
Named P0.X X=0,1,...,7, P1.X, P2.X, P3.X
ExP0.0 is the bit 0LSBof P0
ExP0.7 is the bit 7MSBof P0
These 8 bits form a byte.
Each port can be used as input or output (bi-direction).
Jyoti Agrawal Embedded Controller
P1, P2, and P3 have internal pull-up resisters.
P1, P2, and P3 are not open drain.
P0 has no internal pull-up resistors and does not
connects to Vcc inside the 8051.
P0 is open drain.
However, for a programmer, it is the same to program
P0, P1, P2 and P3.
All the ports upon RESET are configured as output.
Various SFRs and port latches can program the
input/output function.


Cont..
Jyoti Agrawal Embedded Controller
Port 0 with Pull-Up Resistors
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
DS5000
8751
8951
Vcc
10 K
P
o
r
t

0

Jyoti Agrawal Embedded Controller
Port 3 Alternate Functions
17 RD P3.7
16 WR P3.6
15 T1 P3.5
14 T0 P3.4
13 INT1 P3.3
12 INT0 P3.2
11 TxD P3.1
10 RxD P3.0
Pin Function P3 Bit

Jyoti Agrawal Embedded Controller
Memory Map :-



PROGRAM MEMORY
PSEN is connected to external
program memory as a RD signal

0000
OFFF
255
128
127
0000

FF
80
7F
00
1000
FFFF FFFF
OFFF
0000
EXTERNAL
PROGRAM
MEMORY:
EPROM
INTERNAL


(EA = 01)



INTERNAL
DATA
MEMORY






EXTERNAL DATA
MEMORY

(RAM)

EXTERNAL

(EA = 0)
SFRS
PSEN is USED (RD

WR
USED)
mov instruction
For Internal data transfer which refer to 8 bit address of
internal memory
movx instructions
For External data transfer which refer to 16/8 bit external
memory
Jyoti Agrawal Embedded Controller
Jyoti Agrawal Embedded Controller
Memory mapping in 8051

ROM memory map in 8051 family
0000H
0FFFH
0000H
1FFFH
0000H
7FFFH
8751
AT89C51
8752
AT89C52
4k
DS5000-32
8k 32k
from Atmel Corporation
from Dallas Semiconductor
Jyoti Agrawal Embedded Controller
RAM memory (Data Memory) space allocation in
the 8051
7FH
30H
2FH
20H
1FH
17H
10H
0FH
07H
08H
18H
00H
Register Bank 0
(Stack) Register Bank 1
Register Bank 2
Register Bank 3
Bit-Addressable RAM
Scratch pad RAM
Jyoti Agrawal Embedded Controller
Internal Data Memory :
Jyoti Agrawal Embedded Controller
The Working Registers:
Jyoti Agrawal Embedded Controller
Bit Addressable RAM
Jyoti Agrawal Embedded Controller
General Purpose RAM
Jyoti Agrawal Embedded Controller
Special Function Register
Jyoti Agrawal Embedded Controller
Oscillator and clock Circuit
Jyoti Agrawal Embedded Controller
CPU Timing:
Jyoti Agrawal Embedded Controller
CPU Timing case:
Jyoti Agrawal Embedded Controller
References:


1. THE 8051 MICROCONTROLLER
Architecture Programming & Applications (Second Edition)
by Kenneth J. Ayala,Penyam International

2.The 8085 Microcontroller and Embedded System
by Muhammad Ali Mazidi, Pearson Ed

3. Programming & Customizing the 8085 Microcontoller
by Myke Predko, TMH Edition 1999.

4.Embedded Microprocessor System : Real world Design
by Stuart R Ball, 3
rd
Ed, Newness publication

5. Data Sheets

You might also like