Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and...

20
Microprocessors And Microcontrollers By: Dr. Attiya Baqai Semester : 4 th , 5 th (TL, ES) Assistant Professor, Course Code : ES256 , ES313 Department of Electronics, MUET.

Transcript of Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and...

Page 1: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Microprocessors And Microcontrollers

By: Dr. Attiya Baqai

Semester : 4th , 5th (TL, ES) Assistant Professor,

Course Code : ES256 , ES313 Department of

Electronics, MUET.

Page 2: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

I am Attiya Baqai I am here because I love to teach this subject. You can find me at [email protected] Office: Research Lab-1 IIT Building, MUET

Hello!

Page 3: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Learning Pattern

◉Learning concepts

◉Practicing them through examples

◉Your thought /any application

◉Best idea/ Best logic of the day

◉Mid term project idea finalization + sessional test

◉Final project submission + final sessional test

Page 4: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Course Outline

INTRODUCTION

Basic concepts

MICROPROCESSORS

CPU

Microprocessor

Computer organization Simplified architecture of Intel family processor . Programming techniques. Memories Interfacing

MICROCONTROLLER

Microcontroller Architecture & Applications

Microcontroller families

o Serial Communication

o SPI

o I2C or TWI

o ADC

o Interrupts

o Interfacing Techniques

o System Design

Reference Books

Microprocessor Fundamentals by Roger L. Tokheim- Schaum’s Outlines

The AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad

Naimi, and Sepher Naimi

Page 5: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Introduction to Subject Let’s start with the prerequisite & course contents

1

Page 6: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Subject’s Pre requisite

◉ Boolean Logic ◉ Number System ( Base 2,8,10,16) ◉ Digital Logic Gates ◉ Bits, Bytes and their multiple ◉ Semiconductor Memories ◉ CPU components, buses ◉ CPU architectures

Page 7: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

◉ George Bool (19th Century mathematician)

◉TRUE or FALSE

◉ Basis of o Number System

o Codes

o Truth Tables

o Logic Gates, expressions and circuits

o Computers

Boolean Logic [ 1 | 0 ]

Page 8: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

◉ Base 2 (binary) – 1000000b =

◉ Base 16 ( Hexa Decimal)- 4510=

◉ Codes ( BCD, ASCII, EBCDIC, Gray, Excess-3 Code)

BCD (Binary Coded Decimal)

o 4 bit code

o Used for I/O in digital systems

o 3710=

o Invalid codes in BCD =

Number System [ 1 | 0 ]

?10

? hex

?2

?

Page 9: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

ASCII (American Standard Information Interchange)

o 7 or 8 bit Alphanumeric code

o 7 bit code range = 8 bit code range =

o Used for control and graphics characters

o 8 bit ASCII is called Extended ASCII

EBCIDIC (Extended Binary Coded Decimal Interchange Code)

o 8 bit alphanumeric code

o Used in IBM mainframe computers

Codes (cont…)

?hex ? hex

Page 10: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Gray code

o Difference of single bit

o Used in shaft encoders

Excess-3 code

o 4 bit code obtained by adding 0011 to natural BCD.

o Used in digital systems for performing subtraction.

Codes (cont…)

Page 11: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

◉ Find Expression for Y

Logic Gates

Page 12: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Storage Capacity b,B,KB,MB,GB….

Page 13: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Semi conductor Memories

ROM(Read only Memory)

o Contents are not lost after power off

o Non Volatile

PROM (Programmable ROM)

o One Time Programmable (OTP)

o For every bit there is a fuse to blow

o If burnt wrong then whole PROM is to be discarded

o ROM burner/ programmer needed

Page 14: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Semi conductor Memories

EPROM (Erasable Programmable ROM)

o Thousands of time erasable

o UV-PROM, EE PROM

UV PROM (Ultra Violet)

o Need 20 mins UV light to erase

o 12.5V ROM burner voltage- Vpp

o Separate programmer & eraser

Page 15: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Semi conductor Memories

EEPROM (Electrically Erasable Programmable ROM)

o EE so instant, instead of 20 min

o One byte can be selected to erase

o Cost per bit is higher than UV

Flash PROM

o Erases all contents in a second

o Electrical method

o No byte erasure but some can have block erasure option

o In board so used in BIOS ROM

Page 16: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Semi conductor Memories

Mask ROM

o Programmed by manufacturers (IC fabrication)

o Costly

o Produced in batch

RAM

SRAM (Static RAM)

o Flip flops

o No refreshing

o 6 transistors for each cell

o Volatile

Page 17: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Semi conductor Memories NV-RAM (Non Volatile RAM)

o Low power Consumption, CMOS

o Lithium internal battery

o Expensive

o 10 years

DRAM(Dynamic RAM)

o capacitor

o Constant refreshing required (while refreshing no data access)

o Smaller net memory size

o Low cost per bit

o Low power consumption per bit

Page 18: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Logic gate as Decoder

Page 19: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Using 74LS138 as Decoder

Page 20: Microprocessors And MicrocontrollersThe AVR microcontroller and embedded systems using Assembly and C by Muhammad Ali Mazidi, Sarmad Naimi, and Sepher Naimi Introduction to Subject

Any questions ?

Thanks!