8051-Up-Down-Counter

⚙️ 8051 Up-Down Counter using Seven-Segment Display (SSD)

AT89C51 UP DN COUNTER 7 Segment


📖 Overview

This project demonstrates a simple Up-Down Counter using the AT89C51 Microcontroller, part of the 8051 MCU family. The counter output is displayed on a Seven-Segment Display (SSD) and controlled by external push buttons for incrementing, decrementing, and resetting.

The program is written in Assembly language, and the circuit is simulated using Proteus (Version 8.9). This repository includes:

The project has been successfully tested on both simulation and real hardware.


🔑 Keywords

AT89C51 Microcontroller | 8051 | Assembly Language | Simulation | Proteus | Microcontroller Programming


⚙️ Key Features

| Feature | Description | |-------------------------------|-----------------------------------------------------------------------------| | 🔢 **Up-Down Counter** | Real-time counting with a 7-segment display | | 🎛️ **Push Button Controls** | Buttons for incrementing, decrementing, and resetting the counter | | 🖥️ **Proteus Simulation** | Ready-to-use simulation circuit (Proteus 8.9 compatible) | | 💾 **Assembly Programming** | Written entirely in **Assembly language** for the AT89C51 | | 🛠️ **Real Hardware Support** | Tested successfully on physical hardware |


📦 Contents

| File | Description | |-------------------------------|-----------------------------------------------------------------------------| | `AT89C51_Up_Down_Counter.asm` | Assembly source code for the AT89C51 microcontroller | | `AT89C51_Up_Down_Counter.hex` | Precompiled HEX file for direct microcontroller upload | | `Proteus_Simulation.pdsprj` | Proteus Design Suite simulation file | | **Screenshots** | Demonstrations from the Proteus simulation |

🛠️ Hardware & Circuit Information

| Hardware Component | Description | |---------------------------------|-----------------------------------------------------------------------------| | **AT89C51 Microcontroller** | Core of the project, controlling the up-down counting | | **Seven-Segment Display (SSD)** | A common cathode display for output | | **Push Buttons** | Used for incrementing, decrementing, and resetting the counter | | **Transistors (e.g., NPN)** | To drive the SSD segments | | **Resistors** | For current-limiting to protect the microcontroller and SSD | | **Power Supply** | A 5V DC power supply for the microcontroller and SSD circuit |

7 Segment Display (Common Cathode)

Circuit Explanation:

The Seven-Segment Display in this project is a common cathode type, meaning all cathodes are connected to ground. The microcontroller sends signals to the anode pins through transistor drivers to control which segments are illuminated, forming numbers 0–9.

Each push button is connected to an input pin on the microcontroller, allowing the counter value to be incremented, decremented, or reset. Resistors ensure proper current control to prevent damage to the microcontroller and display.


🖥️ Installation & Usage

Step-by-Step Guide:

  1. Clone this repository:
    git clone https://github.com/gmostofabd/8051_Up_Down_Counter_SSD.git
    
  2. Compile the Assembly Code: Open the AT89C51_Up_Down_Counter.asm file in MIDE-51 or a compatible IDE, and compile it to generate the HEX file.

  3. Simulate in Proteus: Open Proteus Design Suite, load the provided simulation file, and run the simulation to observe the counter’s behavior.

  4. Program the Microcontroller: For real hardware, upload the HEX file to the AT89C51 microcontroller using a programmer.

  5. Test the Circuit: Assemble the hardware based on the provided circuit diagram, power it on, and test the push buttons for incrementing, decrementing, and resetting the counter.

🔗 Additional Information

Seven-Segment Display:

The common cathode display has 8 LEDs (7 segments and 1 decimal point) to represent digits 0-9. The microcontroller drives the LEDs through combinations of HIGH/LOW signals.

Push Button Controls:

For a deeper understanding of the circuit and code, explore the Proteus simulation and the comments in the assembly source file.


🤝 Contributing

We welcome contributions! Feel free to submit pull requests or open issues for any bug fixes, feature enhancements, or optimizations to the assembly code.


📧 Contact

For any inquiries or assistance, reach out at mostofa.melab@gmail.com.


Contact Graphic

If you found this project helpful, give it a ⭐ on GitHub!