Searching \ for '[PIC] : Delay loops' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/time.htm?key=delay
Search entire site for: ': Delay loops'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] : Delay loops'
2002\08\05@180149 by Jinx

face picon face
>  bsf PORTB, 4
>  bsf PORTB, 1  ;---------------------
>  ; delay for at least 2ms
>  movlw 0x95
>  movwf Dlay
>  movlw 0x02
>  movwf Dlay + 1

>  decfsz Dlay
>   goto $ - 1

>  decfsz Dlay + 1
>   goto $ - 3

Hi Mike, the problem is that the inner loop (decfsz Dlay, goto $-1) is
being executed only twice. So your total delay is $195, not $295, or
770us short. Make it MOVLW 0x03, MOVWF Dlay+1 and you'll be
in business

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


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