Hi Jinx, I've spent some time today running more tests and finding a more accurate value of the cap that I'm using to measure the average current usage of the different circuits. It has been productive. I'm very interested in the virtual shunt that Peter posted about though. On Fri, Aug 26, 2005 at 12:54:26PM +1200, Jinx wrote: > Matthew, think of all this fun you'd have missed out on if > someone at National hadn't run a red pen through the 3909 :^) I've been learning a great deal because of National's decision. > With WDT_OFF (PIC never wakes from SLEEP) consumption > is a few nA. With WDT_ON the consumption is 3.7uA. My tests show ~5uA current draw while asleep with no WDT. Though my current measurement setup isn't ideal for such low currents; this is why the virtual shunt idea is so interesting. > I think you can save yourself the extra components for ExtRC. Surprisingly, I believe your right. More below. > Output is > a 2us pulse on GPIO,0 every 2.3s. You should be able to extra- > polate from this what your average is going to be with an LED > as a load. It would help you to look around for a low current one I used similar code/setup for two tests. The output pulse to the LED is about 1ms wide though. It would be very hard to perceive a 2us pulse of light, atleast it would be very dim. I ran four tests, and each test was ran using three different 12F629 chips so that I could compare results. There were no major differences measured between devices. Tests that used the external RC osc used these values: R=1M and C=68pF. The resulting instruction cycle frequency was around 4kHz. All tests used the same circuit built on a breadboard. The only exception is if a test didn't blink the LED, the LED was removed. The schematic is here: http://roland.sw.edu/matthew/blinker.png Test 1. Using the external osc., no WDT, no external loads. After initialization the pic does a goto $-1. Code is here: http://roland.sw.edu/matthew/blinker-free.asm The results are disappointing, a ~280uA current draw across all three devices. Compare this to the LP osc mode current draw with Fosc=32kHz. Why does this test show such a high current usage? Test 2. Similar test to number 1, except that instead of an infinite loop the device goes to sleep permanently. Code: http://roland.sw.edu/matthew/blinker-sleep.asm I can't say much here, but that the current draw is small. :( Around 5uA. I need a better measurement setup. Virtual shunt here I come! Test 3. Using the external osc and WDT a LED is flashed for 1ms after each WDT timeout. Code: http://roland.sw.edu/matthew/blinker-ext.asm Going to sleep makes the current draw bearable: 58uA. Test 4. The only difference from test 3, is that the internal osc is used. The LED flashes for the same (approximate) duration. WDT on. code: http://roland.sw.edu/matthew/blinker.asm The average current usage was 53uA. What do I conclude from this? Contrary to the datasheet, the external RC osc has an awfully high current usage. It's amazing that test 4 had similar current draw to test 3. Maybe I'm being fooled by poor equipment? While I feel I'm measuring everything with a reasonable accuracy, I still need to build the virtual shunt circuit. I appreciate everyone's feedback. I learn a lot on this list! Sincerely, Matthew. -- Q) Why do C programmers put all the code in the "for" statement? A) Because they can! - Dr. Todd Stevens -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist