piclist 2001\04\04\112155a >
Thread: pic changing program speed ?
www.piclist.com/techref/microchip/devices.htm?key=pic
flavicon
face BY : David Cary email (remove spam text)



I believe that
Roman Black <KILLspamfastvid@spam@spamEraseMEEZY.NET.AU> on 2001-04-04 04:06:30 AM
meant to write something like this:

;================================================================
;= waitXX100msec -> long time delay routine (with clrwdt!)      =
;================================================================
waitXX100msec   movwf   GreatwaitReg            ; store the waiting
time! (msb)

loop_outer:
               clrf    count_inner             ; prepare lsb

loop_inner:
               decfsz  count_inner             ; dec and loop 256 times
               goto    loop_inner              ; 1+2 inst x 256 (delay period)

               clrwdt                          ; give the dog a bone
               decfsz  GreatwaitReg            ; dec outer loop counter
               goto    loop_outer              ; 1+1+2 inst x value of
Greatwaitreg
                                                ; (delay period)

               retlw   0                       ; return
;================================================================
; You can add a third (or fourth) loop with no effort, and
; for varying timings you can always load the inner loop
; vars with a value instead of clearing them (which=256).
;
; My personal pref with stepper motors is to set the inner
; loop value so that when Greatvalue==256 I get the slowest
; speed I need. You then get the best speed range possible
; just by varying the Greatvalue byte.
; -- Roman Black

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


<86256A24.00543407.00@Brunswickoutdoor.com>

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) pic changing program speed ?

month overview.

new search...