A note on power reduction when using the END statement on a BS2
metron9
Posts: 1,100
If you have a circuit connected to the basic stamp and you have pins set to OUTPUT your stamp can leak current.
Set all pin directions to input before using the END command.
I noticed this when I was measuring the current on an SRAM 32k x 8 chip. It takes .7uA in standby to retain data but when I used END to turn off the stamp I noticed the current start going up. The leaking was from the address input pins on the SRAM while the stamps pins connected to them were set to output.
If the above information is not correct please correct it but setting the pins to input did drop the current to .7uA at 5V
This is similar to most other processors I have worked with when putting them in sleep mode.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
Set all pin directions to input before using the END command.
I noticed this when I was measuring the current on an SRAM 32k x 8 chip. It takes .7uA in standby to retain data but when I used END to turn off the stamp I noticed the current start going up. The leaking was from the address input pins on the SRAM while the stamps pins connected to them were set to output.
If the above information is not correct please correct it but setting the pins to input did drop the current to .7uA at 5V
This is similar to most other processors I have worked with when putting them in sleep mode.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
Comments
If you read pretty much any CMOS datasheets, particularly for discrete devices, they'll say that unused inputs should be connected to either ground or Vdd rather than being allowed to float. Some input circuitry is designed to be allowed to float, but usually this will be stated explicitly in a datasheet.
I thought it was odd though to see the current start going up as these pins were connected to the input address ports on the SRAM. It looked like current from the SRAM was flowing into the stamp, so I thought it best to turn them to inputs assuming the END command turned off the input buffers, apparently it does not as you suggest.
I tested the current again both ways output low and input and now I don't get any increase in current either way, perhaps my meter was fooling me.
The thing I am working on is taking a regular SRAM chip and a mega16L to accept data from the stamp using 2 pins shiftout and shiftin commands to store external data. I am designing routines to push and pop all 26 bytes so variables can be used by selecting banks of memory as well as storing up to 32K of data. I plan to use a backup battery and one of the ADC pins to monitor the battery in the same way the more expensive SRAM chips do that have their own internal backup battery. 100 ns write times so no delay and no wearing out of memory.
I have it connected using 15 pins on the stamp for testing so I only have 4 bit address to test but it works like they say in the art of electronics "like falling off a log"
Thanks for the information on the floating inputs, now I know why they say ground unused pins on devices but I don't think one should do that on a stamp as an inadvertent HIGH signal would not be good as well as a LOW if connected to VDD. Better to just disconnect the battery when not in use I would think.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
This statement "Better to just disconnect the battery when not in use I would think." is not true if there are several power supplies involved, such as battery backup or self-powered sensors or where part of a system remains active. For example, if an SRAM needs battery backup but the processor connects to it powers down, special consideration has to be given to the chip select on the memory. Or, if a BASIC Stamp powers down but external inputs do not, careful attention has to be given to possible sources of parasitic power. Also, when the Stamp executes END, any pins configured as outputs will blip to inputs once every two seconds or so, and any devices such as power supplies or actuators have to be set up to tolerate that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com