Monday, 25 June 2012

Basic reset circuit for 8051 microprocessor

In 8051 microprocessor we have a pin named RESET which is pin no 9.RESET is an active High input for 8051.When RESET is set to High, 8051 microprocessor goes back to the power on state.
The 8051 microprocessor is reset by holding the RESET high for at least two machine cycles and then returning it low.This can be done by holding the switch in the circuit shown below.

  • First the capacitor is charged fully by the power supply.
  • After when the switch is pressed the charged is discharged and the reset is maintained High.
  • Then 8051 microprocessor  goes back to power on state.



simple reset circuit


Sunday, 24 June 2012

An 8051 micro controller's description

It contains
  • 4 Kb of ROM is not much at all.
  • 128b of RAM (including SFRs) satisfies the user's basic needs.
  • 4 ports having in total of 32 input/output lines are in most cases sufficient to make all necessary connections to peripheral environment as shown below.
8051 microcontroller
Pin 1-8(port 1)Each of these pins can be configured as an input or an output.

Pin 9(reset):A logic one on this pin disables the microcontroller and clears the contents of most registers. In other words, the positive voltage on this pin resets the microcontroller. By applying logic zero to this pin, the program starts execution from the beginning.

Pin 10-17(port 3): Similar to port 1, each of these pins can serve as general input or output. Besides, all of them have alternative functions:
Pin 10: RXD Serial asynchronous communication input or Serial synchronous communication output.
Pin 11: TXD Serial asynchronous communication output or Serial synchronous communication clock output.
Pin 12: INT0 Interrupt 0 input.
Pin 13: INT1 Interrupt 1 input.
Pin 14: T0 Counter 0 clock input.
Pin 15: T1 Counter 1 clock input.
Pin 16: WR Write to external (additional) RAM.
Pin 17: RD Read from external RAM.


Pin 18&19(x2,x1):Internal oscillator input and output. A quartz crystal which specifies 
operating frequently usually connected to these pins. Instead of it, miniature
ceramics resonators can also be used for frequency stability. Later versions
of microcontrollers operate at a frequency of 0 Hz up to over 50 Hz.


Pin 20(grnd):Ground


Pin 21-28(port2):If there is no intention to use external memory then these port pins are configured as general inputs/outputs. In case external memory is used, the higher address byte, i.e. addresses A8-A15 will appear on this port. Even though memory with capacity of 64Kb is not used, which means that not all eight port bits are used for its addressing, the rest of them are not available as inputs/outputs.


Pin 29(PSEN):If external ROM is used for storing program then a logic zero (0) appears on it every time the microcontroller reads a byte from memory.


Pin 30(ALE):Prior to reading from external memory, the microcontroller puts the lower address byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the ALE pin, the external register (usually 74HCT373 or 74HCT375 add-on chip) memorizes the state of P0 and uses it as a memory chip address. Immediately after that, the ALU pin is returned its previous logic state and P0 is now used as a Data Bus. As seen, port data multiplexing is performed by means of only one additional (and cheap) integrated circuit. In other words, this port is used for both data and address transmission


Pin 31(EA):By applying logic zero to this pin, P2 and P3 are used for data and address transmission with no regard to whether there is internal memory or not. It means that even there is a program written to the microcontroller, it will not be executed. Instead, the program written to external ROM will be executed. By applying logic one to the EA pin, the microcontroller will use both memories, first internal then external (if exists).


Pin 32-39(port 0):Similar to P2, if external memory is not used, these pins can be used as general inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is driven high (1) or as data output (Data Bus) when the ALE pin is driven low (0).


Pin 40(vcc):+5V power supply.

Thursday, 21 June 2012

Display of hexadecimal numbers i.e 0 To F

In this circuit we will display Hexadecimal numbers i.e 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F in a 7 segment display.I used a simple C program to give the desired output when an input is given.
Here is the code of that program   7segment.c.
We should generate a hex file from the above program and put it into any microcontroller of 8051 family.
The input must be given in the form of binary number of the respective hexadecimal numbes in the logic devices connected.

If use a common anode 7 segment display everything will remain same but  we use a 'ULN2803' mc which acts as a NOT gate means if you ON one of the terminal of the mc the opposite terminal will be grounded. That circuit is also given below.The c code will be remain same in both.
Table for input and output generated and their hexadecimal code


circuit using 8051 micro controller(common cathode)
circuit using 8051 micro controller(common anode)


Wednesday, 20 June 2012

7 segment,dispalying numbers

Here is a simple circuit for displaying numbers from 0 to 9 in a 7 segment display with common cathode.We use an 4511 ic to get the display.The ic (4511) is preprogrammed to give following output when respective input is given.
Table of input given and outputs generated


                                                pin no
                                             | 7| 1| 2| 6|         Displays 
                                             --------------------------
                                             | 0| 0| 0| 0|          0
                                             | 1| 0| 0| 0|          1
                                             | 0| 1| 0| 0|          2
                                             | 1| 1| 0| 0|          3
                                             | 0| 0| 1| 0|          4
                                             | 1| 0| 1| 0|          5 
                                             | 0| 1| 1| 0|          6
                                             | 1| 1| 1| 0|          7
                                             | 0| 0| 0| 1|          8
                                             | 1| 0| 0| 1|          9




Simple Circuit to display numbers in 7segment display