Page 1 of 1

Manual (not Free Run)Counter using PIC16F628A

Posted: Sat Aug 23, 2014 7:45 am
by Kriz
Hi Friends ,
Can any one help me to do coding for PIC16F628A , to build Counter Using Hitech C.
My requirement is , each time pressing button counter value should increment by one and need to include button for the decrements in a same way. :?

thank you!
Kriz

Re: Manual (not Free Run)Counter using PIC16F628A

Posted: Sun Aug 31, 2014 2:56 pm
by Neo
No time to write the whole program. As a help will write the pseudo code.

Initialise port / set direction

Set the pins connected to two buttons as inputs

click_count = 0;

while (1){

Read button 1

if clicked then
click_count++;
delay (100ms); // to avoid debounce effect
end if

Read button 2

if clicked then
click_count--;
delay (100ms); // to avoid debounce effect
end if

}

You can ask which step you need help on above code. Good luck!