Friday, June 7, 2013

Calculator with Assembly - PIC16F877

Detailed specifications of the program

Output
The result will be shown on the 7 segment display after entering number 1, number 2 and the operation.

Input
The input is taking from the keypad matrix based on PORTB by pressing on
1
2
3
4
5
6
7
8
9
*
0
#

Note:
  • You have to input 1st number then 2nd number then the operation
  • To input a number you have to enter it digit by digit then press #
  • Operations:
    • 1 represent sum ( + )
    • 2 represent subtract ( - )
    • 3 represent multiply ( * )
    • 4 represent divide ( / )
Program starts to enter number 1, when you hit "1" on the keypad now number 1 have "1".
Now hit "6" and number 1 will be "16"
To end editing in number 1 hit "#" and it will appear on the screen.

Now you have to enter number 2, hit "2" so number 2 is equal to "2".
Hit "#" to end editing and it will appear on the screen.

Now you have to enter the operation, hit "1" to sum the 2 numbers.



Now you have to enter the operation, hit "2" to subtract the 2 numbers.



Now you have to enter the operation, hit "3" to multiply the 2 numbers.


Now you have to enter the operation, hit "4" to divide the 2 numbers.


Program Properties


List of the used resources
  •  Laptop with windows platform.
  •  MPLAB X IDE v1.70 for developing.
  • PIC Simulator IDE for simulating PIC16F877 microcontroller.
    • Keypad Matrix
    • 7 Segment Display
  • PIC C Language.

Keypad Matrix configuration


7 Segment Display configuration


Download Code here.

No comments:

Post a Comment