12F629 low power and weak pullups
Posted: Tue Oct 25, 2011 8:47 am
Hi Ben etc....
Working on a small project using the 12F629 in low power application and have few questions,
project requires input/int and 0.5s pulse output....running on 3.2V battery.
1. What is considered the best low power mode? I am currently 32khz @ 3.2V. Datasheet
sez at 2V (close to 3.2V) using 32khz xtal draws about 8uA. Is this best for starters?
2. For the input i need to monitor an open drain from the equipment (pull up needed to 3.2V).
Questions is, if i make RB2/INT my input, and setup as interrupt, does FC automatically
enable weak pullup on that pin? Or does that need to be manually set? (i prefer not external
pullup resistor outside the chip). The datasheet says to set option and wpu(weak pullup), to
enable internal weak pullup on a specified pin. If need to be manually set what is the c icon
commands for that? Is it an asm routine needed?
3. i need a delay to generate 0.5s pulse, however when using the delay icon setting that delay
figure, i get a compiler error about the delay function. No matter what value/base i set i get
the error (delay inaccurate). I did not trust that so i created inner/outer loop to get rough
delay. Any reason why i get the error? The delay is not very short...so there should be more than
time to do a delay on 32khz?
4. so to save max power, is the interrupt event driven scheme better since the processor is idle
most of the time....the other method of polling the input for change requires more power
since the processor is constantly active?
Thanx for any input!
Mark
Working on a small project using the 12F629 in low power application and have few questions,
project requires input/int and 0.5s pulse output....running on 3.2V battery.
1. What is considered the best low power mode? I am currently 32khz @ 3.2V. Datasheet
sez at 2V (close to 3.2V) using 32khz xtal draws about 8uA. Is this best for starters?
2. For the input i need to monitor an open drain from the equipment (pull up needed to 3.2V).
Questions is, if i make RB2/INT my input, and setup as interrupt, does FC automatically
enable weak pullup on that pin? Or does that need to be manually set? (i prefer not external
pullup resistor outside the chip). The datasheet says to set option and wpu(weak pullup), to
enable internal weak pullup on a specified pin. If need to be manually set what is the c icon
commands for that? Is it an asm routine needed?
3. i need a delay to generate 0.5s pulse, however when using the delay icon setting that delay
figure, i get a compiler error about the delay function. No matter what value/base i set i get
the error (delay inaccurate). I did not trust that so i created inner/outer loop to get rough
delay. Any reason why i get the error? The delay is not very short...so there should be more than
time to do a delay on 32khz?
4. so to save max power, is the interrupt event driven scheme better since the processor is idle
most of the time....the other method of polling the input for change requires more power
since the processor is constantly active?
Thanx for any input!
Mark