Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microprocessors & microcontrollers Mehdi Dehghani.

Similar presentations


Presentation on theme: "Microprocessors & microcontrollers Mehdi Dehghani."— Presentation transcript:

1 Microprocessors & microcontrollers Mehdi Dehghani

2 Topics What is a Computer? Some Kinds of memory Memory addressing Microprocessors Microcontroller Microcontroller Vs Microprocessors What is AVR ? Why we study AVR? AVR; Pins & Ports Programming and Programmer Programming environment Programming languages

3 Topics Writing the simple program and execute it. Adding the button What's debouncing? How could it solved Timer & counters in AVR About interrupts Power supplies Introduction to LCD Writing programs and passing strings to LCD Display numeric in LCD Introduction to ads Programming ads using interrupts Introduction to PWM

4 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

5 5

6 6 Processor 8088 8086 80286 80386dx 80486 80586/Pentium (Pro) Data Bus 8 16 32 64 Address Bus 20 24 32 Max Addressable Memory 1,048,576 (1Mb) 16,777,21(16Mb) 4,294,976,296 (4Gb)

7 7 Intel

8 8

9 9 Data Bus Address Bus Control Bus Processor Memory I/O ( BUS CPU ) Address Bus provides a memory address to system memory and I/O address to system I/O devices Data Bus transfers data between the microprocessor and the memory and I/O attached to the system Control Bus provides control signals that cause memory or I/O devices to perform a read or write operation

10 10 CPU General- Purpose Micro- processor RAMROM I/O Port Timer Serial 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

11 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

12 ACOE343 - Real-Time Embedded Processor Systems - Frederick University 12 RAM ROM I/O Port Timer Serial 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 :

13 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

14 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

15 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

16 16 Data Type

17 17 Computer System Disk Memory-I/O bus Processor Cache Memory I/O controller I/O controller I/O controller I/O controller I/O controller I/O controller Display Network Reg

18 18

19 19

20 20 Speed & cost

21 21 Mask ROM

22 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 )

23 23 RAM

24 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

25 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

26 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

27 27 Memory Address Pins

28 28 memory & data size

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

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

31 31 بانک های حافظه در میکرو پروسسور های 32 بیتی سوال امتحان : یک CPU با داشتن 16 خط آدرس چه تعداد خانه حافظه را آدرس دهی میکند؟ 2 16 = 2 6 X 2 10 = 64 X 1K = 64K سوال امتحان : یک CPU 8 خط دیتا دارد این CPU چند بیتی است؟ 8 بیتی

32 32 If a memory chip has 13 address pins (A0..A12), then it has: 2 13 = 2 3 X 2 10 = 8 X 1K = 8K If a memory chip has 4K locations, then it should have N pins: 4K = 4 X 1K = 2 2 X 2 10 = 2 12  N=12 address pins (A0..A11) Memory Decoder

33 33 Memory Decoder

34 34 Memory Decoder ( 74138 Decoder 3 TO 8 )

35 35 Memory Decoder ( 74139 2 * Decoder 2 TO 4 )

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


Download ppt "Microprocessors & microcontrollers Mehdi Dehghani."

Similar presentations


Ads by Google