+ All Categories
Home > Documents > Microprocessors & microcontrollers Mehdi Dehghani.

Microprocessors & microcontrollers Mehdi Dehghani.

Date post: 26-Dec-2015
Category:
Upload: leon-poole
View: 225 times
Download: 3 times
Share this document with a friend
36
Microprocessors & microcontrollers Mehdi Dehghani
Transcript
Page 1: Microprocessors & microcontrollers Mehdi Dehghani.

Microprocessors &

microcontrollers

Mehdi Dehghani

Page 2: Microprocessors & microcontrollers Mehdi Dehghani.

Topics

What is a Computer?Some Kinds of memoryMemory addressingMicroprocessorsMicrocontrollerMicrocontroller Vs MicroprocessorsWhat is AVR ?Why we study AVR?AVR; Pins & PortsProgramming and ProgrammerProgramming environmentProgramming languages

Page 3: Microprocessors & microcontrollers Mehdi Dehghani.

TopicsWriting the simple program and execute it.Adding the buttonWhat's debouncing? How could it solvedTimer & counters in AVRAbout interruptsPower suppliesIntroduction to LCDWriting programs and passing strings to LCDDisplay numeric in LCDIntroduction to adsProgramming ads using interruptsIntroduction to PWM

Page 4: Microprocessors & microcontrollers Mehdi Dehghani.

4

What is a Computer?

• Central Processing Unit (CPU) – Executes the programs

• Primary Memory – Stores programs and data

• Input / Output Devices – Allow CPU to communicate with external

hardware • System Bus

– Connects everything together – Address, Data, Control signals

Page 5: Microprocessors & microcontrollers Mehdi Dehghani.

5

Page 6: Microprocessors & microcontrollers Mehdi Dehghani.

6

Processor

8088

8086

80286

80386dx

80486

80586/Pentium (Pro)

Data Bus

8

16

16

32

32

64

Address Bus

20

20

24

32

32

32

Max Addressable Memory

1,048,576 (1Mb)

1,048,576 (1Mb)

16,777,21 (16Mb)

4,294,976,296 (4Gb)

4,294,976,296 (4Gb)

4,294,976,296 (4Gb)

Page 7: Microprocessors & microcontrollers Mehdi Dehghani.

7

Intel

Page 8: Microprocessors & microcontrollers Mehdi Dehghani.

8

Intel

Page 9: Microprocessors & microcontrollers Mehdi Dehghani.

9

Data Bus

Address Bus

Control Bus

Processor

Memory I/O

(BUS CPU)

Address Busprovides a memory address to system memory and I/O address to system I/O devicesData Bus transfers data between the microprocessor and the memory and I/O attached to the systemControl Busprovides control signals that cause memory or I/O devices to perform a read or write operation

Page 10: Microprocessors & microcontrollers Mehdi Dehghani.

10

CPU

General-Purpose Micro-processor

RAM ROM I/O Port

TimerSerial COM Port

Data Bus

Address Bus

General-purpose microprocessor:

• CPU for Computers• Commonly no RAM, ROM, I/O on CPU chip itself

Many chips on motherboard

Page 11: Microprocessors & microcontrollers Mehdi Dehghani.

ACOE343 - Real-Time Embedded Processor Systems - Frederick University

11

Components of a microprocessor/controller

• CPU: Central Processing Unit• I/O: Input /Output• Bus: Address bus & Data bus• Memory: RAM & ROM• Timer• Interrupt• Serial Port• Parallel Port

Page 12: Microprocessors & microcontrollers Mehdi Dehghani.

ACOE343 - Real-Time Embedded Processor Systems - Frederick University

12

RAM ROM

I/O Port

TimerSerial COM Port

Microcontroller

CPU

• A single-chip computer• On-chip RAM, ROM, I/O ports...• Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X

A single chip

Microcontroller :

Page 13: Microprocessors & microcontrollers Mehdi Dehghani.

Microprocessor vs. Microcontroller• Microprocessor • CPU is stand-alone, RAM, ROM, I/O, timer are separate• designer can decide on the amount of ROM, RAM and I/O ports.• More power• 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

• Less applications

Page 14: Microprocessors & microcontrollers Mehdi Dehghani.

14

Data Type

• Numbers – bit (e.g., 1) ; nibble = 4 bits – DB: byte = octet = 8 bits – DW: Word = 2 bytes = 16 bits– DD: DoubleWord = 4 bytes = 32 bits

Page 15: Microprocessors & microcontrollers Mehdi Dehghani.

15

Memory Data Types

• Text – Letters and characters (7-bit ASCII

standard), e.g., 'A'=65=0x41 – Extended ASCII (8-bit) allows for extra 128

graphics/symbols) – Collection of characters = Strings – Collection of Strings = Documents

Data Type

Page 16: Microprocessors & microcontrollers Mehdi Dehghani.

16

Data Type

Page 17: Microprocessors & microcontrollers Mehdi Dehghani.

17

Computer System

DiskDisk

Memory-I/O busMemory-I/O bus

ProcessorProcessor

CacheCache

MemoryMemoryI/Ocontroller

I/Ocontroller

I/Ocontroller

I/Ocontroller

I/Ocontroller

I/Ocontroller

DisplayDisplay NetworkNetwork

Reg

Page 18: Microprocessors & microcontrollers Mehdi Dehghani.

18

Page 19: Microprocessors & microcontrollers Mehdi Dehghani.

19

Memory Arrays

Random Access Memory Serial Access Memory Content Addressable Memory(CAM)

