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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/26/03 15:15
Read: times


 
#51495 - Led Timer Setting Clock values xx and yy
RalphBelow there is your second idea which counts up to 600 seconds and then turns on a led for 10 seconds and then turns off.

;PROGRAM TO DRIVE LED IN CURRENT SINK MODE
$TITLE (CURRENT SINK LED DRIVER PROGRAM, FLASH ON/OFF
$MOD51

ORG 0x0000 ; RESET START ADDRESS
JMP START ; JUMP OVER RESERVED ADDRESS SPACE
ORG 0040H ; PROGRAM START ADDRESS
START: CALL DELAY ;HOLDING DELAY
CLR P1.1 ;TURNS LED ON
call TenSec ;SETS FLASHING SPEED
SETB P1.1 ;TURNS LED OFF
JMP START ; REPEAT
DELAY: MOV R3,#60 ; TRIPLE LOOP HOLDING DELAY
TenSec: MOV R2,#0xxH ;The values xx & yy depend
LOOP1: MOV R1,#0yyH ;on your system clock
TAKE: DJNZ R1,TAKE
DJNZ R2,LOOP1
DJNZ R3,TenSec
RET
END

Hi George:


My system clock is 11.0592 Mhz. Not sure what vaules to plug in for xx and yy . I had forgotten to write that information on post. Also I should have said I was using a Metalink Assembler. You are using #60 to represent 60 seconds. Then it would loop 10 times to get 600 seconds? What formula do I use pick correct system clock vaules with out quessing them? I could keep pluging values in watch the leds reaction to it? Then change xx and yy till it worked correctly. What would be the proper way for programmer to pick the vaules? I also notice that 8051 books do not give you flowcharts of example programs in books. And not one book shows you how to recycle leds on p1.0,p1.1,p1.2,p1.3,p1.4,p1.5,p1.6,and p1.7. What I trying say turn led on p1.0 then off p1.0 next p1.1 on and then off till goes back to p1.0. A continous loop on these ports at 500ms intervals. With a flowchart in the book to show exactly what is happening to program. I purchased five books memtioned on 8052.com . some of these books are very new year 2000. However books on pic example 16c84 and 16f84 explain every line of code and have flow charts? Maybe this would be good discussion for 8052.com forum?


Best Regards,


Ralph

List of 5 messages in thread
TopicAuthorDate
Led Timer Setting Clock values xx and yy            01/01/70 00:00      
   RE: Led Timer Setting Clock values xx and yy            01/01/70 00:00      
      RE: Led Timer Setting Clock values xx and yy            01/01/70 00:00      
         RE: Led Timer Setting Clock values xx and yy            01/01/70 00:00      
            RE: Led Timer Setting Clock values xx and yy            01/01/70 00:00      

Back to Subject List