Searching \ for 'Long Delays' 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/timers.htm?key=delay
Search entire site for: 'Long Delays'.

Truncated match.
PICList Thread
'Long Delays'
1996\04\21@222104 by Ken Parkyn

flavicon
picon face
Could anyone help me with a means of deriving a delay of between 5 seconds &
5 minutes.
I'd like to use a 16c56..is this possible?

TIA
Kenneth
As the poet said, "Only God can make a tree"... probably because it's so
hard to figure out how to get the bark on.

1996\04\21@235634 by Todd Peterson

picon face
One possible solution...
>Could anyone help me with a means of deriving a delay of between 5 seconds &
>5 minutes.
>I'd like to use a 16c56..is this possible?

Short of using a VERY slow clock, how about putting a 555 timer pulsing once
every, say, 5 seconds onto the RTCC input pin?  A 555 with a period of 5
seconds is not extremely accurate, but I assume that when you are timing
something to 5 minutes extreme accuracy is not critical.  You might want to
use one of the new CMOS versions of the 555 timer (the original 555 design
tends to be noisy on the power lines).  If you do use a 555, be sure to put
a bypass capacitor at its power terminals.

Todd Peterson




===========================================================
*** Developers of the PICPlus(TM) Microcontroller Board ***

Todd Peterson, Computer Engineer   (spam_OUTtpetersonTakeThisOuTspamnetins.net)
E-LAB Digital Engineering, Inc.

P.O. Box 246
Lawton, IA 51030-0246
(712) 944-5344

Visit us at: http://www.netins.net/showcase/elab/

E-Mail Now for Your Free PICPlus(TM) Information Packet!
TO: .....tpetersonKILLspamspam@spam@netins.net   (include POSTAL mailing address)
===========================================================

1996\04\22@031725 by Chaipi Wijnbergen

flavicon
picon face
Hi,

On Sun, 21 Apr 1996, Todd Peterson wrote:

{Quote hidden}

I also needed to measure a long delay (using the 16c54). I did it by
counting the timer overflow. for example, if you have an RC oscilator
running the PIC at about 70KHz then the timer is driven by FOsc/4 which
can be passed through 1:256 prescale which brings the timer overflow to
about 85/Sec. If you count this in a 16 bits counter, you can reach
minutes (but then you might want to have a better oscilator).


chaipi


                              \\\|///
                            \\  ~ ~  //
                             (  @ @  )
----------------------------oOOo-(_)-oOOo--------------------------------------
!                                                                             !
! Chaipi Wijnbergen                                                           !
! Electronics/Computer Eng. M.Sc.  Tel    : +972-8-9343079                    !
! Optical Imaging Laboratory       Fax    : +972-8-9344129                    !
! Brain Research Center            Email  : chaipispamKILLspamtohu0.weizmann.ac.il       !
! Weizmann Institute of Science    URL    : http://www.weizmann.ac.il/~chaipi !
! Rehovot 76100 ISRAEL             IPhone : chaipi                            !
!                                                                             !
------------------------------------Oooo.--------------------------------------
                         .oooO     (   )
                         (   )      ) /
                          \ (      (_/
                           \_)

1996\04\22@090454 by n/a

flavicon
picon face
Hi folks

>I also needed to measure a long delay (using the 16c54). I did it by
>counting the timer overflow. for example, if you have an RC oscilator
>running the PIC at about 70KHz then the timer is driven by FOsc/4 which
>can be passed through 1:256 prescale which brings the timer overflow to
>about 85/Sec. If you count this in a 16 bits counter, you can reach
>minutes (but then you might want to have a better oscilator).


     Here's my offering for a five min (approx) delay. Any criticisms
of this code by the Guru's on this list is very welcome - I'm a
semi-newbie so am interested in good advice. It's written for a 16C84
running at 0.5 mHz - yes I know the option command is not recommended,
but what the hell. It uses RTCC overflow to generate an interrupt every
10 millisecs, and counts them until five mins is reached.


rtcc    equ     01
timerh  equ     0c
timerl  equ     0d

       org     00              ; Skip interrupt routine.
       goto    init

       org     04              ; Timer Service Routine
       incf    timerl,1        ; On interrupt add 10
       btfsc   status,2        ; millisecs to the timer
       incf    timerh,1        ; (timerh and timerl)
       movlw   .217            ; Set next RTCC interrupt for
       movwf   rtcc            ; 0.01 second
       movlw   B'00000110'     ; set Option reg for RTCC
       option                  ; prescaler at 1:128
       movlw   B'10100000'     ; Reset interrupts
       movwf   intcon
       retfie                  ; Return from interrupt.


init    movlw   .217            ; Set next RTCC interrupt for
       movwf   rtcc            ; 0.01 second
       movlw   B'00000110'     ; set Option reg for RTCC
       option                  ; for prescaler at 1:128
       movlw   B'10100000'     ; Set interrupts
       movwf   intcon


wt5mins clrf    timerh
       clrf    timerl

wt5m    movlw   75              ; When high byte of timer
       xorwf   timerh,0        ; turns 75, time is 299.52 secs
       btfsc   status,2
       goto    fin
       goto    wt5m

fin     goto    fin




               Geoff


'Long Delays'
1997\09\26@014641 by Ken Parkyn
flavicon
picon face
Hullo all;

Can anyone please mail me some code for the
16C84 which will generate 1 - second delays
using the TNR0 register?

TIA
________________________________________
Ken Parkyn              email:
.....K.ParkynKILLspamspam.....sct.gu.edu.au
Office of Technical Services,  Electronics
Workshop
GRIFFITH UNIVERSITY Nathan Qld.4111
Australia
P.O.Box 185  Ph:(07)3875 7289
Fax:(07)38757151
________________________________________

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