You are on page 1of 5

HEXADECIMAL UP/DOWN COUNTER USING 8051

Objective:
The objective of the report is to design and implement a Hexadecimal Up/Down The objective
of the report is to design and implement a Hexadecimal Up/Down Counter using the 8051
microcontroller, with the programming done in Keil software. The report will detail the
hardware and software components involved in the project, explaining the counter's operation,
and providing the source code. It will also cover the testing and verification process to ensure
the counter functions correctly in both up and down counting modes.

Abstract:
This project focuses on the design and implementation of a Hexadecimal Up/Down Counter
utilizing the versatile 8051 microcontroller, programmed with Assembly Language
Programming (ALP) within the Keil software environment. The primary objective is to create
a digital counter capable of incrementing and decrementing hexadecimal values, providing
valuable insight into the intricacies of microcontroller programming and digital circuit design.
The report begins with an introduction to the project, outlining the significance of hexadecimal
counters and the chosen microcontroller, the 8051.

Hardware / Software Requirements:

KEIL uVISION 5

Working Principle:
Justify The Hexadecimal Up/Down Counter using the 8051 microcontroller operates by
processing Assembly Language Programming (ALP) instructions through Keil software. The
counter starts at a predefined hexadecimal value and can either increment or decrement based
on the input signal. In the up-counting mode, the microcontroller adds 1 to the current value,
and in the down-counting mode, it subtracts 1.
The process continues until a certain condition is met, at which point the counter halts. This
project demonstrates the fundamental principles of microcontroller-based digital counting and
control.
Approach / Methodology / Programs:
Initialization: Set up ports for input by reading the input commands.
Main Loop: Read the input command to determine the counting direction (up or down).
Depending on the direction, increment or decrement the hexadecimal value.
Condition Check: Continuously monitor for certain conditions like reaching a maximum or
minimum count.
Termination: Halt the counter when the predefined condition is met.
Repeat: Loop back to the main loop to allow continuous up/down counting.
This approach enables the 8051 microcontroller to perform hexadecimal counting while
controlling the direction and visual representation of the count.

CODE 1 :-

ORG 0H

SJMP 30H
ORG 30H
MOV a,#00
BACK: ACALL DELAY
INC a
JNZ BACK
HERE: SJMP HERE
DELAY: MOV r1, #0FFH
DECR1: MOV r2, #0FFH
DECR: MOV r3, #0FFH
DJNZ r3, $
DJNZ r2, DECR
DJNZ r1, DECR1
RET
END
CODE 2:-

ORG 0H
SJMP 30H
ORG 30H
MOV a,#00
BACK: ACALL DELAY
DEC a
JNZ BACK
HERE: SJMP HERE
DELAY: MOV r1, #0FFH
DECR1: MOV r2, #0FFH
DECR: MOV r3, #0FFH
DJNZ r3, $
DJNZ r2, DECR
DJNZ r1, DECR1
RET
END
Project Photos:
Conclusion:
In conclusion, the Hexadecimal Up/Down Counter project using the 8051 microcontroller and
Assembly Language Programming (ALP) in Keil software demonstrates a practical application
of digital electronics and microcontroller programming. This project successfully achieved the
goal of creating a versatile counter that can increment and decrement hexadecimal values. It
provided valuable insights into microcontroller interfacing, ALP coding, and the integration of
input and output devices. The project's testing and validation ensured its functionality and
reliability. Through this project, we've gained a deeper understanding of the 8051
microcontroller, digital circuit design, and the effective use of ALP, which can be applied in
various embedded systems and electronics projects.

References:
https://www.tutorialspoint.com/microprocessor/microcontrollers_8051_architecture.htm
https://en.wikipedia.org/wiki/Intel_8051

You might also like