PDA

View Full Version : Any gotcha's when operating at 32KHz



caseyc
- 12th November 2008, 00:28
I am using the 16F688 as a power management system, so a high clock speed is not required.

My code consists of checking if certain lines are high or low, monitoring analog voltage levels using the ADCIN function, and a lot of low power sleeping. I have about maybe 10-15 basic statements in this loop.

Are there any gotcha's when operating at this low of frequency with PIC BASIC Pro?

Since the processor spends most of its time sleeping, would a burst at 4-8MHz be more power efficient than running at 32KHz?

mister_e
- 12th November 2008, 00:52
More speed = much power hungry
@32Khz all the time, you'll need to roll your own delay routine and few other things that are delay sensitive (LCD etc etc etc)

Ingvar
- 13th November 2008, 09:51
The only thing i can remember that could cause problems is the WDT. PBP handles it for you and normally there is no problem, but running at 32kHz may cause your PIC to reset periodically. If you have problems with a resetting PIC you can sprinkle your code with CLEARWDT..... or you can shut it off completeley. I like to be in control .... sorry Mel ;-) .... so i would disable PBPs normal use of "clrwdt" with DEFINE NO_CLRWDT 1 and add CLEARWDT commands where needed. All you need to do is place the CLEARWDTs so there will never be more than 2 seconds executiontime between them.

Many years ago i did a "thingy" running at 32768Hz and i had no issues with resetting PIC. It's been running 24/7 for 5-6 yers now. The biggest pain was to write the 1200 baud serial comms needed for debugging.

Melanie
- 13th November 2008, 11:20
> Any gotcha's when operating at 32KHz

Yes, everything runs S L O W .... your PIC can be overtaken by a tetraplegic tortoise on vallium... actually a 10F PIC ends up being one-third the price of a DS1307 in a clock application, just as accurate, and all you need is an extra Diode in your circuit (to isolate the Battery from the PICs Vdd). Squeezing comms into 256 bytes is kinda tricky though.

> I like to be in control .... sorry Mel ;-)

And there I was having fantasies about being 'on-top'... that's another one crossed-off the list!

Ingvar
- 14th November 2008, 13:20
I might reconsider if someone(who may want to be anonymous) is wearing her tight-leather catsuit with thigh-high boots and chromed spikey heels ....... 8-P