I am trying to make a simple counter using pic16f877a. iI want to count each time a push button is pressed, that is taking one press as one count, regardless of how long the button is pressed.
Softwares iThe software I am using are MPLAB X IDE and XC8 compiler. iI use pickitPickit 3.5. i I use an indicator LED to see whether the code is working.
The thing is, iI have barely achieved what iI needed., but the code seems unstable. itIt works sometimes but not in others. For example, let say the code worked now and LED blinked correctly when one of two connected buttons pushed. thenThen if iI "make" and "download" the program again without any edits to the code in MPLAB X IDE, the LED won't blink. whileWhile writing this iI tested several times just by making and downloading using MPLAB IDE, without changing anything hardware or code, and then it worked. theThe only thing that was changed in those situations was TIME. so iI suspect this has something to do with resetting of the picPIC although iI have no idea. Never worked on 2 consecutive "make and download"s.
Please help. Thank you very much.