Searching \ for '12c508 Calibration and Watchdog problem' 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/index.htm?key=12c508+calibration
Search entire site for: '12c508 Calibration and Watchdog problem'.

Truncated match.
PICList Thread
'12c508 Calibration and Watchdog problem'
1998\11\26@043058 by sss

flavicon
face
Hello All,

I have an application which makes the PIC sleep for about 12 seconds every
other second. My problem is that even if i have correctly calibrated the PIC
12C508 (verified correct - via moving the contents of the W register to
OSCCAL at the start) there seems to be a sizeable variation in the actual
sleep times for PICs with different calibration values (the wakeup/reset is
caused by a watchdog timeout and nothing else). For example if a PIC with a
calibration value of 40h sleeps 11.7sec, a PIC with a clibration value of
70h burned with the same program sleeps for only 10.7sec.

The sleep period is critical to my application and i have been searching for
info since last week.
Hope you can help me.

TIA,
troy

1998\11\26@051049 by Wolfgang Strobl

flavicon
face
On 26 Nov 98, 10:32  sss (Troy who?) wrote:

> I have an application which makes the PIC sleep for about 12 seconds every
> other second. My problem is that even if i have correctly calibrated the PIC
> 12C508 (verified correct - via moving the contents of the W register to
> OSCCAL at the start) there seems to be a sizeable variation in the actual
> sleep times for PICs with different calibration values (the wakeup/reset is
> caused by a watchdog timeout and nothing else). For example if a PIC with a
> calibration value of 40h sleeps 11.7sec, a PIC with a clibration value of
> 70h burned with the same program sleeps for only 10.7sec.

As far as I know, there is no relation between the RC oscilator and
it's acurracy, and the watch dog timer. These are two different
circuits, according to MicroChips documentation.

>
> The sleep period is critical to my application and i have been searching for
> info since last week.

The WDT is know to be widely varying over time, temperature
dependant etc. This is documented.

For compensation, in order to get a somehow decent precision
during sleep, the basic stamp and its clones, for example, utilize a
permanent recalibratation, by measuring a full WDT timeout period
(~2,8 s) against the clock, every ten minutes or so. It's a bit
complicated, and costs a few percent more power down current,
but I believe there is no other way to get what you want.

--
     o      (     spam_OUTWolfgang.StroblTakeThisOuTspamgmd.de (+49 2241) 14-2394
    /\        *   GMD mbH                       #include
  _`\ `_<===      Schloss Birlinghoven,         <std.disclaimer>
__(_)/_(_)___.-._  53754 Sankt Augustin, Germany ________________

1998\11\26@053615 by sss

flavicon
face
Wolfgang,


+AD4-As far as I know, there is no relation between the RC oscilator and
+AD4-it's acurracy, and the watch dog timer. These are two different
+AD4-circuits, according to MicroChips documentation.
+AD4-dependant etc. This is documented.

I think this info (about the RC oscillator not having the same circuit as
the WDT) slipped by me.

+AD4-For compensation, in order to get a somehow decent precision
+AD4-during sleep, the basic stamp and its clones, for example, utilize a
+AD4-permanent recalibratation, by measuring a full WDT timeout period
+AD4-(+AH4-2,8 s) against the clock, every ten minutes or so. It's a bit
+AD4-complicated, and costs a few percent more power down current,
+AD4-but I believe there is no other way to get what you want.

Can you give some sites which have examples on how to do this? as you
probably have guessed by now, i'm quite a +ACI-new+ACI- newbie on PICs.


TIA,

troy de leon
troydl+AEA-cliffhanger.com
sss+AEA-io.worldonline.nl

1998\11\26@060523 by Wolfgang Strobl

flavicon
face
On 26 Nov 98, 11:45  sss wrote:

[ PLUUUEEEEAAAAASE don't send me anything twice, one over
the list, and a second copy to the mail address below.  DONT!

"Courtesy copies are anything but", you know? ]


Am 26 Nov 98, um 11:45 hat sss geschrieben:

> Can you give some sites which have examples on how to do
this? as you
> probably have guessed by now, i'm quite a +ACI-new+ACI-
newbie on PICs.

Grin. I'm relatively new on PICs, too (but I'm a software oldtimer) :).

Wrt. examples. I've got this info from reading the PicBasic compiler
documentation, and from studying the generated code.  PicBasic
is a commercial product (~$99, in the US), so I can't share that
code with you, sorry about that.  Having switched from PicBasic to
CCS C (which lacks such a facility), I'll have to implement
something similar in an ongoing project, myself, too. Implementing
it it from scratch (once one has groked the very idea) is far easier
than extracting it from foreign code, anyway.  IMHO.

