Upload
deborah-mcintosh
View
166
Download
3
Embed Size (px)
DESCRIPTION
Lecturer: Kalamullah Ramli. Fundamental of Computer Engineering Departement of Electrical Engineering University of Indonesia. Microcontroller: Introduction. Outline. What is Microcontroller Microprocessor vs Microcontroller Some Types of Microcontroller MCS51 Features - PowerPoint PPT Presentation
Citation preview
Microcontroller: IntroductionMicrocontroller: Introduction
Fundamental of Computer Engineering
Departement of Electrical Engineering University of Indonesia
Lecturer: Kalamullah Ramli
Slide - Slide - 22µµController Lecture - 2004Controller Lecture - 2004
OutlineOutline
What is MicrocontrollerWhat is Microcontroller Microprocessor vs MicrocontrollerMicroprocessor vs Microcontroller Some Types of MicrocontrollerSome Types of Microcontroller MCS51 FeaturesMCS51 Features AT89C51 Basic Features, AT89C51 Basic Features,
Architecture Sample ApplicationArchitecture Sample Application
Slide - Slide - 33µµController Lecture - 2004Controller Lecture - 2004
What is Microcontroller? What is Microcontroller? (1/7)(1/7)
Microcontrollers are hidden inside a Microcontrollers are hidden inside a surprising number of products these surprising number of products these daysdays
Basically, any product or device that Basically, any product or device that interacts with its user has a interacts with its user has a microcontroller buried inside microcontroller buried inside
A microcontroller is a computerA microcontroller is a computer All computers -- whether we are talking All computers -- whether we are talking
about a personal desktop computer or a about a personal desktop computer or a large mainframe computer or a large mainframe computer or a microcontroller -- have several things in microcontroller -- have several things in common: common:
Slide - Slide - 44µµController Lecture - 2004Controller Lecture - 2004
What is Microcontroller? What is Microcontroller? (2/7)(2/7)
All computers have a CPU (central processing unit) that executes programs
If you are sitting at a desktop computer right now reading this article, the CPU in that machine is executing a program that implements the power point that is displaying this page.
The CPU loads the program from somewhere. On your desktop machine, the browser program is loaded from the hard disk
The computer has some RAM (random-access memory) where it can store "variables"
The computer has some input and output devices so it can talk to people.
Slide - Slide - 55µµController Lecture - 2004Controller Lecture - 2004
What is Microcontroller? What is Microcontroller? (3/7)(3/7)
The desktop computer we are using is a The desktop computer we are using is a "general purpose computer“"general purpose computer“
It can run any of thousands of programs Microcontrollers are "special purpose Microcontrollers are "special purpose
computers" computers" Microcontrollers do one thing well
There are a number of other common There are a number of other common characteristics that define microcontrollerscharacteristics that define microcontrollers
If a computer matches a majority of these If a computer matches a majority of these characteristics, then you can call it a characteristics, then you can call it a "microcontroller":"microcontroller":
Microcontrollers are "embedded" inside some other device (often a consumer product) so that they can control the features or actions of the product
Slide - Slide - 66µµController Lecture - 2004Controller Lecture - 2004
What is Microcontroller? What is Microcontroller? (4/7)(4/7)
Another name for a microcontroller, therefore, is "embedded controller"
Microcontrollers are dedicated to one task Microcontrollers are dedicated to one task and run one specific programand run one specific program
The program is stored in ROM (read-only memory) and generally does not change
Microcontrollers are often low-power devices. Microcontrollers are often low-power devices. A desktop computer is almost always plugged into a wall
socket and might consume 50 watts of electricity A battery-operated microcontroller might consume 50
milliwatts
Slide - Slide - 77µµController Lecture - 2004Controller Lecture - 2004
What is Microcontroller? What is Microcontroller? (5/7)(5/7)
A microcontroller has a dedicated input device A microcontroller has a dedicated input device and often (but not always) has a small LED or and often (but not always) has a small LED or LCD display for outputLCD display for output
A microcontroller also takes input from the A microcontroller also takes input from the device it is controlling and controls the device device it is controlling and controls the device by sending signals to different components in by sending signals to different components in the device. the device.
The microcontroller inside a TV takes input from the remote control and displays output on the TV screen
The controller controls the channel selector, the speaker system and certain adjustments on the picture tube electronics such as tint and brightness
Slide - Slide - 88µµController Lecture - 2004Controller Lecture - 2004
What is Microcontroller? What is Microcontroller? (6/7)(6/7)
The engine controller in a car takes input from sensors such as the oxygen and knock sensors and controls things like fuel mix and spark plug timing
A microwave oven controller takes input from a keypad, displays output on an LCD display and controls a relay that turns the microwave generator on and off
A microcontroller is often small and low costA microcontroller is often small and low cost The components are chosen to minimize size and to be as
inexpensive as possible
Slide - Slide - 99µµController Lecture - 2004Controller Lecture - 2004
What is Microcontroller? What is Microcontroller? (7/7)(7/7)
A microcontroller is often, but not always, A microcontroller is often, but not always, ruggedized in some wayruggedized in some way
The microcontroller controlling a car's engine, for example, has to work in temperature extremes that a normal computer generally cannot handle
A car's microcontroller in Alaska has to work fine in -30 degree F (-34 C) weather, while the same microcontroller in Nevada might be operating at 120 degrees F (49 C)
On the other hand, a microcontroller embedded inside a VCR hasn't been ruggedized at all
Slide - Slide - 1010µµController Lecture - 2004Controller Lecture - 2004
Microprocessor vs Microprocessor vs MicrocontrollerMicrocontroller General purpose Vs Dedicated Machine
A MicroProcessor is a general purpose machine while a MicroController is a dedicated machine
Embedded SystemsMicroProcessors need external RAM and ROM for
a complete system; while most of the MicroControllers have built in RAM and ROMs ( Nowadays EEPROMs )
“No Direct Talk” Vs “Direct Talk” (Interface)MicroProcessors cannot directly “talk” or
interfaced to outside world; they need chips to do so e.g. 8255 for Parallel Communication and 8251 for Serial Communication (for Intel Systems). MicroController have dedicated ports for these interfaces e.g. Port 1 and RxD & TxD of 89C51
Slide - Slide - 1111µµController Lecture - 2004Controller Lecture - 2004
Low-end Microcontroller Low-end Microcontroller ComponentsComponents 20 bytes of RAM20 bytes of RAM 1000 bytes of ROM1000 bytes of ROM 8 I/O Pins8 I/O Pins
Slide - Slide - 1212µµController Lecture - 2004Controller Lecture - 2004
Some Types of MicrocontrollerSome Types of Microcontroller
Z-80Z-80 Usually contained in a Digital Cell Phone 8-bit Microprocessor
MotorollaMotorolla e.g., in Microwave Oven
Intel 8051Intel 8051 Good for dedicated purpose
Programmer Interface Controller Programmer Interface Controller (PIC) by Microchip(PIC) by Microchip
Slide - Slide - 1313µµController Lecture - 2004Controller Lecture - 2004
Various Microcontrollers in MCS51 Various Microcontrollers in MCS51 FamilyFamily
PartNumber
On-ChipCodeMemory
On-ChipDataMemory
No ofTimers
xx31 0K ROM 128 bytes 2
xx51 4K ROM 128 bytes 2
xx32 0K ROM 256 bytes 3
xx52 8K ROM 256 bytes 3
Slide - Slide - 1414µµController Lecture - 2004Controller Lecture - 2004
8051 Features8051 Features
8051 was developed by Intel in the late 80’s8051 was developed by Intel in the late 80’s Newer versions can contain USB interfaces, Newer versions can contain USB interfaces,
Ethernet, Data Acquisition Systems, Flash, etcEthernet, Data Acquisition Systems, Flash, etc "New high performance single chip "New high performance single chip
microprocessors" microprocessors" 8 bit 8 bit 12 MHz 12 MHz Harvard Architecture Harvard Architecture 4k ROM 4k ROM 128 bytes RAM128 bytes RAM 32 i/o lines 32 i/o lines 2 counter/timers 2 counter/timers 1 serial port 1 serial port
Slide - Slide - 1515µµController Lecture - 2004Controller Lecture - 2004
8051 Features8051 Features
1 serial port 1 serial port bit manipulation instructions bit manipulation instructions hardware multiply & divide 4usec hardware multiply & divide 4usec 64k address space program 64k address space program 64k address data 64k address data 12 clocks per instruction 1 MIPS 12 clocks per instruction 1 MIPS 8751 (Ceramic EPROM version $25.00) 8751 (Ceramic EPROM version $25.00) Newer versions range from a few dollars (a Newer versions range from a few dollars (a
small footprint chip), to over a hundred small footprint chip), to over a hundred (complete with battery backup, clock, ram, (complete with battery backup, clock, ram, software download, etc) dollars. software download, etc) dollars.
Slide - Slide - 1616µµController Lecture - 2004Controller Lecture - 2004
AT89C51 Basic FeaturesAT89C51 Basic Features
4 K Bytes ROM 128 Bytes RAM Four 8-bit I/O Ports Two 16 Bit Timers Serial Interface 64 K External Code Memory Space 64 K External Data Memory Space Boolean processor (operates on single bits) 210 Bit Addressable Locations 4 Microseconds Multiply / Divide
Slide - Slide - 1717µµController Lecture - 2004Controller Lecture - 2004
AT89C51 Internal ArchitectureAT89C51 Internal Architecture
Slide - Slide - 1818µµController Lecture - 2004Controller Lecture - 2004
AT89C51 Pinouts DiagramAT89C51 Pinouts Diagram
Slide - Slide - 1919µµController Lecture - 2004Controller Lecture - 2004
Motor Control Demonstration: Block Motor Control Demonstration: Block DiagramDiagram
Micro-Controller DAC
DataLines
In
M
Slide - Slide - 2020µµController Lecture - 2004Controller Lecture - 2004
Motor Control Demonstration: Circuit Motor Control Demonstration: Circuit DiagramDiagram
Slide - Slide - 2121µµController Lecture - 2004Controller Lecture - 2004
Motor Control Demonstration: Progr. Motor Control Demonstration: Progr. ListList
; THI S PROGRAM I MPLEMENTS MOTOR CONTROL ;USI NG PC SERI AL LI NK
ORG 00HLJ MP MAI NORG 30HMAI N:
MOV I E,#00H ; Disable all interruptsMOV SCON,#52H ; Set up serial port f or mode 1MOV TMOD,#20H ; Baud rate provided by timer 1,
;timer1 in mode 2 operationMOV TH1,#-13 ; Reload count f or 2400 baud
;rate
Slide - Slide - 2222µµController Lecture - 2004Controller Lecture - 2004
Motor Control Demonstration: Progr. Motor Control Demonstration: Progr. ListList
SETB TR1 ; Start timer 1CLR RI ; ; Clear RI f or any previous
;received byteAGAI N:
J NB RI ,$ ; Wait f or reception of a byte ;f rom PC
CLR RI ; Clear flag to enable f urther ;reception
MOV A,SBUF ; Store received data in aMOV P1,A ; Move that data to p1 connected
;to DACSJ MP AGAI N ; Wait to receive another word
END
Slide - Slide - 2323µµController Lecture - 2004Controller Lecture - 2004
TO BE CONTINUEDTO BE CONTINUED