Published:2011/4/2 3:55:00 Author:Rebekka | Keyword: eight rolling subtitles | From:SeekIC
Delay subroutine, clr, lcall, ajmp instruction are mainly used in the experiment. Through lighting p1.0 …..P1.7 by turns to achieve the results. The user can preliminary master the IO port operation of SCM by this study of program.
Reference program:
Experiment 1 the simplest eight rolling subtitles. Conect the P1 port of CPU(JP44) with JP32 part of the Eight light by a data cable 8PIN; You will see 8 lights flashingalternately.
org 0000h; Start ajmp loop org 0030h; To avoid the sensitive address of 00-30 at 0030h loop:mov p1,#0ffh; Turn off all the lights. clr p1.0; Turn on light p1.0lcall delay; To delay for a whole? clr p1.1; Turn on light p1.1 lcall delay clr p1.2; Turn on light p1.2 lcall delay clr p1.3; Turn on light p1.3 lcall delay clr p1.4; Turn on light p1.4 lcall delay clr p1.5; Turn on light p1.5 lcall delay clr p1.6; Turn on light p1.6 lcall delay clr p1.7; Turn on light p1.7 lcall delay AJMP LOOP; To re-run at the beginning of loop delay: mov r5,#20; Delay. d1: mov r6,#40 d2: mov r7,#248 djnz r7,$ djnz r6,d2 djnz r5,d1 ret end
Reprinted Url Of This Article:
http://www.seekic.com/circuit_diagram/LED_and_Light_Circuit/The_simplest_eight_rolling_subtitles_circuit_diagram.html
Print this Page | Comments | Reading(3)
Code: