Author Message
 dinofizz
 Posted: Jul 20, 2007 - 07:24 PM
 Joined: Mar 10, 2006 Posts: 74 Location: Johannesburg, South Africa
 I am designing a low power project which makes use of 8 accelerometers (max 0.18 mA each), external EEPROM (still spec'ing) and a RTC (0.15 mA max) - all low voltage spec. I have read that for low power designs it is advisable to supply peripherals from IO pins of the microcontroller, the data sheet of which says the pins are able to sink/source 25 mA each - which is more than enough for the peripherals. Is this a common practice? Is there any advice that someone may give in this regard? The addition of protection components perhaps? If I need to step down the voltage from the IO pin is it enough to use a resistive divider or zener perhaps? Also (in general) what happens to the overall supply current draw of the microcontroller if this is implemented? I have yet to receive samples and so I cannot test right now - this is just a preliminary design. Thanks in advance. Dino

 peret
 Posted: Jul 20, 2007 - 07:39 PM
 Joined: May 26, 2004 Posts: 2538 Location: Las Vegas, Nevada
 As always, go look at the small print near the back of the data sheets - the actual DC specifications. The "feature list" on page 1 tends to be a bit optimistic. You'll find graphs headed "IO Pin Source Current vs. Output Voltage" for various supply voltages. These will tell you whether you can maintain a workable Vcc at whatever current the peripheral sucks.

 dinofizz
 Posted: Jul 20, 2007 - 08:05 PM
 Joined: Mar 10, 2006 Posts: 74 Location: Johannesburg, South Africa
 Thanks for the tip! To clarify, I have a graph of output high current vs output high voltage, with a mean curve and +\- statistical deviations. Am I reading it correctly whereby if I draw x (mA), the corresponding peripheral supply voltage from the pin will be y (V). Actually as I typed that out it made alot more sense! Dino _________________"You live and learn. At any rate, you live." Douglas Adams

 ka7ehk
 Posted: Jul 20, 2007 - 11:51 PM
 Joined: Nov 22, 2002 Posts: 12036 Location: Tangent, OR, USA
 It is NOT common in professional applications. It makes the peripheral have a lower logic voltage. Those peripherals may be compromised by having data inputs at a higher voltage level from the micro. Use a nice P-channel switch driven by the micro. Their RDS(on) is a lot lower than the P-channel in an I/O driver of the micro. They cost only a few cents each (U.S.) and are available in small but easy to work with SOT-23 packages. Jim

 sgomes
 Posted: Jul 20, 2007 - 11:54 PM
 Joined: Feb 19, 2003 Posts: 926
 Almost, if I'm understanding this thread at all. You are trying to power a device from the port pin of the Atmel. If the device draws less than what the pin can source at it's high voltage then the voltage will remain at the VCC of the Atmel. Said differently, if your Atmel's VCC is 3.3V and you turn on the output of a pin you'll get 3.3V (nom.) If you now load that pin down with your device, you will continue to get 3.3V(nom.) until you draw more than the pin can source (according to the graph you have). There after the voltage will drop or you'll kill the pin. Notice I refered to 3.3V as the nominal voltage. Of course it will be lower than that even under the best of cases. You should also note that there is a spec on the current draw from the Atmel's VCC pin. You can load individual pins to their spec but the effect is cummulative on the Atmel's VCC pin. In other words, you can't drive twenty 20mA loads even though each pin might be able to do it. _________________Go electric! Happy electric car owner / builder

 polus
 Posted: Jul 21, 2007 - 12:47 AM
 Joined: Jun 28, 2005 Posts: 52
 As above use a P MOSFET to turn peripherals on and off. Even if a single device hung from the MCU is OK, dont forget the collective current which will soon be maxed out. I presume you want to set different parts of the board to sleep.

 John_A_Brown
 Posted: Jul 21, 2007 - 12:52 AM
 Joined: Sep 20, 2003 Posts: 4061 Location: Surrey, England
 For what it's worth, I power a graphical LCD from an i/o pin, and it works fine. But obviously you need to check the current requirements.

 peret
 Posted: Jul 21, 2007 - 01:46 AM
 Joined: May 26, 2004 Posts: 2538 Location: Las Vegas, Nevada
 Sometimes, engineering is the art of knowing what you can get away with. Or as someone else has said, an engineer is someone who can do for 50 cents what any fool can do for a dollar.* If the current is light enough and you can get away with switching it straight off a port pin, and thereby save the cost (and space) of an external transistor, I say go for it. If it doesn't work you can always go back to the drawing board. (* Or as yet someone else said, you know you're an engineer when you spend the weekend fixing a \$10 radio)

 jgmdesign
 Posted: Jul 21, 2007 - 04:28 AM
 Joined: Apr 20, 2007 Posts: 6063 Location: Long Island New York
 Just one more thing I would like to toss into this. If the i/o pin that is powering the peripheral goes low. You will need to take into consideration power-up times of the peripheral when the pin returns high. Add into that make sure the peripheral does not load down other pins it may be attached to should the supply pin go low. Jim _________________Jim I have decided that I am no longer going to plan anything in advance. In a court of law this is called Pre-Meditated, and does not look good for the defense..... Timer function not working properly? Check CLKDIV8 Fuse first

 dinofizz
 Posted: Jul 21, 2007 - 09:13 AM
 Joined: Mar 10, 2006 Posts: 74 Location: Johannesburg, South Africa
 Thank you everyone for the excellent advice and tips. The time difference means I post a problem at night, and wake up to find all these great posts. ka7ehk wrote: Those peripherals may be compromised by having data inputs at a higher voltage level from the micro. I will typically be measuring inputs on the accelerometers that will correspond to values lower than the required supply voltage. I understand the implications of your comment, and will look into the P-channel switch. sgomes wrote: You should also note that there is a spec on the current draw from the Atmel's VCC pin. You can load individual pins to their spec but the effect is cummulative on the Atmel's VCC pin. Ideally only one peripheral will be supplied at any time, thus total peripheral current drawn at any time shouldn't be more than that drawn by my hungriest device (the accelerometers -> 0.18 mA). However in a further effort to reduce power consumption I will be running at a low clock frequency, and further reading of the data sheet shows how the max supply current is directly proportional to the clock frequency. I will have to either re-think the peripheral supply, or trade-off for a higher clock frequency in order to support the cumulative current draw. jgmdesign wrote: You will need to take into consideration power-up times of the peripheral when the pin returns high. Add into that make sure the peripheral does not load down other pins it may be attached to should the supply pin go low. It should be added for interest that consideration for such effects are taken into account by using the microcontroller to switch capacitor values in and out of the transducer circuit at optimum times (just before power-off and just before power-on). Hmmm now how will that affect the current profile.

 Plons
 Posted: Jul 21, 2007 - 12:11 PM
 Joined: Nov 01, 2005 Posts: 6323 Location: Hilversum - the Netherlands
 Peret wrote: Quote: .. you know you're an engineer when you spend the weekend fixing a \$10 radio ... and feel good about that _________________Dragon broken ? Or problems with the Parallel Port Programmer ? Scroll down on my projects-page http://www.aplomb.nl/TechStuff/TechStuff.html for tips

 bbear
 Posted: Jul 21, 2007 - 01:27 PM
 Joined: Jul 01, 2003 Posts: 55
 Hi! Please check the AVR butterfly schematic, it uses one I/O pin to power the temp-senser.

 JimW52
 Posted: Jul 22, 2007 - 04:20 PM
 Joined: Jun 01, 2004 Posts: 351 Location: Brisbane, Australia
 Quote: However in a further effort to reduce power consumption I will be running at a low clock frequency, and further reading of the data sheet shows how the max supply current is directly proportional to the clock frequency. I will have to either re-think the peripheral supply, or trade-off for a higher clock frequency in order to support the cumulative current draw. You are confusing cause and effect here. There is a reduction in supply current at lower frequencies due to lower switching losses, however this will not affect the maximum current available on an I/O pin, which is a totally separate issue. Jim _________________Your message here - reasonable rates.

 dinofizz
 Posted: Jul 23, 2007 - 08:33 AM
 Joined: Mar 10, 2006 Posts: 74 Location: Johannesburg, South Africa
 sgomes wrote: You should also note that there is a spec on the current draw from the Atmel's VCC pin. You can load individual pins to their spec but the effect is cummulative on the Atmel's VCC pin. I assumed from this information that current drawn from the IO pins will relate to current drawn from the supply (Idd). I was looking at a graph entitled "Maximum Idd vs Fosc over Vdd" and I assumed that meant that for certain supply voltages there was a maximum current that could be drawn by the micro depending on the clock frequency. _________________"You live and learn. At any rate, you live." Douglas Adams

 sgomes
 Posted: Jul 23, 2007 - 06:24 PM
 Joined: Feb 19, 2003 Posts: 926
 Chicken before the egg... The graph you are looking at is the Maximum Idd drawn by the Atmel itself. To this you must add the draw from each of your pins. Where do you think the pin currents come from? hehehe _________________Go electric! Happy electric car owner / builder

 dinofizz
 Posted: Jul 23, 2007 - 07:10 PM
 Joined: Mar 10, 2006 Posts: 74 Location: Johannesburg, South Africa
 Yes I do think I confused myself with that graph, thanks for the help. I do see under the Absolute Maximum Ratings that there is a parameter entitled "Maximum current into Vdd pin: 250 mA". I think this is the upper current limit that can be pulled through the supply, which is what I thought the previously mentioned graph was showing me. This value is much higher than anything I can expect to draw so in this regard I'm safe. Dino P.S. FYI (for those who refer to my micro as an AVR or "the Atmel") I am using a PIC and not an AVR (please dont throw rocks at me). The sponsor company (this is for a university engineering design project) is a Microchip Consultant Program Member and so obviously recommends Microchip products - hence me posting this in General Electronics and not in the AVR section. I'm finding out for myself that AVRs are WAY more newbie-friendly. _________________"You live and learn. At any rate, you live." Douglas Adams

 Plons
 Posted: Jul 23, 2007 - 07:21 PM
 Joined: Nov 01, 2005 Posts: 6323 Location: Hilversum - the Netherlands
 Was it wise to confess, Dino ?? Nard _________________Dragon broken ? Or problems with the Parallel Port Programmer ? Scroll down on my projects-page http://www.aplomb.nl/TechStuff/TechStuff.html for tips

 dinofizz
 Posted: Jul 23, 2007 - 07:28 PM
 Joined: Mar 10, 2006 Posts: 74 Location: Johannesburg, South Africa
 Well theres no (written) rules against asking questions on the AVR arch nemesis, and I felt a pang of guilt everytime someone said "Check the AVR's data sheet..." Hopefully my good deed will go unpunished! _________________"You live and learn. At any rate, you live." Douglas Adams

 barnacle
 Posted: Jul 23, 2007 - 09:29 PM
 Joined: Jan 03, 2006 Posts: 4410 Location: Hemel Hemsptead, UK
 Mwahahaha! *No* good deed goes unpunished! Neil

 Display posts from previous:  All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 Jump to: Select a forum Forum index|--[AVR (8-bit) Technical Forums]|   |-- AVR forum|   |-- XMEGA forum|   |-- AVR Wireless forum|   |-- AVR GCC forum|   |-- AVR Studio 5 and Atmel Studio 6 forum|   |-- AVR studio 4 forum|   |-- AVRfreaks Academy forum|   |-- AVR Tutorials|--[AVR Software Framework]|   |-- AVR Software Framework|--[AVR32 (32-bit) Technical Forums]|   |-- AVR32 Linux Forum|   |-- AVR32 General (standalone)|   |-- AVR32 Software Tools|   |-- AVR32 Hardware|--[General Electronics Technical Forums]|   |-- General Electronics|   |-- Atmel Security Products|--[Non-technical forums]|   |-- AVRfreaks.net Housekeeping|--[Non-topical forums]|   |-- Off-topic forum|   |-- AVRfreaks Trading Post
All times are GMT + 1 Hour