{"id":20956911,"url":"https://github.com/gmostofabd/8051-push-button","last_synced_at":"2025-12-29T07:26:17.332Z","repository":{"id":152405364,"uuid":"370326226","full_name":"gmostofabd/8051-Push-Button","owner":"gmostofabd","description":"🔗 This repository guides you to learn about digital input reading using an 8051 Microcontroller. The program is written in Assembly language and well-commented to ensure clarity. To read the digital input, two tactile push button switches are connected to I/O pins.","archived":false,"fork":false,"pushed_at":"2024-09-23T10:48:39.000Z","size":492,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T23:44:14.343Z","etag":null,"topics":["8051","assembly","circuit","debouncing","digital","download","hex","input","mcu","microcontroller","programming","proteus","pull-down","pull-up","read","schematic","simulation","switch"],"latest_commit_sha":null,"homepage":"https://gmostofabd.github.io/8051-Push-Button/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmostofabd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-24T11:19:25.000Z","updated_at":"2024-09-23T13:44:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"d42453f3-50bb-4f67-b457-976a07fc840f","html_url":"https://github.com/gmostofabd/8051-Push-Button","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmostofabd%2F8051-Push-Button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmostofabd%2F8051-Push-Button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmostofabd%2F8051-Push-Button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmostofabd%2F8051-Push-Button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmostofabd","download_url":"https://codeload.github.com/gmostofabd/8051-Push-Button/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243352034,"owners_count":20276916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["8051","assembly","circuit","debouncing","digital","download","hex","input","mcu","microcontroller","programming","proteus","pull-down","pull-up","read","schematic","simulation","switch"],"created_at":"2024-11-19T01:28:33.967Z","updated_at":"2025-12-29T07:26:17.306Z","avatar_url":"https://github.com/gmostofabd.png","language":"HTML","readme":"# ⚙️ **8051 Push Button**\n\nThis repository guides you to learn about digital input reading using an **8051 Microcontroller**. The program is written in **Assembly language** and well-commented to ensure clarity. To read the digital input, two tactile push button switches are connected to I/O pins. \n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/78910261/203802195-3d1d0b39-7d0f-4a25-88e8-6e8e4f05cb55.png\" alt=\"AT89C51 UP DN COUNTER 7 Segment\" width=\"70%\"\u003e\n\u003c/p\u003e\n\n\n\n\n\n\n\nWe will explore two modes:\n1. **Normally High**, low when pressed.\n2. **Normally Low**, high when pressed.\n\nTwo circuit configurations with **Pull-Up** and **Pull-Down** techniques are demonstrated below.\n\n---\n\n## 📖 **Overview**\n\nThis project uses **push buttons** to read digital input on an **AT89C51** microcontroller. It covers essential concepts of **switch debouncing** to ensure reliable button presses. The repository includes:\n- **Assembly Code**\n- **Precompiled HEX file**\n- **Proteus Simulation Circuit**\n\n---\n\n## 🔑 **Keywords**\n\n**[AT89C51 Microcontroller](https://www.atmel.com/products/microcontrollers/8051.aspx)** | **Push Button Debounce** | **Assembly Language** | **Proteus Simulation** | **Microcontroller Programming**\n\n---\n\n## 🛠️ **Hardware \u0026 Circuit Information**\n\n\u003cdiv align=\"center\"\u003e\n\n| Component                      | Description                                                  |\n|---------------------------------|--------------------------------------------------------------|\n| **AT89C51 Microcontroller**     | Controls the system and reads the input from push buttons     |\n| **Push Buttons**                | Two tactile switches configured with pull-up or pull-down     |\n| **Resistors**                   | Current-limiting for protecting input pins and the MCU        |\n| **Capacitor**                   | For hardware debouncing (optional)                           |\n| **Power Supply**                | 5V DC for the microcontroller circuit                        |\n\n\u003c/div\u003e\n\n### Circuit Configuration: Pull-Up and Pull-Down Techniques\n\n1. **Pull-Up Configuration**: The input pin is connected to a high voltage (logic HIGH) via a resistor, and pressing the button connects the pin to ground (logic LOW).\n   \n   **Pull-Up Circuit**:\n   ```text\n   VCC ----[R]---- Input Pin\n                    |\n                  Switch\n                    |\n                   GND\n   ```\n\n2. **Pull-Down Configuration**: The input pin is connected to ground (logic LOW) via a resistor, and pressing the button connects the pin to a high voltage (logic HIGH).\n\n   **Pull-Down Circuit**:\n   ```text\n   GND ----[R]---- Input Pin\n                    |\n                  Switch\n                    |\n                   VCC\n   ```\n\n---\n\n## 🛠️ **Switch Debounce**\n\nWhen you press a mechanical switch, the contacts may bounce before stabilizing, leading to multiple readings of a single press. This effect is called **bouncing**, and it can cause unreliable behavior in your microcontroller program.\n\n### Why is Debouncing Necessary?\n\nWithout debouncing, a single press may register multiple times due to rapid bouncing. This can cause erratic behavior in your system.\n\n### Techniques for Debouncing\n\n1. **Hardware Debouncing**:\n   Use a capacitor across the switch contacts to smooth out the bouncing effect.\n\n2. **Software Debouncing**:\n   Add a small delay in your code to allow the switch to stabilize before reading the final state.\n\n### Example of Software Debouncing in C:\n```c\n#define DEBOUNCE_DELAY 50 // 50 milliseconds\n\nint debounceSwitch(int pin) {\n  if (digitalRead(pin) == HIGH) {   // if the switch is pressed\n    delay(DEBOUNCE_DELAY);          // wait for the debounce period\n    if (digitalRead(pin) == HIGH) { // check the state again\n      return 1;                     // switch is pressed\n    }\n  }\n  return 0;                         // switch is not pressed\n}\n```\n\n---\n\n## 📦 **Repository Contents**\n\n| File                            | Description                                               |\n|----------------------------------|-----------------------------------------------------------|\n| `AT89C51_Push_Button.asm`        | Assembly code for reading push buttons                    |\n| `AT89C51_Push_Button.hex`        | Precompiled HEX file for microcontroller programming       |\n| `Proteus_Push_Button_Simulation.pdsprj` | Proteus simulation file for testing the circuit          |\n| **Screenshots**                  | Images of the simulation and real hardware testing         |\n\n---\n\n## 🚀 **How to Use**\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/your-repo/8051-Push-Button.git\n   ```\n\n2. **Compile the Assembly Code**:\n   Open the `AT89C51_Push_Button.asm` in an **8051 IDE**, and compile it to generate the **HEX file**.\n\n3. **Simulate in Proteus**:\n   Open **Proteus Design Suite** and load the provided simulation file.\n\n4. **Program the Microcontroller**:\n   Upload the **HEX file** to your **AT89C51** microcontroller and test the circuit with real hardware.\n\n---\n\n## 🤝 **Contributing**\n\nWe welcome contributions! Feel free to submit pull requests or open issues to suggest improvements.\n\n---\n\n## 📧 **Contact**\n\nFor questions or assistance, contact me at [mostofa.melab@gmail.com](mailto:mostofa.melab@gmail.com).\n\n---\n\nGive this repository a ⭐ if you find it helpful!\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmostofabd%2F8051-push-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmostofabd%2F8051-push-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmostofabd%2F8051-push-button/lists"}