Archive for the ‘8051’ Category

Interfacing dot matrix LED display to 8051

Interfacing dot matrix LED display to 8051 microcontroller. LED dot matrix display. An LED dot matrix display consists of a matrix of  LED’s arranged in a rectangular configuration. The desired character or graphics can be displayed by switching ON /OFF  a desired configuration of LED’s. Common display configurations available are 7×5, 8×8, 7×15, etc. LED dot matrix can be used in simple display applications where the resolution is not a big concern.  The figure below shows the arrangement of LEDs in a typical 7×5 dot matrix display.   Any individual LED or a group of LEDs in the matrix can…

Read More

Interfacing hex keypad to 8051

This article is about interfacing a hex key pad to 8051 microcontroller. A clear knowledge on interfacing hex key pad to 8051 is  very essential  while designing embedded system projects which requires character or numeric input or both. For example projects like digital code lock, numeric calculator etc. Before going to the interfacing in detail, let’s have a look at the hex keypad. Hex keypad. Hex key pad is essentially a collection of 16 keys arranged in the form of a 4×4 matrix. Hex key pad usually have keys representing numerics 0 to 9 and characters A to F. The…

Read More

Delay using 8051 timer

Delay using 8051 timer.  The 8051 microcontroller has two independent 16 bit up counting timers named Timer 0 and Timer 1 and this article is about generating time delays using the 8051 timers. Generating delay using pure software loops have been already discussed here but such delays are poor in accuracy and cannot be used in sensitive applications. Delay using timer is the most accurate and surely the best method. A timer can be generalized as a multi-bit counter which increments/decrements itself on receiving a clock signal and produces an interrupt signal up on roll over. When the counter is…

Read More

Software delay routine in 8051 microcontroller

Software delay routine in 8051 In an 8051 microcontroller, it requires 12  cycles of the processor clock for executing a single instruction cycle.  For an 8051 microcontroller clocked by a 12MHz crystal, the time taken for executing one instruction cycle is 1µS and it is according to the equation,  Time for 1 instruction cycle= 12 /12MHz = 1µS.  The shortest instructions will execute in 1µS and other instructions will take 2 or more micro seconds depending up on the size of the instruction. Thus a time delay of any magnitude can be generated by looping suitable instructions a required number…

Read More

Random number generator using 8051

Random number generator using 8051. A  random number generator using 8051 that  displays a random number between 0 & 99 is shown in this article. The circuit it self is very simple and may not find any applications in serious embedded projects and this article is just an illustration. The circuit is based on AT89S51 microcontroller, two seven segment LED displays, two transistors and few passive components. Circuit diagram. The two seven segment LED displays are multiplexed together and their data lines are connected to Port0  of the microcontroller. Transistors Q1 and Q2 drives the corresponding displays D1 and D2….

Read More

Voltmeter using 8051

Voltmeter using 8051. A simple 0-5V voltmeter using 8051 is shown in this article. This digital voltmeter has a sensitivity of  200mV which is a bit low but this project is meant for demonstrating how an ADC and seven segment display can be interfaced to 8051 to obtain a digital readout of the input voltage. A 31/2 digit high end voltmeter will be added soon. ADC0804 is the ADC and AT89S51 is the controller used in this project. Before attempting this project, go through these projects Interfacing ADC to 8051 and Interfacing seven segment display to 8051 which will give you a…

Read More

Interfacing DC motor to 8051

This article shows how to interface a DC motor to an 8051 microcontroller. Interfacing DC motor to 8051 forms an essential part in designing embedded robotic projects. A well designed 8051-DC motor  system  has essentially two parts. Firstly an 8051 with the required software to control the motor and secondly a suitable driver circuit. Most of the DC motors have  power requirements well out of the reach of a microcontroller and more over the voltage spikes produced while reversing the direction of rotation could easily damage the microcontroller. So it is not wise to connect a DC motor directly to the…

Read More

Interfacing Seven segment display to 8051

A Note about 7 segment LED display. This article is about how to interface a seven segment LED display to an 8051 microcontroller. 7 segment LED display is  very popular and it can display digits from 0 to 9 and quite a few characters like A, b, C, ., H, E, e, F, n, o,t,u,y, etc. Knowledge about how to interface a seven segment display to a micro controller is very essential in designing embedded systems. A seven segment display consists of seven LEDs arranged in the form of a squarish ’8′ slightly inclined to the right and a single…

Read More

External Interrupts handling in 8051

In this article, I would like to introduce you to the concept of interrupts, how interrupts work, vector address, interrupt priority and how to write an ISR (interrupt service routine). “Interruption” in English language means a deviation from the normal routine. We know the processor is always busy executing some kind of instructions. What if there  occurs an urgent condition that we need to pause the processor from its current activities for some time and make it execute/do something else? Also we need to resume the processor back to its operations after executing our “urgent condition”. To meet such a…

Read More

Interfacing LED and push button switch to 8051

This article is all about how to interface push button switches to an 8051 microcontroller. Push button switches are widely used in embedded system projects and the knowledge about  interfacing them to  8051 is very essential in designing such projects. A typical push button switch has two active terminals that are normally open and these two terminals get internally shorted when the push button is depressed. Images of a typical pushbutton switch is shown below. Circuit diagram. The circuit diagram for interfacing  push button switch to 8051 is shown above. AT89S51 is the microcontroller used here. The circuit is so designed that…

Read More