Lecture (01) Embedded Systems and the Microcontrollers...
Transcript of Lecture (01) Embedded Systems and the Microcontrollers...
Lecture (01)Introducing Embedded Systems
and the Microcontrollers
By:
Dr. Ahmed ElShafee
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١
Agenda
• What is microprocessor system?
• What is Microcontroller/embedded system?
• Definition of Embedded Systems
• Examples
• Computer Essentials
• Microprocessors and Microcontrollers
• PIC Microcontrollers
• PIC 12 series
• PIC 16 series
• 16f84
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢
What is microprocessor system?
• Microprocessor (MP) is an electronic micro‐chip or integrated circuit, contains millions of transistor.
• MP is capable of carrying out tens of arithmetic and logic operations, in a very high speed (scale of Nano seconds) .
• MP runs instructions coded using, Machine Language; such as, assembly (assembly is an easy low level language that human can understand and write).
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٣
• Pieces of assembly code, are combined together to build something called routine or macro that enable microprocessor to execute complex tasks, such as solving differentials equations, drawing graphs, moving mouse cursor, … etc
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٤
• MP is just a brain.
• It can’t work alone.
• It needs a lot of peripherals to support its operations, such as, RAM, ROM, Interfaces, Busses, and so on..
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٥
ROM RAM I/O interface
I/O devicesCPU
Address bus
Data bus Control bus
• MP can be considered as the main block of modern computers, mobile phones, tablets, or even a complex system (advanced and enormous) such as, medical instruments, and industrial machines
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٦
• A computer is a programmable machine that receives input, stores and manipulates data//information, and provides output in a useful format.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٧
What is Microcontroller/embedded system? • Microcontroller is a simple version of microprocessor.
• MC can work alone, and you don’t need to build an enormous board to bring MC into action. Just connect clock source then power up.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٨
ROM RAM I/O interface
I/O devicesCPU
Address bus
Data bus Control bus
MC
• As we see, microprocessor need many other peripherals and components to work.
• So it’s not reasonable to build such enormous board to execute minor and simple operation like displaying clock on LCD or control some appliance.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٩
• So MC as a limited or light version of microprocessor, it has its own small ROM, RAM, interface bus, counters, …. Etc
• It’s expected that MC is slower than MP.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١٠
• That means with using single IC and clock source, and suitable power supply, you can build a programmable device to control a few appliances or even build a simple controller to be embedded in the appliance itself.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١١
Definition of Embedded Systems
• An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system, often with real‐time computing constraints.
• It is embedded as part of a complete device often including hardware and mechanical parts.
• Embedded systems control many devices in common use today.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١٢
Examples: Refrigerator
•
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١٣
Examples: Car Door
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١٤
Examples: Game : Electronic Ping‐pong•
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١٥
Examples: Derbot Autonomous Guided Vehicle
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١٦
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١٧
Example : DG starter card
•
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١٨
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers١٩
DG starter card demo
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢٠
Example : movement/intruder detector•
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢١
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢٢
Modern open source embedded systems• The Arduino microcontroller is an open‐source hardware
controller which is designed to easily interface with a variety of sensors (to register user inputs), and to drive the responses and behaviors of external components such as LEDs, motors, and speakers (to respond to user inputs)
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢٣
•
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢٤
Analog INPUTS
Digital I\OPWM(3, 5, 6, 9, 10, 11)
PWR IN USB (to Computer)
SCL\SDA(I2C Bus)
POWER 5V / 3.3V / GND
RESET
• Arduino is a small mother board, that has it’s clock generator, power source, USB interface, and of course boot loader.
• Arduino is expandable MC, you can buy extra upgrade board for WiFi, GSM, Ethernet, Motor driver, LCD,… etc.
• Arduino is programmed using high level language (mixed between C and Java), there is no assembly any more.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢٥
Example of Arduino Project : parking alarm
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢٦
Basics
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢٧
• Instruction Sets
– CISC: Complex Instruction Set Computer
– RISC: Reduced Instruction Set Computer
• Memory Types
– Volatile: Random Access Memory (RAM)
– Non‐volatile: Read Only Memory (ROM)
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢٨
Von Neumann and Harvard Computers•
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٢٩
Review of Memory Technologies
• Read Only Memory (ROM)
• Random Access Memory (RAM): Read/Write
• Static RAM (SRAM): Each cell is a simple flip‐flop of six transistors, CMOS, volatile
• Programmable ROM (PROM): Each cell is one transistor, MOS, non‐volatile, plastic package.
• Erasable PROM (EPROM): Each cell is one transistor, MOS, non‐volatile, erasable with ultraviolet light, ceramic package with quartz window.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٣٠
• Electrically EPROM (EEPROM): Each cell is one transistor with additional transistors for programming, MOS, non‐volatile, erasable electrically (takes time), suffers from wear.
• Flash Memory: Each cell is one transistor, MOS, non‐volatile, erasable electrically (takes time) in blocks, suffers from wear, popular.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٣١
Microprocessors and Microcontrollers• The microprocessor is a processor on one silicon chip.
• The microcontrollers are used in embedded computing.
• The microcontroller is a microprocessor with added circuitry.
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٣٢
Microcontrollers
•
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٣٣
Microcontroller Packaging and Appearance
• From left to right: PIC 12F508, PIC 16F84A, PIC 16C72, Motorola 68HC05B16, PIC 16F877, Motorola 68000
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٣٤
Thanks,..
See you next week (ISA),…
Dr. Ahmed ElShafee, ACU : Fall 2017, MicroControllers٣٥