introducing microcontrollers system...
TRANSCRIPT
Introducing Microcontrollers System Design
Eng. Ahmed S. AfifiEng. Ahmed S. Afifi
1
• Mini-ComputerCPU (Brain)
1. Arithmetic Logic Unit (ALU)2. Control Unit3. Register
Program/ Data Memory Peripherals (Input/Output) Buses (data, address and control)
What is a Microcontroller?
2
Computer Essentials
3
Von Neumann and Harvard Computers
4
Microcontrollers
5
- Microprocessors
Microprocessors vs. Microcontrollers
General Purpose
Microprocessor
RAM ROM TimerSerialCOMPort
IO Port
Data BUS
Address BUS
Control BUS
CPU RAM ROM
I/OTimerSerialPort
- Microcontrollers
6
Embedded SystemGeneral Block Diagram
Microcontroller(uC)
sensor
sensor
sensor
Sensor conditioning
Output interfaces
actuator
indicator
7
Types of microcontrollers
8
Microcontroller Packaging and Appearance
From left to right: PIC 12F508, PIC 16F84A, PIC 16C72, Motorola 68HC05B16, PIC 16F877, Motorola 68000
9
What are PIC’s?What are PIC’s? Programmable Intelligent Computer Developed by Microchip Technology in 1975 Microcontrollers NOT Microprocessors Microprocessor system with number of
components (EEPROM, RAM, I/O Support)
http://o.mneina.googlepages.com/what_is_microcontroller.htm
10
ApplicationsApplications Automotive systems Airplanes Toys Medical Devices Furniture
Why Important?
11
Why Important?
Microchip – Human Interface Lab(http://www.microchip.com/stellent/)
Appliances Human interface:
• Touch Screen Display, Button Control, Audio handling
Home systems:• Heating & Cooling, Security
Cell phones
GSM Phone hacked(http://hackedgadgets.com)
12
Examples: Refrigerator
13
Examples: Car Door
14
Examples: Robot Autonomous Guided Vehicle
15
PIC Family Stack Size Instruction Word Size
No of Instructions
Interrupt Vectors
12CX/12FX 2 12- or 14-bit 33 None
16C5X/16F5X 2 12-bit 33 None
16CX/16FX 8 14-bit 35 1
17CX 16 16-bit 58 4
18CX/18FX 32 16-bit 75 2
PIC Families
‘C’ implies CMOS technology; Complementary Metal Oxide Semiconductor
‘F’ insert indicates incorporation of Flash memory technology
Example: 16C84 was the first of its kind. It was later reissued as the 16F84, incorporating Flash memory technology. It was then reissued as 16F84A.
16
PIC Families Divided into families
8-bit: 8F, 16F, 18F 16-bit: 24F, ds33F 32-bit: 32F
Minor differences Power Consumption Speed Package size Memory Capacity
17
PIC Families
8-bit: Max Speed 20 MIPS (mill. instr / sec) Generally 4 cycle processor Memory Range <1kB to 128kB instruction up to 32 kB data
16-bit: Max speed 40 MIPS 2 Cycle Processor Memory Range <1kB to 256kB instruction up to 32kB data
32-bit: Max speed 80 MIPS 5 stage pipeline, out of order Memory Range 32kB to 512kB instruction up to 32kB data
18
vhttp://www.microchip.com/stellent/images/mchpsiteimages/en537986.jpg
19
PIC16Fxxx
• Microcontroller PIC 16F84A– Architecture, Instructions, Applications
• Microcontroller PIC 16F877– Architecture, Applications with, Keypad, LCD, Stepper motors, Analog to
digital conversions, Timers, PWM, Serial communications, graphical LCD
20
Programming Languages
ASM• Low level• Full Control
C, BASIC, Forth, LOGO….• Easy to use• Slow
21
1. Proteus.2. MPLAB, MPASM3. MicroC.4. QL-2006 programmerPic
simulator.
Software Requirements
22
Hardware Requirements1. Pc.2. QL-2006 Programmer..3. Other components as:
pic16F84A..pic16f877a..breadboard.. resistors….capacitors…LCD… sensor…Oscillator ..power supply
23
Oscillator
24
25
• PIC can be bread-boarded, with the following important connections:– Power– Ground– Reset signal– Crystal (oscillator)
Necessary Connections
26
PIC16F84A
27
The PIC16F84A belongs to the mid-range family.
18-pin Enhanced FLASH/EEPROM 8-Bit Microcontroller.
Harvard architecture.
Only 35 single word instructions to learn.
Operating speed 20 MHz clock input /200 ns instruction cycle.
25 mA sink/source max. Per pin.
10,000 erase/write cycles Enhanced FLASH Program memory typical.
10,000,000 typical erase/write cycles EEPROM Data memory typical.
15 Special Function Hardware registers. Direct, indirect and relative addressing modes Four interrupt sources:
1- External RB0/INT pin2- TMR0 timer overflow 3- PORTB<7:4> interrupt-on-change4- Data EEPROM write complete
The program memory contains 1K words. 14-bit wide instruction words. 8-bit wide data bytes. The data memory (RAM) contains 68 bytes Data EEPROM is 64 bytes.
PIC16F84A
28
A84F16PIC
29
Program Memory
30
Data Memory
31
(Buffer)First Application
32
(Buffer)First Application
33
ان شاء هللا لما نخلص الكورس DI\O تخرج قیم على المیكرو) دیجیتال او انالوج (ھتعرف تقرا قیم بالمیكرو
تعرف تربط المیكروكنترولر بالكمبیوتر وتبادل البیانات ما بینھمLCD تعرف تربط المیكروكنترول بالنعرف نتعامل مع االشارات االنالوج
Dc motorتعرف تتحكم بال
34
35
THANK YOU
36