Thursday, 16 February 2017

8051 MICROCONTROLLER

   Microcontroller is a single chip which has a central processing unit in addition RAM, ROM, TIMMERS, COUNTERS and INPUT/ OUTPUT Ports. In other words the central processing unit (Processor), RAM, ROM, TIMMERS, COUNTERS and INPUT/ OUTPUT Ports are all embedded together on one chip, therefore the designer cannot add any external memory, INPUT/ OUTPUT Ports or timers to it.

HISTORY OF 8051 MICROCONTROLLER: In 1981, Intel Corporation introduced an 8-bit microcontroller called the 8051.This microcontroller had 128 bytes of RAM, 4K bytes  of on-chip ROM, two timers one serial port , and four INPUT/ OUTPUT Ports each of 8 bits wide all on single chip. At the time it was also referred to as a “SYSTEM ON A CHIP”, the 8051 is an 8-bit processor, meaning that the central processing unit (CPU) can work on only on 8 bits of data at a time. Data larger than 8 bits has to be broke into 8-bit pieces to be processed by the central processing unit. The 8051 has 4 INPUT/ OUTPUT Ports, each of 8 bits wide. Although the 8051 can have maximum of 64K bytes of on-chip ROM, many manufacturers have put only 4K bytes on the chip.

CRITERIA TO CHOOSE A MICROCONTOLLER: The first and foremost criterion in choosing a microcontroller is that it must meet the task at hand efficiently and cost effectively.
       Some other considerations are,
·        Speed: the maximum speed a microcontroller can support.
·        The amount of RAM and ROM on chip
·        Power consumption: This especially critical for battery powered products.
·        The number of INPUT/ OUTPUT Ports.
·        The number of timers and counters.
·        Packaging: This is important in terms of space, assembling, and prototyping the end product.
·        How easy it is to upgrade to higher performance or lower power consumption versions.
·        Cost per unit.
·        How easy it is develop products around it.
·        Ready availability in needed quantities both now and in future.

REGISTERS: In the central processing unit , registers are used to store the information temporarily. That 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. In the 8051 there is only one data type:8 bits. The 8 bits of register  are from the MSB (most significant bit)D7 to the LSB(least significant bit)D0. With an 8 bit data type, any data larger than 8 bits must be broken into 8 bit chunks before it is processed.
There are a large number of registers in the 8051 some of them are discussed here.The most widely used registers of the 8051 are A (accumulator), B, R0, R1, R2, R3, R4, R5, R6, R7, DPTR (data pointer) and PC(program counter).All of the above registers are 8 bits, except DPTR and the program counter. The accumulator, register A, is used for arithmetic and logic instructions .

PROGRAM COUNTERThe important register in the 8051 is the PC (program counter). The program counter points to the address of the next instruction to be executed. As the  central processing unit fetches the opcode from the program ROM. The program counter in the 8051 is 16 bits wide. This means that the 8051 can access program addresses 0000 to ffffh, a total of  64K bytes of code.

8051 DATA TYPES AND DIRECTIVES: The 8051 microcontroller has only one data type. it is 8 bits, and the size of each register is also 8 bits. It is the job of the programmer to break down data larger than 8 bits (00 to ffh, or 0 to 255 in decimal) to be processed by the central processing unit.

ASSEMBLER DIRECTIVES:

 DB (define byte): The define byte directive is the most widely used data directive in the assembler. It is used to define the 8 bit data. When DB is used to define data, the numbers can be in decimal, binary, hex, or ASCII formats. For decimal , the “D” after  the  decimal number is optional, but using “B” (binary) and “H” (hexadecimal) for the others is required. Regardless of which is used, the assembler will convert the numbers to hex during execution.

ORG (origin): The origin directive is used to indicate the beginning of the address. The number that comes after ORG can be either in hex or in decimal. If the number is not followed by H, it is decimal and the assembler will convert it to hex.

EQU (equate): This is used to define a constant without occupying a memory location. The EQU directive does not set aside storage foe data item but associates a constant value with a data label so that when the label appears in the program, its constant value will be substituted for the label.

END directive: Another important pseudo code is the END directive. This indicates to the assembler the end of the source (asm) file. The END directive is the last line of an 8051 program, meaning that in the source code anything after the END directive is ignored by the assembler.

No comments:

Post a Comment

we are hear to discuss your queries ,so please feel free to ask any of your queries.

Wikipedia

Search results