This project is a firmware application designed for the PIC16F877A microcontroller to function as a calculator. It displays the results on an LM016L LCD display. The firmware is developed using the MPLAB X IDE and the XC8 compiler.
- MPLAB X IDE
- XC8 Compiler
- PIC16F877A Microcontroller
- Open the project in MPLAB X IDE.
- Ensure the XC8 compiler is selected.
- Build the project to generate the
.hex
or.cof
file. - Alternatively, you can build the project using Visual Studio Code with the MPLAB extension. Set the project output file path, name, and extension using
Ctrl+Shift+P
and selecting "Edit Project Properties".
Necessary components that can't be changed:
- PIC16F877A microcontroller: To run the program.
- LM016L LCD display: To display output.
- Quartz Crystal and 2 1nF non-polarized capacitors.
Optional components depending on your circuit:
- 16 Buttons
- 9 Resistors
After building the project, upload the generated .hex
or .cof
file to the PIC16F877A microcontroller using a suitable programmer. The file can be found in either of the following paths:
- In case of using MPLAB X IDE: dist\default\debug\PIC_Calculator.X.debug.cof
- In case of using Visual Studio Code (if the file name was set as default): out\PIC_Simple_Calculator\default.hex
- Connect the microcontroller and the necessary components as per the circuit diagram.
- Power on the system.
- The LCD will display the current input and results.
- Use the buttons to input numbers and operations.
- Ensure all connections are secure and correct.
- Verify the microcontroller is programmed with the correct
.hex
or.cof
file. - Check the power supply to the microcontroller and other components.
- If the LCD does not display correctly, check the connections and contrast settings.