pala vidhi vinod

Download Report

Transcript pala vidhi vinod

Microcontroller & Interfacing
Topic #1
Introduction to 8 bit Microcontroller
Enrolment No.: 130200111075
Name of the student: PALA VIDHI VINOD
Syllabus Overview
•
•
•
•
•
•
•
Introduction to 8 bit Microcontrollers
Architecture of AVR Microcontroller
ATMega32 Microcontroller
Assembly and C language programming
for AVR Microcontroller
Interfacing of LED, Switch, LCD, Sensor,
Relay, Optical isolator, Stepper motor,
DC Motor
SPI and I2C protocols
RTC Interfacing
Lab Work
[1] Experiments as given in Laboratory Manual
[2] Student has to construct mini-project based on AVR
ATMega8/16/32 Microcontroller
OR
[2] Interfacing module which can be interfaced with
Arduino board. It is compulsory as a part of term
work. List of components and guidelines are given
at the end of this lab manual.
OR
[2] Innovative industry/social problem solution using
AVR microcontroller
Difference between C & P
Microprocessor
Microcontroller
• General purpose
• No Boolean capability
• Separate Timers, parallelserial I/O chips, extra
RAM/ROM required
• Many op-codes for data
transfer between memory to
CPU
• Application specific
• Boolean capability
• Timers, parallel-serial
I/O, internal RAM &
ROM inbuilt, ADC,
PWM
• Few op-codes for data
transfer between CPU
and external memory
General Purpose Microprocessors vs.
Microcontrollers
www. Micro Digital Ed. com
BIHE university
• General Purpose Microprocessors
Data BUS
General
Purpose
Micro
processor
RAM
ROM
Timer
Address BUS
Control BUS
• Microcontrollers
CPU
RAM
Serial
Timer
Port
ROM
I/O
AVR Microcontroller and Embedded System Using Assembly and C … By. Mazidi, Naimi, and Naimi
Serial
COM
Port
IO
Port
Microcontrollers
Memory
CPU
ROM
RAM
I/O Ports
A single chip
Subsystems:
Timers, Counters, Analog
Interfaces, Serial Comm.
General Block Diagram
Microcontroller Systems …
sensor
Microcontroller
(uC)
Output interfaces
sensor
Sensor conditioning
sensor
actuator
indicator
Microcontroller Architectures
Memory
Address Bus
CPU
0
Program
+ Data
Data Bus
2n
Von Neumann
Architecture
Memory
Address Bus
CPU
0
Fetch Bus
Program
Address Bus 0
Data Bus
Data
Harvard
Architecture
Harvard and von Neumann
architecture …
The AVR is a Harvard architecture CPU.
Harvard Architecture:
 Computer architectures that used physically separate storage
and signal pathways for their
instructions and data.
 CPU can read both an instruction and data from