Read/Write Memory(RAM)

(Volatile)

Read Only Memory(ROM)

(Nonvolatile)

Static RAM(SRAM)

Dynamic RAM(DRAM)

Shift Registers Queues

First InFirst Out(FIFO)

Last InFirst Out(LIFO)

Serial InParallel Out

(SIPO)

Parallel InSerial Out

(PISO)

Mask ROM ProgrammableROM

(PROM)

ErasableProgrammable

ROM(EPROM)

ElectricallyErasable

ProgrammableROM

(EEPROM)

Flash ROM

Page 20: Microprocessors & microcontrollers Mehdi Dehghani.

20

Speed & cost

Page 21: Microprocessors & microcontrollers Mehdi Dehghani.

21

Mask ROM

Page 22: Microprocessors & microcontrollers Mehdi Dehghani.

22

What is the difference between flash memory and EEPROM?

Best Answer

EEPROM is an older, more reliable technology. It is somewhat slower than Flash.

Flash and EEPROM are very similar, but there is a subtle difference. Flash and EEPROM both use quantum cells to trap electrons. Each cell represents one bit of data. The presence - or absence - of electrons in a cell indicates whether the bit is a 1 or 0.

The cells have a finite life - every time a cell is erased, it wears out a little bit. In EEPROM, cells are erased one-by-one. The only cells erased are those which are 1 but need to be zero. (Writing a 1 to a cell that's 0 causes very little wear, IIRC)

In Flash, a large block is erased all at once. In some devices, this "block" is the entire device. So in Flash, cells are erased whether they need it or not. This cuts down on the lifespan of the device, but is much, much faster than the EEPROM method of going cell-by-cell.

(flash Vs EEPROM)

Page 23: Microprocessors & microcontrollers Mehdi Dehghani.

23

RAM

Page 24: Microprocessors & microcontrollers Mehdi Dehghani.

24

Semiconductor Memory Types

• RAM: the stored data is volatile

– DRAM• A capacitor to store data, and a transistor to access the capacitor• Need refresh operation• Low cost, and high density it is used for main memory

– SRAM• Consists of a latch• Don’t need the refresh operation• High speed and low power consumption it is mainly used for cache

memory and memory in hand-held devices

RAM

Page 25: Microprocessors & microcontrollers Mehdi Dehghani.

25

Static RAM (SRAM)• Fast

– ~4 nsec access time• Persistent

– as long as power is supplied– no refresh required

• Expensive – ~$100/MByte– 6 transistors/bit

• Stable– High immunity to noise and environmental disturbances

• Technology for caches

SRAM

Page 26: Microprocessors & microcontrollers Mehdi Dehghani.

26

Dynamic RAM (DRAM)• Slower than SRAM

– access time ~60 nsec

• Nonpersistant – every row must be accessed every ~1 ms (refreshed)

• Cheaper than SRAM – ~$1.50 / MByte– 1 transistor/bit

• Fragile– electrical noise, light, radiation

• Workhorse memory technology

DRAM

Page 27: Microprocessors & microcontrollers Mehdi Dehghani.

27

Memory Address Pins

Page 28: Microprocessors & microcontrollers Mehdi Dehghani.

28

memory & data size

Page 29: Microprocessors & microcontrollers Mehdi Dehghani.

29

بیتی16بانک های حافظه در میکرو پروسسور های

Page 30: Microprocessors & microcontrollers Mehdi Dehghani.

30

بیتی32بانک های حافظه در میکرو پروسسور های

داشتن CPU یک تعداد 16با چه و حافظه خانه تعداد چه آدرس میکند؟ I/Oخط دهی آدرس را

Page 31: Microprocessors & microcontrollers Mehdi Dehghani.

31

بیتی32بانک های حافظه در میکرو پروسسور های

سوال امتحان :

خط آدرس چه تعداد خانه حافظه را آدرس دهی میکند؟16 با داشتن CPU یک

216 = 26 X 210 = 64 X 1K = 64K

سوال امتحان :

بیتی 8؟چند بیتی است CPUدیتا دارد این خط CPU 8 یک

Page 32: Microprocessors & microcontrollers Mehdi Dehghani.

32

If a memory chip has 13 address pins (A0..A12), then it has:

213 = 23 X 210 = 8 X 1K = 8K

If a memory chip has 4K locations, then it should have N pins:

4K = 4 X 1K = 22 X 210 = 212 N=12

address pins (A0..A11)

Memory Decoder

Page 33: Microprocessors & microcontrollers Mehdi Dehghani.

33

000

001

002

003

HexMemoryContents

3FC

3FD

3FE

10011001

00111000

00-0000-0000

00-0000-0001

00-0000-0010

00-0000-0011

11-1111-1100

11-1111-1101

11-1111-1110

11-1111-1111 3FF

11001001

00111011

01101000

10111001

00110100

00011000

Memory Address

Binary

1024 X 8 (or 1KX8) Memory

Memory Decoder

Page 34: Microprocessors & microcontrollers Mehdi Dehghani.

34

Memory Decoder ( 74138 Decoder 3 TO 8 )

Page 35: Microprocessors & microcontrollers Mehdi Dehghani.

35

Memory Decoder ( 74139 2 * Decoder 2 TO 4 )

Page 36: Microprocessors & microcontrollers Mehdi Dehghani.

36

Memory Decoder

وصل وصل کنید.CPU به 1FFF – 1000 را در آدرس EPROM - 4 Kسوال امتحان : یک عدد

100

0


Recommended