Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

External pull-ups on 18F2520: Max permissible value?

Status
Not open for further replies.

astronomerroyal

New Member
Hello,

I am making an 18F2520-based device designed for long uninterrupted usage, powered by 4 AA batteries (~2000mAhr). Currently (no pun intended) my time-averaged current consumption is 10mA -> about 200hr runtime. I'm already using SLEEP mode but I'd like to do better.

I'm using no fewer than 16 external pull-up resistors, each 10K, with my 2x8 DIP switches. The current through these resistors (when connected to GND), 5v/10^4 * 16 =8mA, accounts for most (80%) of my power consumption. Can I *safely* increase the resistance above 10K? Looking at the datasheet reveals that the inputs (PORT A and B mostly) are almost all TTL. Wikipedia 'pull-up resistor' states,

In bipolar logic families operating at 5 VDC, a typical pull-up resistor value will be 1000–5000 Ω, based on the requirement to provide the required logic level current over the full operating range of temperature and supply voltage. For CMOS and MOS logic, much higher values of resistor can be used, several thousand to a million ohms, since the required leakage current at a logic input is small.


...suggesting 10K is already a fairly large value. Is that a correct interpretation?

Q) Is there any reason to believe that using the internal pull-ups on PORT B would reduce current consumption?

Q) Should I be considering flipping things around and using something weird like pull-downs, depending on whether a pin is likely to spend more time HIGH or LOW? I'm assuming that a input pin held high by a pull-up draws a significantly different current than flows through the resistor when things are taken low.

Thanks.
 
Last edited:
The internal pullups on a pic are typically 20k. I have used 200k pullups but in a very stable circuit (not noisy). One solution is to tie your pullups to a spare pin and only set it to output (and high) when you require the pullups.

If you can use the internal pullups then they can also be turned off when not required.

If you require a pullup to fire an interrupt during sleep then use a high value external one and when awake check it wasn't noise.

Mike.
 
Last edited:
The Internal pulls should, their equivilant resistance is well above 10k
 
Thanks, some interesting info.

The device - a camera intervalometer - wakes up from sleep briefly on a 1Hz TMR1-overflow interrupt, so I could profit (i.e. save 50%) from switching internal PORTB pull-ups off during sleep.

I'll try ~>50K resistors first. That'll immediately get their power consumption down to the same level as the residual 10mA-8mA=2mA draw I'm finding. -> 6 week run-time is good.

Still, a long way from 'nanoWatt Technology.'
 
Bear in mind the inputs are CMOS, high value pullups isn't a problem (apart from stray pickup on the pins) - but using the internal ones and turning them OFF before sleep would be a simple solution, as would feeding external pullups from an I/O pin and turning that OFF before sleep.
 
Best way to noninvasively measure <1mA current?

...as would feeding external pullups from an I/O pin and turning that OFF before sleep.

what a brilliantly simple idea. I had one spare pin, so I've implemented it and indeed achieve the expected time-averaged residual current of only 2mA. (p.s I think my inputs are mostly TTL)

The final 2mA apparently flows through a CdS cell/resistor divider that intermittently measures the light intensity. Sourcing that with the same 'pullup pin', my current drops below my multimeter's scale <1mA (Fluke 115). Amazing.

I'd like to see how low it gets. Is there a standard/simple/recommended way to measure these tiny currents? My first guess would be a shunt resistor. I do have an oscilloscope.
 
Last edited:
what a brilliantly simple idea. I had one spare pin, so I've implemented it and indeed achieve the expected time-averaged residual current of only 2mA. (p.s I think my inputs are mostly TTL)

I guess you missed that suggestion when I made it in the first reply to this thread. :(

Mike.
 
I guess you missed that suggestion when I made it in the first reply to this thread. :(

Yes, I'm sorry. I hereby confer an equal share of the glory to Pommie. I've made this redistribution of appreciation official (I think) by clicking the fluffy white symbols on the left.

Embarrassingly, I thought you meant tie them to a header pin and physically plug that in when required (as opposed to doing it in firm/software). For some reason I repeatedly misread 'spare pin' as 'square pin' which led to all sorts of strange facial expressions.
 
Last edited:
I think Nigel hit it on the head, he just explained it better.

I always know what I mean, it just doesn't always get communicated well.:eek:

I blame my English teacher.:D:D

Mike.
 
Well, it would help if I could read.

Do you have any particular recommendations for a micro amp meter? Either DIY methods or commercial products. I'd prefer the latter as I think I'm going to quite like designing low-power devices.
 
Pommie Your still the man at coding. I.m the one that needs the learn English ant got it down pat in 40 years. No hope for me. Nigel should be good he has only posted 26,081 times I bet he can write in his sleep Thanks for the post all I never thought about using a pin and turning it off
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top