Witam
Chciałbym zrobić wąż świetlny 6 LED na procku 89C2051. Jak narazie zmieniłem pewien program, żeby dziłał tak jak chcę. Teraz program wygląda tak:
CPU atmel.def
start:
mov P1, #01111111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #01111111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11110011b
acall opz
mov P1, #00111111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11110011b
acall opz
mov P1, #11110011b
acall opz
mov P1, #11001111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #11110011b
acall opz
mov P1, #11001111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #11100011b
acall opz
mov P1, #00011111b
acall opz
mov P1, #11100011b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10110111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10110111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10110111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #10110111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10110111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #10110111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10111011b
acall opz
mov P1, #11011011b
acall opz
mov P1, #11101011b
acall opz
mov P1, #11110011b
acall opz
mov P1, #01110011b
acall opz
mov P1, #10110011b
acall opz
mov P1, #11010011b
acall opz
mov P1, #11100011b
acall opz
mov P1, #01100011b
acall opz
mov P1, #10100011b
acall opz
mov P1, #11000011b
acall opz
mov P1, #01000011b
acall opz
mov P1, #10000011b
acall opz
mov P1, #00000011b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #10000111b
acall opz
mov P1, #10000111b
acall opz
mov P1, #00000011b
acall opz
mov P1, #00000011b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #10000111b
acall opz
mov P1, #10000111b
acall opz
mov P1, #00000011b
acall opz
mov P1, #10000111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #00001111b
acall opz
mov P1, #00000111b
acall opz
mov P1, #00000011b
acall opz
mov P1, #00000111b
acall opz
mov P1, #00001111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #00001111b
acall opz
mov P1, #00000111b
acall opz
mov P1, #00000011b
acall opz
mov P1, #00000111b
acall opz
mov P1, #00001111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111111b
acall opz
ajmp start
opz:
mov A, #FFh
op: mov B, #FFh
o: djnz B, o
djnz A, op
ret
END
Chciałbym do programu dodać kilka funkcji, ale ponieważ w programowaniu jestem zero {-10}, to prosiłbym o pomoc.
Mianowicie chodzi mi o to, żeby układ miał fuckcję zmieniania prędkości. Ma byś realizowana z pomocą dwóch przycisków. Jednym będzie się zwiększać prędkość mrugania LEDów, a drugim zmniejszać.
Pozatym przydatna byłaby funkcja Lock, czyli po jednym naciśnięciu tego prczycisku program by pozostawał przy danym trybie świecenia.
Może niezbyt jasno się wyraziłem, bo jest to mój drugi program, a nigdzie nie uczyłem się programowania
Załączam schemat.
Pozdr.
Chciałbym zrobić wąż świetlny 6 LED na procku 89C2051. Jak narazie zmieniłem pewien program, żeby dziłał tak jak chcę. Teraz program wygląda tak:
CPU atmel.def
start:
mov P1, #01111111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #01111111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11110011b
acall opz
mov P1, #00111111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11110011b
acall opz
mov P1, #11110011b
acall opz
mov P1, #11001111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #11110011b
acall opz
mov P1, #11001111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #11100011b
acall opz
mov P1, #00011111b
acall opz
mov P1, #11100011b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10110111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10110111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10110111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #10110111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10110111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #10110111b
acall opz
mov P1, #01111011b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #01111011b
acall opz
mov P1, #10111011b
acall opz
mov P1, #11011011b
acall opz
mov P1, #11101011b
acall opz
mov P1, #11110011b
acall opz
mov P1, #01110011b
acall opz
mov P1, #10110011b
acall opz
mov P1, #11010011b
acall opz
mov P1, #11100011b
acall opz
mov P1, #01100011b
acall opz
mov P1, #10100011b
acall opz
mov P1, #11000011b
acall opz
mov P1, #01000011b
acall opz
mov P1, #10000011b
acall opz
mov P1, #00000011b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111011b
acall opz
mov P1, #10111111b
acall opz
mov P1, #11110111b
acall opz
mov P1, #11011111b
acall opz
mov P1, #11101111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #10000111b
acall opz
mov P1, #10000111b
acall opz
mov P1, #00000011b
acall opz
mov P1, #00000011b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #10000111b
acall opz
mov P1, #10000111b
acall opz
mov P1, #00000011b
acall opz
mov P1, #10000111b
acall opz
mov P1, #11001111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #00001111b
acall opz
mov P1, #00000111b
acall opz
mov P1, #00000011b
acall opz
mov P1, #00000111b
acall opz
mov P1, #00001111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #00001111b
acall opz
mov P1, #00000111b
acall opz
mov P1, #00000011b
acall opz
mov P1, #00000111b
acall opz
mov P1, #00001111b
acall opz
mov P1, #00011111b
acall opz
mov P1, #00111111b
acall opz
mov P1, #01111111b
acall opz
mov P1, #11111111b
acall opz
ajmp start
opz:
mov A, #FFh
op: mov B, #FFh
o: djnz B, o
djnz A, op
ret
END
Chciałbym do programu dodać kilka funkcji, ale ponieważ w programowaniu jestem zero {-10}, to prosiłbym o pomoc.
Mianowicie chodzi mi o to, żeby układ miał fuckcję zmieniania prędkości. Ma byś realizowana z pomocą dwóch przycisków. Jednym będzie się zwiększać prędkość mrugania LEDów, a drugim zmniejszać.
Pozatym przydatna byłaby funkcja Lock, czyli po jednym naciśnięciu tego prczycisku program by pozostawał przy danym trybie świecenia.
Może niezbyt jasno się wyraziłem, bo jest to mój drugi program, a nigdzie nie uczyłem się programowania
Załączam schemat.
Pozdr.