Smajdalf:
You should use FASTEST clock speed possible - when executing you consume static AND dynamic power.
We can agree to disagree on this. I've had my best battery performance running with a watch crystal and a 32 kHz clock. Looking at the datasheet for the MSP430 processor I used in my last very low power project, and plotting frequency vs power consumption, it is fairly linear until getting to the last 20% of the frequency range, at which point the power consumption is higher than the linear trend. So, for that particular processor, if only looking at the CPU power consumption, there is no overall penalty for going up to 80% of the max frequency range - any increase over that increases the overall CPU power consumption.
But there is more to it than just the CPU: all of the other peripherals will also be running at a higher frequency, and thus drawing more power. Also, if you are running timers to control operations over longer periods, that means you have to either increase a prescaler count (which draws more power) or you will have to wake up more frequently, which causes more instruction cycles and more power consumption.) In my last project, I had some periodic operations to perform, and I used a timer to periodically wake up the processor. At a 32 KHz clock, the longest interrupt period I could program in the counter was shorter than my desired processing interval. So I had to periodically wake up, update a counter, and perform my processing on every Nth interrupt. If the clock speed were faster, I would have had to been woken up many more times and use a higher N counter value, and each of those additional wake cycles would've been wasted power.
Granted, there may be situations where the wake cycle requires additional circuitry to be powered up, and it may be desirable to increase the processor clock so that the time the circuitry is on is minimized. But that needs to be traded off against other factors, like how much power timer interrupts will use up between those high current events. There is no one answer for every project: each project must be properly engineered taking the project-unique trade-offs into account.
For a product like the one being discussed in the prior post, the transmitter does take a significant amount of power, but the time that is spent transmitting is likely to be very small compared to other operations - it is those other operations that likely take a higher amount of power, on average.
Ofc this is true only if you can truly sleep when not working - no busy wait loops, no polling for something done, no long waiting for a crystal to stabilize every wake up.
Agreed!
Also I don't see why pullup is worse than a pulldown? There may be leakage from the Vcc as well as from GND.
Again, engineering must be done to consider specific circumstances. But consider the case of a pushbutton switch that needs to wake the processor to perform a specific operation:
- If it is wired in the typical configuration that uses the processor's internal pullup resistor with the switch shorting the input to ground when closed, then there is likely to be some leakage current from Vcc through the resistor to ground, and this will be happening 24/7/365. That current will add up over time.
- If it is wired with an external pulldown resistor to ground, with the switch providing Vcc when pressed (preferably through a current limiting resistor) then there will be no significant current flowing from Vcc to ground until the switch is closed (there could be some slight internal leakage current to ground through the pulldown, but this is likely to be minimal compared to the current flowing from Vcc through a pullup resistor.) The assumption here is that the switch is closed with a very low duty cycle like the configuration button in the middle of the product pictured in the prior post. In the case of the reed switch which is normally closed by an external magnet, this would not be a good configuration - again, a proper engineering analysis needs to be done for every subsystem of every project.
Another important factor is the supply voltage. Higher voltage means higher current(!) needed by nearly all parts.
Agreed!
Temperature is another variable - many parts will draw higher currents as the temperature increases, so proper cooling of the device can make a difference. Proper assembly techniques can also make a difference: not cleaning off flux or other contaminants can cause a leakage path that wastes power.
What I listed in my prior post was a set of guidelines I try to follow when designing very low power projects. There are always exceptions depending on the particular needs of a project.