27 October, 2015


The program shows how to display prime numbers. Here two for loops are used. A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. For example, 5 is prime, as only 1 and 5 divide it, whereas 6 is composite, since it has the divisors 2 and 3 in addition to 1 and 6Read More

5 April, 2012

Addressing Modes in 8051

The CPU can access the data in various ways. The data could be in a register, or in memory or be provided as an immediate value. These various ways of accessing data are called addressing modes. The various addressing modes of a microprocessor are determined when it is designed, and therefore cannot be changed by the programmer.Read More

5 April, 2012

Bit Addresses for I/O and RAM

Many microprocessors such as X86 and Pentium allow programs to access registers and I/O ports in byte size only. In other words, if you need to check a single bit an I/O port, you must read the entire byte first and then manipulate the whole byte with some logic instructions to get hold of the desired single bit. This is not the case with the 8051. Read More

10 April, 2012

Pins Description Of The 8051 Microcontroller

Pins On The 8051 Microcontroller: 1–8 (Port 1): Each of these pins can be used as either input or output according to functionality. Also, pins 1 and 2 (P1.0 and P1.1) have special functions associated with Timer 2. 9-Reset Signal: high logical state on this input halts the MCU and clears all the registers. Bringing this pin back to Read More

11 April, 2012

Loop And Jump Instructions

LOOP: Repeating a sequence of instructions a certain number of times is called a loop. Loop action is performed by DJNZ reg, Label The register is decremented If it is not zero, it jumps to the target address referred to by the label Prior to the start of loop the register is loaded with the counter for the number of repetitions Counter can be R0 – R7 or RAM locationRead More

1 March, 2012

RAM memory space allocation in the 8051

There are 128 bytes of RAM in the 8051. The 128 bytes of RAM inside the 8051 are assigned addresses 00 to 7FH. They can be accessed directly as memory locations. These 128 bytes are divided into three different groups.A total of 32 bytes from locations 00 to 1FH are set aside for register banks and the stack.Read More

4 February, 2012

Registers in 8051 microcontroller

In the CPU, registers are used to store 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. With an 8-bit data type, any data larger than 8-bits must be broken into 8-bit chunks before it is processed.Read More

2 February, 2012

Program counter in 8051

Another 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 CPU fetches the opcode from the program ROM, the program counter is incremented to point to the next instruction. The program counter in the 8051 is 16-bits wide. Read More