Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user

Simple number counter - PIC16F877A microControllermicrocontroller problem

enter image description hereI 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.

Simple number counter - PIC16F877A microController problem

enter image description hereI am trying to make a simple counter using pic16f877a. i 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 i am using are MPLAB X IDE and XC8 compiler. i use pickit 3.5. i use an indicator LED to see whether the code is working.

The thing is, i have barely achieved what i needed. but the code seems unstable. it 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. then if i "make" and "download" the program again without any edits to the code in MPLAB X IDE, the LED won't blink. while writing this i tested several times just by making and downloading using MPLAB IDE, without changing anything hardware or code, and then it worked. the only thing that was changed in those situations was TIME. so i suspect this has something to do with resetting of the pic although i have no idea. Never worked on 2 consecutive "make and download"s.

Please help. Thank you very much.

Simple number counter - PIC16F877A microcontroller problem

enter image description hereI am trying to make a simple counter using pic16f877a. I 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.

The software I am using are MPLAB X IDE and XC8 compiler. I use Pickit 3.5. I use an indicator LED to see whether the code is working.

The thing is, I have barely achieved what I needed, but the code seems unstable. It 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. Then if I "make" and "download" the program again without any edits to the code in MPLAB X IDE, the LED won't blink. While writing this I tested several times just by making and downloading using MPLAB IDE, without changing anything hardware or code, and then it worked. The only thing that was changed in those situations was TIME. I suspect this has something to do with resetting of the PIC although I have no idea. Never worked on 2 consecutive "make and download"s.

edited body
Source Link

enter image description hereenter image description hereI am trying to make a simple counter using pic16f877a. i 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.

enter image description hereI am trying to make a simple counter using pic16f877a. i 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.

enter image description hereI am trying to make a simple counter using pic16f877a. i 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.

edited body
Source Link

enter image description hereenter image description hereI am trying to make a simple counter using pic16f877a. i 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.

enter image description hereI am trying to make a simple counter using pic16f877a. i 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.

enter image description hereI am trying to make a simple counter using pic16f877a. i 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.

new schematic
Source Link
Loading
added schematic
Source Link
Loading
Source Link
Loading