charu2539211
Junior Member level 3
- Joined
- Jul 22, 2013
- Messages
- 31
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 8
- Activity points
- 200
Hi
i am writing a code for pic 16f887 in assembly language which has to count how many times the porta0 is switched on and set the respective port to indicate it
loop:
first time a0=1 => b0=1
second time a0=1 => b1=1
third time a0=1 => b2=1
fourth time a0=1 => goto loop
when a0=0
portb= ffh
i tried it by myself, but only b0 is getting set every time i switch on a0.
can anyone suggest a proper alogrithm code it??
i am writing a code for pic 16f887 in assembly language which has to count how many times the porta0 is switched on and set the respective port to indicate it
loop:
first time a0=1 => b0=1
second time a0=1 => b1=1
third time a0=1 => b2=1
fourth time a0=1 => goto loop
when a0=0
portb= ffh
i tried it by myself, but only b0 is getting set every time i switch on a0.
can anyone suggest a proper alogrithm code it??