Hi,
my objective is to make the 8 leds (p2.0 , p2.1 , p2.2 ...... p2.7) blink 1 by 1 from left to right.
for example, 0 0 0 0 0 0 0 1 --> 0 0 0 0 0 0 1 0 --> 0 0 0 0 0 1 0 0 --> 0 0 0 0 1 0 0 0 --> 0 0 0 1 0 0 0 0 ---> ..... 1 0 0 0 0 0 0 0
however i'm stuck as only first led (0 0 0 0 0 0 0 1) lights up and it doesn't progress to the light up the next led (0 0 0 0 0 0 1 0).
CODE
Loop:
mov a,#00000001b ;led 1 lights up first.
mov p2,a ;move accumulator to port 2
rl a ;rotate left for accumulator
sjmp Loop ;jump back to loop
what am i doing wrong here ?
my objective is to make the 8 leds (p2.0 , p2.1 , p2.2 ...... p2.7) blink 1 by 1 from left to right.
for example, 0 0 0 0 0 0 0 1 --> 0 0 0 0 0 0 1 0 --> 0 0 0 0 0 1 0 0 --> 0 0 0 0 1 0 0 0 --> 0 0 0 1 0 0 0 0 ---> ..... 1 0 0 0 0 0 0 0
however i'm stuck as only first led (0 0 0 0 0 0 0 1) lights up and it doesn't progress to the light up the next led (0 0 0 0 0 0 1 0).
CODE
Loop:
mov a,#00000001b ;led 1 lights up first.
mov p2,a ;move accumulator to port 2
rl a ;rotate left for accumulator
sjmp Loop ;jump back to loop
what am i doing wrong here ?