FIGURE : The external interface to the standard ‘8051’

Pin(s) and their Function:

  • 1–8 Port 1. The bi-directional pins on this port may be used for input and output: each pin may be individually controlled and – for example – some may be used for input while others on the same port are used for output.
  • 9 The ‘Reset’ pin.
  • 10–17 Port 3. Another bi-directional input port (same operation as Port 1). Each pin on this port also serves an additional function.Pin 10 and Pin 11 are used to receive and transmit (respectively) serial data using the ‘RS-232’protocol. Pin 12 and Pin 13 are used to process interrupt inputs. Pin 14 and Pin 15 have alternative functions associated with Timer 0 and Timer 1 .Pin 16 and Pin 17 are used when working with external memory. 18–19 These pins are used to connect an external crystal, ceramic resonator or oscillator module to the microcontroller.
  • 20 Vss. This is the ‘ground’ pin.
  • 21–28 Port 2. Another bi-directional input port (same operation as Port 1).These pins are also used when working with external memory.
  • 29 Program Store Enable (PSEN) is used to control access to external CODE memory (if used).
  • 30 Address Latch Enable (ALE) is used when working with external memory.
  • 31 External Access (EA). To execute code from internal memory (e.g. on-chip Flash, where available) this pin must be connected to Vcc. To execute code from external memory, this pin must be connected to ground. Forgetting to connect this pin to Vcc is a common error when people first begin working with the 8051.
  • 32–39 Port 0. Another bi-directional input port (same operation as Port 1).  These pins are also used when working with external memory.
  • 40 Vcc. This is the ‘5V’ pin (on 5V devices; 3V on 3V devices, etc).


What is meant by micro controller?
Microcontroller is a small chip that has in-build Micro processor, memory, ports, timers and converter. Micro controllers are designed for specific use. For instance, micro controller in TV remote is mainly designed for controlling TV.

List some of the 8051 microcontroller manufacturers?
Maxim/Dellas semiconductor

What is difference between microprocessor and microcontroller?
The microprocessor has no ROM, RAM and no I/O ports on the chip itself.
Whereas the microcontroller has a CPU in addition to a fixed amount of RAM,ROM, I/O ports and a timer all on a single chip.

List out the features of 8051 micro controller?
40 Pin IC.
128 bytes of RAM.
2 Timers (Timer 0 and Timer 1).
32 Input/ Output pins.
1 serial port.
6 Interrupts (Including Reset).

What are the types of interrupts in 8051?
External interrupt 0 (IE0) has highest priority among interrupts.
Timer interrupt 0 (TF0)
External interrupt 1 (IE1)
Timer interrupt 1 (TF1) has lowest priority among other interrupts.
Serial port Interrupt

What is an interrupt?
Hardware or software can communicate to micro controller through interrupts. Interrupts are external signal that controls the micro processor. Interrupt signals are generated by sources like software programs or hardware controls.

What is meant by Register?
Registers are temporary storage area in micro controller. It can hold a value of 1- byte memory space.

What is Special Function Registers (SFR)?
The memory addresses from 80H to 0FFH are called SFR. These are 128 bytes registers specially designed for interrupts and few other operations.

Introduction to Embedded Systems:

● Looking around, we find ourselves to be surrounded by various types of embedded systems .
● Be it a digital camera or a mobile phone or a washing machine, all of them has some kind of processor functioning inside it.
● An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints.
● Main 3 components of Embedded system – hardware, processor(one or many) and software
○ Associated with each processor is the embedded software.
○ If hardware forms the body of an embedded system, embedded processor acts as the brain, and embedded software forms its soul.
○ It is the embedded software which primarily governs the functioning of embedded systems.
● There used to be no mechanism to find what the program was doing. LEDs, switches, etc. were used to check correct execution of the program.
● As time progressed, use of microprocessor-specific assembly-only as the programming language reduced and embedded systems moved onto C as the embedded programming language of choice.

1. Embedded systems hardware:
● As with any electronic system, an embedded system requires a hardware platform on which to run.
● The hardware will be based around a microprocessor or microcontroller.
● The embedded system hardware will also contain other elements including memory, input output (I/O) interfaces as well as the user interface, and the display.
● When using an embedded system there is a choice between the use of a microcontroller or a microprocessor.

● Micro-controller based systems:
○ A microcontroller is essentially a CPU, central processor unit, or processor with integrated memory or peripheral devices.
○ As fewer external components are needed, embedded system using microcontrollers tend to be more widely used

● Microprocessor based systems:
○ Microprocessors contain a CPU but use external chips for memory and peripheral interfaces.
○ As they require more devices on the board, but they allow more expansion and selection of exact peripherals, etc, this approach tends to be used for the larger embedded systems.

a. sbit:
● This data type is used in case of accessing a single bit of SFR register.
● Syntax: sbit variable name = SFR bit ;
● Ex: sbit a=P2^1;
● Explanation: If we assign p2.1 as ‘a’ variable, then we can use ‘a’ instead of p2.1 anywhere in the program, which reduces the complexity of the program.

b. bit:
● This data type is used for accessing the bit addressable memory of RAM (20h-2fh).
● Syntax: bit variable name;
● Ex: bit c;
● Explanation: It is a bit sequence setting in a small data area that is used by a program to remember something.

This data type is used for accessing a SFR register by another name. All the SFR registers must be declared with capital letters.
Syntax: SFR variable name = SFR address of SFR register;
● Ex: SFR port0=0x80;
● Explanation: If we assign 0x80 as ‘port0’, then we can use 0x80 instead of port0 anywhere in the program, which reduces the complexity of the

● SFR Register :
○ The SFR stands for ‘Special Function Register’. Microcontroller 8051 has 256 bytes of RAM memory.
○ This RAM is divided into two parts: the first part of 128 bytes is used for data storage, and the other of 128 bytes is used for SFR registers.
○ All peripheral devices like I/O ports, timers and counters are stored in the SFR register, and each element has a unique address.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s