280 likes | 724 Views
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
E N D
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 • AT89C51 Basic Features, Architecture Sample Application
What is Microcontroller? (1/7) • Microcontrollers are hidden inside a surprising number of products these days • Basically, any product or device that interacts with its user has a microcontroller buried inside • A microcontroller is a computer • All computers -- whether we are talking about a personal desktop computer or a large mainframe computer or a microcontroller -- have several things in common:
What is Microcontroller? (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.
What is Microcontroller? (3/7) • The desktop computer we are using is a "general purpose computer“ • It can run any of thousands of programs • Microcontrollers are "special purpose computers" • Microcontrollers do one thing well • There are a number of other common characteristics that define microcontrollers • If a computer matches a majority of these characteristics, then you can call it a "microcontroller": • Microcontrollers are "embedded" inside some other device (often a consumer product) so that they can control the features or actions of the product
What is Microcontroller? (4/7) • Another name for a microcontroller, therefore, is "embedded controller" • Microcontrollers are dedicated to one task and run one specific program • The program is stored in ROM (read-only memory) and generally does not change • 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
What is Microcontroller? (5/7) • A microcontroller has a dedicated input device and often (but not always) has a small LED or LCD display for output • A microcontroller also takes input from the device it is controlling and controls the device by sending signals to different components in 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
What is Microcontroller? (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 cost • The components are chosen to minimize size and to be as inexpensive as possible
What is Microcontroller? (7/7) • A microcontroller is often, but not always, ruggedized 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
Microprocessor vs Microcontroller • General purpose Vs Dedicated Machine A MicroProcessor is a general purpose machine while a MicroController is a dedicated machine • Embedded Systems MicroProcessors 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
Low-end Microcontroller Components • 20 bytes of RAM • 1000 bytes of ROM • 8 I/O Pins
Some Types of Microcontroller • Z-80 • Usually contained in a Digital Cell Phone • 8-bit Microprocessor • Motorolla • e.g., in Microwave Oven • Intel 8051 • Good for dedicated purpose • Programmer Interface Controller (PIC) by Microchip
8051 Features • 8051 was developed by Intel in the late 80’s • Newer versions can contain USB interfaces, Ethernet, Data Acquisition Systems, Flash, etc • "New high performance single chip microprocessors" • 8 bit • 12 MHz • Harvard Architecture • 4k ROM • 128 bytes RAM • 32 i/o lines • 2 counter/timers • 1 serial port
8051 Features • 1 serial port • bit manipulation instructions • hardware multiply & divide 4usec • 64k address space program • 64k address data • 12 clocks per instruction 1 MIPS • 8751 (Ceramic EPROM version $25.00) • Newer versions range from a few dollars (a small footprint chip), to over a hundred (complete with battery backup, clock, ram, software download, etc) dollars.
AT89C51 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