Hello.
To reduce power, I want to run 12F1840 @ 32khz, but since there is no DEFINE OSC for that frequency, all timings are messed up. Any ideas how to fix it?
Hello.
To reduce power, I want to run 12F1840 @ 32khz, but since there is no DEFINE OSC for that frequency, all timings are messed up. Any ideas how to fix it?
Why pay for overpriced toys when you can have
professional grade tools for FREE!!!
So the answer is NO ?
Correct timing for pbp is critical only for serin, serout,serin2, serout2, owin, owout, pause, and pauseus.
32KHz is too slow for serin, serout, serin2, serout2, owin and owout, probably.
So you are left only with pause.
Instead trying to force PBP to 32KHz, create your own pause.
Instruction clock is just around 8KHz, to be precise 8192Hz
So you need only 8 instruction to get 1,024mS
And work from there to get pause that you need.Code:My1msPause: ASM NOP NOP NOP NOP NOP NOP NOP NOP ENDASM
Ifn you're trying to conserve power you really need to look into SLEEP and IOC. Both can cut power consumption significantly and are much easier to implement that ASM. OK, that's IMLTHO but you never know.
Agree with using sleep and IOC. Years ago I had a similar problem. I contacted Charles at Melabs
he gave me a solution where you set osccon to 500Khz which reduces the current to a couple hundred microamps (vdd3.3v). Then trick PBP by multipling your baud rates and dividing your pause statements. DEFINE OSC 4mhz, set osccon to 500khz. The pic will be running 8 times slower. So if you wanted a PAUSE 1 you would make it PAUSEUS 125. Serial out at 2400 baud would be written at 19200. For shorter pause statements you could use nops as suggested above. This combined with sleep you can acheive very low current consumption on average and still use PBP. Also this chip has clock switching between 31khz and high frequency, which you might want to study.
Bookmarks