--
     o      (     .....Wolfgang.StroblKILLspamspam@spam@gmd.de (+49 2241) 14-2394
    /\        *   GMD mbH                       #include
  _`\ `_<===      Schloss Birlinghoven,         <std.disclaimer>
__(_)/_(_)___.-._  53754 Sankt Augustin, Germany ________________

1998\11\26@083414 by Mike Sauve
flavicon
face
At 10:32 AM 11/26/98 +0100, sss wrote...
>Hello All,
>
>I have an application which makes the PIC sleep for about 12 seconds every
>other second. My problem is that even if i have correctly calibrated the PIC
>12C508 (verified correct - via moving the contents of the W register to
>OSCCAL at the start) there seems to be a sizeable variation in the actual
>sleep times for PICs with different calibration values
...
>The sleep period is critical to my application and i have been searching for
>info since last week.
>Hope you can help me.

The WDT period is controlled by its own RC oscillator, which is not trimmable.Ch
anging the OSCAL value should have no effect upon the WDT period.

The specs show a characterized, but not guaranteed, WDT period of 9 - 30 ms, wit
h a nominal value of 18 ms. Using the maximum prescaler value, this can result i
n a WDT timeout range from 1.152 to 3.84 seconds.

All of this is in the data sheet, which is available from http://www.microchip.com.

I'm sorry, but if you need an accurate, repeatable timer, the WDT will never be
able to provide it.

Mike

Mike - "de Bug" W016451 MI License TDI BUG
Remote Window Controller: http://members.tripod.com/~remotewindow/

1998\11\27@151031 by mkeitz

picon face
On Thu, 26 Nov 1998 10:32:24 +0100 sss <sssspamKILLspamsilicon-systems-services.nl>
writes:
>Hello All,
(the
>wakeup/reset is
>caused by a watchdog timeout and nothing else). For example if a PIC
>with a
>calibration value of 40h sleeps 11.7sec, a PIC with a clibration value
>of
>70h burned with the same program sleeps for only 10.7sec.

The watchdog timer is a separate oscillator from the main RC oscillator.
The WDT oscillator is not calibrated.  I think it is the same one as in
all the other PICs, in which case it is specified to possibly vary over a
range of more than 2:1.

You can calibrate the WDT to the main oscillator by timing its operation
with software.  After a reset, count the number of instructions executed
until it is reset again by WDT.  The measurement would need to be
repeated periodically as the WDT time changes with temperature and
voltage.  The time awake can be reduced by setting the WDT to a small
prescale for the test.


___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]


'12c508 Calibration and Watchdog problem'
1998\12\03@182103 by John Payson
flavicon
face
|For compensation, in order to get a somehow decent precision
|during sleep, the basic stamp and its clones, for example, utilize a
|permanent recalibratation, by measuring a full WDT timeout period
|(~2,8 s) against the clock, every ten minutes or so. It's a bit
|complicated, and costs a few percent more power down current,
|but I believe there is no other way to get what you want.

How about something interesting like this?

Start:
       ; Do whatever code you want to identify watchdog-based
       ; wakeups... if watchdog goto Bark.  When you want your
  ; ten minutes to start, load the time registers with:
  ; Time2: 01000110
  ; Time1: 01111100
  ; Time0: 00100110

Bark:
       btfsc   WasNap
        goto   DoTiming
  bsf     WasNap
       clrwdt
       sleep                   ; Assumes prescale still at 1:128

DoTiming:
  bcf     WasNap
  clrwdt
  movlw   0
  option                       ; Turn off watchdog prescalar
WaitLoop:
       decf    Time0,f
  movf   Time1,w               ; Make Time1.0 match Time0.7
       btfsc   Time0,7
   xorlw  1

  decf    Time0,f
  andlw   1
  btfss   Z
   decf   Time1,f

  decf    Time0,f
  movf   Time2,w               ; Make Time2.0 match Time1.7
       btfsc   Time1,7
   xorlw  1

  decf    Time0,f
  andlw   1
  btfss   Z
   decf   Time2,f

  decf    Time0,f
  btfss   Time2,7
   goto   WaitLoop

  ; When we get here, our time is up!

Note that the multi-byte decrement is handled in a rather unusual way.
In particular, bit 7 of each stage is checked against bit 0 of the next
stage; if different, the next stage is decremented.  The decrement was
done in this way because [A] it allows 4us resolution, and [B] more sig-
nificantly, the count value will survive asynchronous watchdog events.
Had a more traditional counter been used, a watchdog that occured between
an underflow on one stage and the decrement of the next would have caused
the loss of 256 or 65536 counts.  Unacceptable.

Otherwise, the operation of the code is remarkably simple.  It spends 1/129
of the time executing code and the other 128/129 of the time napping.  When
it's awake, it just runs a timer loop which, if left uninterrupted, would
time out in 1/129 of the desired time.  In practice, the 1/129 fraction isn't
quite perfect due to various factors, but tweaking the initial values of the
time variables should allow your 10 minutes to be generated reasonably accur-
ately.  One caveat, though: you need to put 7 bits of the timer value into each
of Time0..Time2, and set the MSB of each stage iff the LSB of the next higher
stage is set.  Cute, eh?



Attachment converted: wonderland:WINMAIL.DAT (????/----) (0002055C)

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