At 03:13 PM 1/06/98 -0300, you wrote: >Perhaps someone can help me with this one - > >I am considering using 2, 3V lithium batteries (coin cells) to power a >small PIC based device - the unit will be powered all the time and will be >in slep mode most of the time - coming out when a button is pressed to wake >it up on port B <7:4>. The two cells will be placed in one of those >"double height" PC board holders. > >My question is this - with the cells powering the PIC directly (i.e. no >regulator etc.), am I going to run into trouble with the thing when the >user replaces the cells as one will be placed in the holder first , then >the second. I checked the holder and the clips do grab a single cell, >thereby presenting 3V to the micro for a period of time before the second >cell is inserted. There won't be any brown out or watchdog. Am I likely >to cause the micro to "fetch up" with this preactice? Perhaps there is a >common "rule of thumb" that I am missing here - I haven't designed a device >like this before. > >Thanks for any help peopl can provide. > >Lewis >cobb@zeus.ee.unb.ca > >PS - there are no other circuits to worry about for the most part in this >unit as all other circuitry is powered from the micro's port pins. > > 2/6/'98 Hi Lewis >From the way it reads you indicate that the cells are placed in //, this should only be done if the run time current requirement is high. On the other hand, if the batteries are in series, and are currently being replaced (Old one in while a new one in the other location is being inserted), then the old cell should have a high enough impedance to not provide enough current to run the circuit. When the older battery is removed, the power will go and the PIC will enter a reset state when the new battery is inserted. Things to look out for:- 1/ CMOS latch up, ensure that the PIC is not attempting to drive high capacitive or inductive loads during the power up phase 2/ Check the operating range of the PIC, some will operate down to 2.5V 3/ On power up (Check the status bits) DON'T trust the reset circuits to fully enable all the on board stuff. i.e. Do your own resetting! 4/ Don't trust the on board RAM, i.e. The RAMS contents may be corrupted The last two are very important, if the PIC loses power, then the internal reset (Not like some other micros) only resets the internal stuff and attempts to set the oscillator is running. The RAM may have had data written any where, so be ready for this. On the oscillator, if you are having problems choosing the correct C and R (For Xtal) then look at using an RC, these are cheep, start faster and if designed correctly use less power for the same frequency (Up to 500KHz), note that this excludes the 32KHz stuff For a last piece of advice (Standard thing that I give to all people using battery powered stuff) Always ensure that the internal stuff and the TRIS registers are constantly re enabled. Dennis -=====================================================================- Dennis Plunkett: Embedded Hardware, Software design NEC Australia DRMASS ph 03 9264-3867 -=====================================================================-