Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/08/01 07:36
Read: times


 
#13910 - RE: 8051 test code
a simple program, blinks p3.4, change the loops to change the blinking speed. may need a different include file
$MOD52 ; use 8052 predefined symbols

LED EQU P3.4 ; P3.4 is LED

ORG 00h


BLINK:
CPL LED ;flash (complement) the LED


CALL DELAY ; call software delay


JMP BLINK ; repeat indefinately



DELAY: ; delay 100ms



MOV R7,#200 ; 200 * 500us = 100ms


DLY1:

MOV R6,#229 ; 229 * 2.17us = 500us


DJNZ R6,$ ; sit here for 500us



DJNZ R7,DLY1 ; repeat 200 times (100ms delay)

RET

END

List of 5 messages in thread
TopicAuthorDate
8051 test code            01/01/70 00:00      
RE: 8051 test code            01/01/70 00:00      
RE: 8051 test code            01/01/70 00:00      
RE: 8051 test code            01/01/70 00:00      
RE: 8051 test code            01/01/70 00:00      

Back to Subject List