1000Views2Replies

Author Options:

Help in asssembly programming for AT89S52 (8051) for blinking LEDs? Answered

P3.0 has a push to on switch
P2 has 8 LEDs

I need the LEDs to blink as:
If switch is ON the Port P2 goes as:
1000 0001
1100 0011
1110 0111
1111 1111

This condition holds indefinitely until Switch is pressed again (OFF) and the Port P2 goes as:
1111 1111
1110 0111
1100 0011
1000 0001
0000 0000
This condition holds indefinitely until switch is pressed again (ON) and first conditions occurs.

Any help would be appreciated.

Thankyou!




Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
amendiratta
amendiratta

Answer 8 years ago

Not exactly. A friend asked me this. I got it though. I made some mistakes earlier, now its working!

0
steveastrouk
steveastrouk

Answer 8 years ago

Did you use a code array to store the number pattern ? The MOVC @DPTR+A instruction is great for that.