Friday, June 7, 2013

Fibonacci Series with Assembly - PIC16F877

The first 21 Fibonacci numbers Fn for n = 0, 1, 2, ..., 20 are:
F0F1F2F3F4F5F6F7F8F9F10F11F12F13F14F15F16F17F18F19F20
011235813213455891442333776109871597258441816765
Check Fibonacci Series here.

Detailed specifications of the program

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:
  • To input a number you have to enter it digit by digit then press #

Program starts to enter the index of the Fibonacci number you wish to end at it.
So if you enter 8, the program with output the first 8 Fibonacci numbers: 0, 1, 1, 2, 3, 5, 8, 13
When you hit "8" on the keypad now number have "8". To end editing in number hit "#" and the Fibonacci Series will appear on the display.

Output
The output can appear on 7 Segment Display based on PORTD(Data Port) & PORTA(Control Port).
The series will appeared with delay between them.








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