Searching \ for 'Low Frequency, code snippit' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=low+frequency+code
Search entire site for: 'Low Frequency, code snippit'.

Truncated match.
PICList Thread
'Low Frequency, code snippit'
1999\06\03@030237 by Donald Riedinger

picon face
;16C5xxLP are good with 32.768 khz crystals and cheap
;With a 32.768 khz xtal this LED would flash once every 8 seconds:

; Loop 65536 times, then invert the LED
;
:Loop           djnz    Count0,:Loop    ;Decrement Count0 until it reaches zero
               djnz    Count1,:Loop    ;Decrement Count1.  If it's not zero,
                                       ;jump back to :Loop
               xor     RA,#00000010b   ;Invert the LED (bit 2 of port A)

;Add another loop and it's almost a day and a half

;You can size the first loop to the units you want to measure, then
count those loops
;This could be your input:

; Check button status.  If it's pressed, skip the additional delay and
jump
; back to the first loop
;

ChkBtn          jnb     RA.0,Start:Loop ;Jump to 1st loop if button is pressed
                                       ;(button is active low)
               mov     count0,#50      ;Limit first loop to time period you wan
t
:Loop           djnz    Count0,:Loop    ;Decrement Count0 until it reaches zero
               djnz    Count1,:Loop    ;Decrement Count1.  If it's not zero,
                                       ;jump back to :Loop
                                       ;Or limit Count1 to the number
of time periods
               jmp     Start:Loop      ;Jump back to first loop

;you can get into granularity and counting cycles but a stopwatch is the
way to go
;Code from Simple.src, Parallax Inc.

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...