microcontroller lec 1

42
Microcontrollers Faculty of Electronic Engineering , Menofia University By / Eng : Ibrahim Reda Ibrahim 1 Electronics Engineer at Electro Hydraulic Automation

Upload: ibrahim-reda

Post on 18-Aug-2015

44 views

Category:

Engineering


2 download

TRANSCRIPT

  1. 1. Microcontrollers 1
  2. 2. Introduction to microcontrollers. What are the Microcontrollers ? What are they used for? Microcontrollers VS Microprocessors. How to choose your Microcontroller ? Types of Microcontrollers. 23 July 2015 2
  3. 3. Microcontroller Hardware && Software Hardware Microcontroller Architecture. Pin Descriptions. Main Connections . Software Microcontroller programming Language. Software requirements . 23 July 2015 3
  4. 4. Different Applications using Microcontroller Serial Communication . Analog to Digital Converter . Pulse Width Modulation. LCD ( Liquid Crystal Display). 7- Segment. 23 July 2015 4
  5. 5. Basic Concepts. What are the Microcontrollers ? Microcontrollers VS Microprocessors. What are they used for? Memory Types. Types of Microcontrollers. How to choose your Microcontroller ? 23 July 2015 5
  6. 6. 23 July 2015 6
  7. 7. 23 July 2015 7
  8. 8. 23 July 2015 8
  9. 9. 23 July 2015 9
  10. 10. 23 July 2015 10
  11. 11. 23 July 2015 11
  12. 12. Basic Concepts. What are the Microcontrollers ? Microcontrollers VS Microprocessors. What are they used for? Memory Types. How to choose your Microcontroller ? Types of Microcontrollers. Specifications of microcontroller. 23 July 2015 12
  13. 13. What are the Microcontrollers ? 23 July 2015 13
  14. 14. ALU C.U MARMBR IR PC Data line Add line ADC Ethernet USB INT Serial INT Memory This is the microcontroller 23 July 2015 14
  15. 15. A micro-controller (also MCU or C) is a functional computer system- on-a chip. It contains a processor core, memory and programmable input/output peripherals. Micro suggests that the device is small and controller tells you that the device might be used to control objects, processes or events. Another term to describe a microcontroller is embedded controller because the microcontroller and its support circuits are often built into or embedded in the devices they control. So What is The C ?? 23 July 2015 15
  16. 16. Basic block diagram of a microcontroller 23 July 2015 16
  17. 17. Basic Concepts. What are the Microcontrollers ? Microcontrollers VS Microprocessors. What are they used for? Memory Types. How to choose your Microcontroller ? Types of Microcontrollers. Specifications of microcontroller. 23 July 2015 17
  18. 18. Microcontrollers VS Microprocessors 23 July 2015 18
  19. 19. Microprocessor: is an integrated circuit that performs the central processing and internal functions of a computer. So, from the previous definition the P is considered a CPU, it has only three repeated functions: Fetch>>> Decode>>> Execute if we decide to use a P in our design, we should use many supporting elements such as main memory, program memory and I/O controller.23 July 2015 19
  20. 20. Microcontroller It is a single integrated circuit that is designed to function as an embedded system contains (a CPU, RAM, ROM, I/O ports and timers). A microcontroller is a computer-on-a-chip, or a single-chip computer. 23 July 2015 20
  21. 21. Basic Concepts. What are the Microcontrollers ? Microcontrollers VS Microprocessors. What are they used for? Memory Types. How to choose your Microcontroller ? Types of Microcontrollers. Specifications of microcontroller. 23 July 2015 21
  22. 22. What are They used For? 23 July 2015 22
  23. 23. Microcontrollers can independently or via input/output devices (switches, push buttons, sensors, LCD displays, relays etc.), --> control various processes and devices such as industrial automation, electric current, temperature, engine performance etc. 23 July 2015 23
  24. 24. Independently Via input/output 23 July 2015 24
  25. 25. Basic Concepts. What are the Microcontrollers ? Microcontrollers VS Microprocessors. What are they used for? Memory Types. How to choose your Microcontroller ? Types of Microcontrollers. Specifications of microcontroller. 23 July 2015 25
  26. 26. Memory Types 23 July 2015 26
  27. 27. Memory is a group of registers serves two major purposes : Storing the binary codes (program code). Storing binary data that the computer needs to execute instructions (data). RAM (Random Acess Memory ) PROM(Programmable Read Only Memory) EPROM (Erasable Programmable Read Only Memory) EEPROM(Electrically Erasable Programmable Read Only Memory) Flash memory ROM (Read Only Memory) 23 July 2015 27
  28. 28. RAM (Random Access memory) It is a general purpose memory that usually stores the user data in a program. RAM memory is volatile means that data is lost after the power is turned off. usually holds program code or fixed user data. ROM is nonvolatile. If power is removed from ROM and then reapplied, the original data will still be there. ROM memory is programmed during the manufacturing process, and the user cannot change its contents. ROM(Read only memory) 23 July 2015 28
  29. 29. PROM(Programmable read only memory) is a type of ROM that can be Programmed by the user, using a device called a PROM programmer. Once a PROM has been programmed, its contents cannot be changed. EPROM(Erasable programmable read only memory can be programmed using a suitable programming device. An EPROM memory has a small clear-glass window on top of the chip where the data can be erased under strong ultraviolet light. 23 July 2015 29
  30. 30. memory that can be erased and reprogrammed using a suitable programming device. programmed and erased directly by applications software. EEPROM memories are usually very slow EEPROM(Electrically erasable programmable read only) Flash EEPROM is a version of EEPROM memory, has become popular in microcontroller applications and is used to store the program code . Flash EEPROM is nonvolatile and usually very fast. the data can be erased and then reprogrammed using a suitable programming device. Flash Memory 23 July 2015 30
  31. 31. Basic Concepts. What are the Microcontrollers ? Microcontrollers VS Microprocessors. What are they used for? Memory Types. Types of Microcontrollers. How to choose your Microcontroller ? Specifications of microcontroller. 23 July 2015 31
  32. 32. Types of Microcontrollers 23 July 2015 32
  33. 33. Intel Motorola Hitachi Microchip (PIC Microcontrollers) ATMEL (AVR) Toshiba Zilog Texas Instruments National PIC 16F877A 23 July 2015 33
  34. 34. Why PIC ?? Two main programming techniques:- 1- CISC (Complex Instruction Set computer) o Large number of long instructions with many specifications. o Lead to shorter program. o Lead to systems Complexity. Examples : Microprocessors (Intel) , Motorola 68000 family 2- RISC:- (Reduced Instruction Set computer) o Limited number of short instruction. o Make longer program. o Easy to review. Examples : Apple iPods , Some Nokia and Sony Ericsson mobile phones. 23 July 2015 34
  35. 35. Two memory organization technologies :- 1- Neumann technology:- One memory construction RAM and ROM are in the same memory unit 2- HARVARD technology :- Separated RAM and ROM 23 July 2015 35
  36. 36. PIC is designed in HARVARD technology and uses RISC technique. RAM and ROM have different busses to avoid interaction between Rom contents and RAM variables. PIC programs are long programs but easy to review and find errors. PIC could be programmed in assembly language and basic language besides many other languages . Many programs are developed to facilitate PIC programming under each assembly and basic languages. Many circuits in different communication methods with computer are available to burn programs to PIC. 23 July 2015 36
  37. 37. One of the advantages found in PIC that its memory EEPROM could be burned and erased up till 100000 times without memory damaging effects Motorola could be erased only with ultra-violet ray. Because of the popular use of pic, many facilities and applications are available online with different methods. Good communication features between pic and other smart devices. 23 July 2015 37
  38. 38. Basic Concepts. What are the Microcontrollers ? Microcontrollers VS Microprocessors. What are they used for? Memory Types. Types of Microcontrollers. How to choose your Microcontroller ? 23 July 2015 38
  39. 39. How to choose your Microcontroller ? 23 July 2015 39
  40. 40. No of I/O ports. Peripherals. Data Memory. Power Consumption / sleep modes. Number of instructions that can support. cost . 23 July 2015 40
  41. 41. 23 July 2015 41
  42. 42. 23 July 2015 42