at the same time that makes it faster.
memory
von Neumann architecture:
 CPU can Read an instruction or data from/to the memory.
 Read, Write can`t occur at the same time due to same memory
and signal pathway for data and instructions.
AVR Microcontroller
Harvard Architecture
Harvard Architecture diagram
Common Microcontrollers
•Atmel
51 Family
AVR Family
•ARM
•Intel
•8-bit
•8XC42
•MCS48
•MCS51
•8xC251
•16-bit
•MCS96
•MXS296
•National Semiconductor
•COP8
•Microchip
•12-bit instruction PIC
•14-bit instruction PIC
•PIC16F84
•16-bit instruction PIC
•NEC
•Motorola
•8-bit
•68HC05
•68HC08
•68HC11
•16-bit
•68HC12
•68HC16
•32-bit
•683xx
•Texas Instruments
•TMS370
•MSP430
•Zilog
•Z8
•Z86E02
8 Bit, 16 Bit, 32 Bit Microcontrollers
• 8-bit Microcontrollers
Internal bus is 8 bit. ALU performs operations
– AVR, PIC
on 8 bit (1 Byte)
– HCS12
– 8051 family etc.
• 16 Bit Microcontrollers
- Extended 8051XA
- Intel 8096, Internal bus is 16 bit. ALU performs operations on 16 bit
(2 Byte or word) , Greater precision than 8 bit
- MC68HC12 etc.
• 32-bit microcontrollers
Internal bus is 32 bit. ALU performs operations on 32 bit
– ARM
(4 Byte or word) , Greater precision than 16 bit
– PIC32
– Intel 80960, Intel/Atmel 251 family
AVR Microcontroller
AVR stand for?
Advanced Virtual RISC,
the founders are Alf Egil Bogen Vegard
Wollan RISC
AVR architecture was conceived by two
students at Norwegian Institute of Technology
(NTH) and further refined and developed at
Atmel Norway, the Atmel company founded
by the two chip architects.
AVR Micro controllers is Family of
RISC Microcontrollers from Atmel.
RISC Microcontroller
Reduced Introduction Set Computer (RISC)
Till 1980 Trend was to build increasingly complex CPUs with
complex set of instructions like (CISC)
(RISC):
Instruction execute in single cycle
“Architecture which reduces the chip complexity by
simpler processing instructions”.
RISC architecture CPUs capable of executing only a very
limited (simple) set of instructions.
RISC Microcontroller
Reduced Instruction Set Computers Advantages:
• Fast Execution of Instructions due to simple instructions
•
•
•
•
•
for CPU.
RISC chips require fewer transistors, which makes them
cheaper to design and produce.
Emphasis on software
Single-clock, reduced instruction only
Register to register: “LOAD" and "STORE“
are independent instructions
Spends more transistors on memory registers
Flash MCU
Breaking Traditions
Code Density
Traditional
CISC
Traditional
RISC
Speed
Flash MCU
Execute 2 Instructions in Different
Controllers …
AVR
1 2
PIC
1
HC05
1
‘C51
1
Done!
2
Done!
Done!
2
2
Done!
AVR Microcontroller
A series of 8-bit RISC microcontrollers from Atmel.
All AVR microcontrollers share same instruction set and a
basic CPU (Harvard) architecture.
It has 32 8-Bit general purpose registers.
Mostly instruction Execute in Single clock cycle. Which
makes it faster among 8 bit microcontrollers.
AVR was designed for efficient execution of compiled C
code.
AVR different groups
• Classic AVR
– e.g. AT90S2313, AT90S4433
• Mega
– e.g. ATmega8, ATmega32, ATmega128
• Tiny
– e.g. ATtiny13, ATtiny25
• Special Purpose AVR
– e.g. AT90PWM216,AT90USB1287
AVR part numbers
ATmega128
Atmel grou
Flash
p
=128K
ATtiny44
Atmel
Tiny Flash =4K
group
AT90S4433
Atmel Class
Flash =4K
ic
grou
p
Flash MCU
AVR 8-Bit RISC Compatibility
• AVR® Flash microcontrollers share a single core
architecture
→ use the same code for all families
→ 1 Kbytes to 256 Kbytes of code
→8 to 100 pins
→ all devices have
Internal oscillators
Flash MCU
tinyAVR applications
•
•
•
•
•
•
•
•
•
Automotive low-end control applications
Toys
Games and Game-Cards
PC Motherboard Connector Control
Security Controller for mobile Phones (SIS Code)
Battery Chargers
Communication IF controllers
White and Brown Goods
Smoke Detectors
Flash MCU
classicAVR applications
•
•
•
•
•
•
•
•
PC Modems
Cable Modems
Battery Chargers (advanced)
Smart Cards and Smart Card Readers
Tool Road Pay Tags
Set-top Boxes
Pay-TV Decoders
Various Industrial Control Applications
Flash MCU
megaAVR applications
• Analog Mobile Phones (NMT, ETACS, AMPS,
and D-AMPS)
• Digital Mobile Phones (GSM and CDMA)
• Printers and Printer Switches/Controllers
• Fax Controller
• Disk Drive Controllers
• CD-ROM Controllers
51 Family members …….
Chip
Memory and other different features
8031
ROM-Less version,
8051
4K Factory programmed ROM
8751
4K EPROM
89C51
4K Flash
89C52
8K Flash
8051F340
Full speed USB, 10 bit ADC, Temp. Sensor,
64 KB Flash ROM, 2K RAM
89C5131
Full speed USB Device, 3 Timers (16 bit), 34
I/O lines, 32K Flash ROM, 1280 Byte RAM,
SPI, Dual data pointer
Thank you