PDA

View Full Version : PIC with 100 kHz crystal



BrianT
- 23rd January 2008, 01:13
I have a need for the lowest possible power draw. I think I can get away with a 100 KHz crystal and still get around the main loop in time. The defines for PBP stop at 3.58 or 4 MHz. There are no LCDs or serial datacomms to worry about.

I realise the bootloader can't work and I want to use ICSP via a modified EPIC for code load and dump.

Questions.
Can I use PBP with DEFINE OSC 4 and then fudge any timing loops by calling up a delay of 1/40th of what is needed? (4 MHz/40 = 100 KHz). For example calling up PAUSEUS 25 would in fact become a pause of 1 mSec.

Are there any other hidden little gotchas I should be aware of?

BrianT

skimask
- 23rd January 2008, 02:38
I have a need for the lowest possible power draw. I think I can get away with a 100 KHz crystal and still get around the main loop in time. The defines for PBP stop at 3.58 or 4 MHz. There are no LCDs or serial datacomms to worry about.
I realise the bootloader can't work and I want to use ICSP via a modified EPIC for code load and dump.
Questions.
Can I use PBP with DEFINE OSC 4 and then fudge any timing loops by calling up a delay of 1/40th of what is needed? (4 MHz/40 = 100 KHz). For example calling up PAUSEUS 25 would in fact become a pause of 1 mSec.
Are there any other hidden little gotchas I should be aware of?
BrianT

You can do exactly what you're talking about.
I do it on my '4620 on my OBD reader. The code I wrote has DEFINE OSC 10, which means it talks to my OBD chip at 9,600. If I turn on the 4xPLL when I program the chip, it'll talk to the OBD chip at 38,400, without changing any code.
And it works just fine, except that the pause loops get a little bit goofy and you have to program them all for worst case scenario.

nomad
- 28th January 2008, 09:09
ICSP is not dependant on defines, osc speed, or coding. The clock is generated by the programmer, and the micro is not running code while being programmed. ( In short, ICSP will not be affected and will work fine no matter what speed or defines you have)

There's many commands that are based on the actual osc speed and define osc has no effect. (pulsein and pulseout for example, the resolution is directly related to osc speed. the define osc is of no use for these)