You are on page 1of 17

051 MICROCONTROLLE

By: Rakesh Mani Amlaan Shakeel Arutselvan P.J.

What is a Microcontroller
A microcontroller is a programmable digital processor with necessary peripherals. Easily put, a microcontroller is a small highly integrated single chip which consists of a CPU, RAM, ROM, I/O Serial and Parallel, timers and interrupt controllers.
Examples: 8-bit: Intel 8051, Motorola 6811

Microproces sor vs. Microcontrol lers

S .No 1

Micro p ro ce s s o r A microprocessor is a general purpose device which is called a CPU

Micro co ntro lle r A microcontroller is a dedicated chip which is also called single chip computer.

A microprocessor do not contain onchip I/OPorts, Timers, Memories etc..

A microcontroller includes RAM, ROM, serial and parallel interface, timers, interrupt circuitry (in addition to CPU) in a single chip.

Microprocessors

are

most

commonly used as the CPU in microcomputer systems 4 Microprocessor instructions are

Microcontrollers are used in small, minimum component designs performing control-oriented applications. Microcontroller instructions are both bit addressable as well as byte addressable. Microcontrollers catering outputs. to the have control instruction of inputs sets and

mainly nibble or byte addressable 5 Microprocessor instruction sets are mainly intended for catering to large volumes of data.

Intel 8051:
Introducti on

The 8051 microcontroller is a very popular 8-bit microcontroller, i.e the CPU can work on only 8 bits of data at a Time. Introduced by Intel in the year 1981, The 8051 is based on an 8-bit CISC core. Its 8-bit architecture is optimized for control applications with

Salient Features
1. 2. 3. 4. 5.

6. 7.

8.

4 KB on chip program memory (ROM or EPROM). 128 bytes on RAM. 8-bit data bus 16-bit address bus 32 general purpose registers each of 8 bits Two -16 bit timers T0 and T1 Five Interrupts (3 internal and 2 external). Four Parallel ports each of 8-bits (PORT0, PORT1,PORT2,PORT3) with a total of 32 I/O lines.

Pin Diagram

Port 0 : It is an 8-bit I/O port with dual purpose. If external memory is used, these port pins are used for the lower address byte address/data (AD0-AD7), otherwise all bits of the port are either input or output.. Port 1: Port 1 occupies a total of 8 pins (pins 1 through 8). It has no dual application and acts only as input or output port Upon reset, Port 1 is configured as an output port. To configure it as an input port , a high bit must be sent to all the port pins. Port 2 : Port 2 is also an eight bit parallel port. (pins 21- 28). It can be used as input or output port. Upon reset, Port 2 is configured as an output port.To be used as input port, all the port bits must be made high PORT 3 : Port3 is also an 8-bit parallel port with dual function. ( pins 10 to 17). The port pins can be used for I/O operations as well as for control operations

Interfacing in 8051

LCD Display interfacing

Registers in 8051
Register are used to store information temporarily, while the information could be a byte of data to be processed, or an address pointing to the data to be fetched. The vast majority of 8051 registers are 8-bit registers. The 8 bits of a register are shown from MSB D7 to the LSB D0 with an 8-bit data type. Any data larger than 8 bits must be broken into 8-bit chunks before it is processed. The most widely used registers:

A (Accumulator) - for all arithmetic and logic instructions B, R0, R1, R2, R3, R4, R5, R6, R7 DPTR (data pointer) PC (program counter)

Memory
Micro-controller needs a program which is a set of commands. This program enlightens Microcontroller to perform precise tasks. These programs need a storage space on which they can be accumulated and interpret by Microcontroller to act upon any specific process. The memory which is brought into play to accumulate the program of Microcontroller is recognized as Program memory or code memory. In common language its also known as Read Only Memory or ROM. Micro-controller also needs a memory to amass data or operands for the short term. The storage space which is employed to momentarily data storage for functioning is acknowledged as Data Memory and we employ Random Access Memory or RAM for this principle reason. Microcontroller 8051 contains code memory or program memory 4K so that is has 4KB Rom

Time Delay
CPU executing an instruction takes a certain number of clock cycles. These are referred as to as machine cycles. The length of machine cycle depends on the frequency of the crystal oscillator connected to 8051. In the original 8051, one machine cycle lasts 12 oscillator periods. Two factors can affect the accuracy of the delay: 1) Crystal frequency The duration of the clock period of the machine cycle is a function of this crystal frequency 2) 8051 design The original machine cycle duration was set at 12 clocks. Advances in both IC technology and CPU design in recent years

Interrupts
Interrupt is a sub-routine call that reads the Microcontrollers key function or job and helps it to perform some other program which is extra important at that point of time. The characteristic of Interrupt is extremely constructive as it aids in emergency cases. Interrupts provides us a method to postpone or delay the current process, carry out a sub-routine task and then all over again restart standard program implementation. The Micro-controller 8051 can be assembled in such a manner that it momentarily stops or break the core program at the happening of interrupt. When subroutine task is finished then the implementation of core program initiates automatically as usual. There

m a S

e l p

o C

e d

You might also like