rebeltaz 36 Posted November 16, 2014 Share Posted November 16, 2014 Hi... I managed to get my latest clock running with a 7447 as per my previous post without a ULN2003, but now I have another question. I'd like for this clock to have a battery backup. I figured it'd be a simple task of adding a cr2032 along with a couple of steering diodes and a resistor to make sure that the battery voltage was a little lower than the supply voltage. That's not working, though. I am attaching a copy of the power supply circuit I am using. The 12v supply goes to the digit LEDs. The 5v supply goes to the SN7447. The only thing that the 3.3v supply goes to is the MSP430's VCC pin1 and the reset pin16 through a 47k resistor. With the 12vdc adapter plugged in, there is about 2.6-2.7vdc on the 3.3v line. With the adapter unplugged, there is about 2.0-2.1vdc on the 3.3v line from the cr2032 battery. My code is written so that the main loop continuously scans the display with the watchdog timer taking care of updating the time, which is stored in the variables hh, mm and ss. I would think that as soon as the mains supply is removed, the battery should power the processor and that the MSP should be able to continue updating the time, and scanning the display, even though the display will not light since the LED and 7447 power supplies are removed. That is not what is happening, though. I can set the time, unplug the adapter and as soon as I plug it back in the display is flashing 12:00 again just like it is being powered on for the first time. Any ideas as to why this is not working? I'm open to any suggestions/criticism/feedback. Thanks. Rickta59 1 Quote Link to post Share on other sites
bluehash 1,581 Posted November 17, 2014 Share Posted November 17, 2014 @@rebeltaz Did you try unit testing it... as in.. disconnect the 78L33 and put in 3.3V at the C2-D1 junction and monitor the voltage. Quote Link to post Share on other sites
rebeltaz 36 Posted November 17, 2014 Author Share Posted November 17, 2014 You mean disconnect the regulator and power the circuit up as normal, except with the battery powering the MSP in place of the 78L33? No.. I didn't try that. I just measured the voltage on pin1 (VCC) with and without the power supply plugged in. I can try that, though... Quote Link to post Share on other sites
cde 334 Posted November 18, 2014 Share Posted November 18, 2014 Possibly Brown out on unplugging or hot plugging. And why the resistor on the battery? With the diode drops and the cr2032's internal esr its unneeded, the battery should always be less than the regulated 3.3V rail anyway. And what speed are you running the msp430 at? At 2.7V to 2V it should be less than 12mHz. Quote Link to post Share on other sites
rebeltaz 36 Posted November 18, 2014 Author Share Posted November 18, 2014 Possibly Brown out on unplugging or hot plugging. And why the resistor on the battery? With the diode drops and the cr2032's internal esr its unneeded, the battery should always be less than the regulated 3.3V rail anyway. And what speed are you running the msp430 at? At 2.7V to 2V it should be less than 12mHz. I'm only running this at 1MHz. I thought that the battery would be low enough, too, but without the resistor, it's only like 0.05-0.1v below the supply voltage and I didn't think that that was low enough. I even tried adding a 470uf capacitor across the supply pins on the MSP (pins 1 and 20) as well as a 470uF capacitor across the reset pin and ground to help in case the transition wasn't quick enough. Still no good. cde 1 Quote Link to post Share on other sites
rebeltaz 36 Posted November 23, 2014 Author Share Posted November 23, 2014 sigh.... this doesn't make any sense. I disconnected the 78L33 from D1, plugged the 12v AC adapter in and powered the MSP from the battery. Nothing... well, maybe a VERY dim flicker of a couple of the LEDs. What is REALLY odd are the voltages. Powering the circuit with 78L33, voltage on the 3.3v line (Vss and RST) is 2.6-2.7v. Unplug the AC adapter and measure the battery voltage on the 3.3v line I get 2.0-2.1v. Now that SHOULD be enough to power the processor, but that is not the odd part. If I jump out the 1.5k resistor (R23- I know it says 10 ohm in the schematic I posted, but that was no where near enough to drop the voltage) in series with the battery, on the 3.3v line I get the same 2.6-2.7v that I get from the 78L33 ... but the processor still doesn't run!? I am going to post the complete schematic in case I am overlooking something. I swear I can never have "normal" problems! lol... Quote Link to post Share on other sites
cde 334 Posted November 23, 2014 Share Posted November 23, 2014 What's your circuit's current draw? Quote Link to post Share on other sites
rebeltaz 36 Posted November 23, 2014 Author Share Posted November 23, 2014 Total or on the 3.3v line? The total current draw is right at about 200mA. The 3.3v line goes from about 2 to about 7mA. Quote Link to post Share on other sites
cde 334 Posted November 23, 2014 Share Posted November 23, 2014 Hmm... what's the current draw on the 5v regulated line when only powered by the battery? Quote Link to post Share on other sites
rebeltaz 36 Posted November 23, 2014 Author Share Posted November 23, 2014 The 5v line is between 47 and 49mA under AC power and 0 under battery power. Quote Link to post Share on other sites
Foghorn 8 Posted November 23, 2014 Share Posted November 23, 2014 Hmmmm...you could try using a small 10nF or 100nF decoupling cap across the Vcc pin of the MSP430 and directly connect the battery + terminal to the Vcc pin as well just to make sure without the 78L33 in the circuit but still with the AC adaptor powering the LEDs and 74LS chip. I know the MSP430 can handle up to 3.6V maximum. (Hopefully the battery does not exceed that). Under that condition, it "should" definitely be operational. Then, try backstepping to adding the diode in series with the battery. Then, check again to make sure the MSP430 is operational. If it is, feel free to add back in the series resistor to the battery and diode. Then, check for operation again. Finally if that checks out, reconnect the 78L33 and check again. I find backstepping helps my thought processes. By the way, if the battery is powering the MSP430 off of a couple milliamps, it could be advantageous to use a Germanium diode instead of a silicon diode since they have a smaller forward voltage drop (about 0.3V) and would result in less power being dissipated in the diode and thus a longer lasting battery. Quote Link to post Share on other sites
rebeltaz 36 Posted November 24, 2014 Author Share Posted November 24, 2014 Well, I did connect the battery directly to the junction of D1 and D2, bypassing R23 and D2 and it still won't run the processor, so... Backtracking one step at a time is usually how I track down idiosyncrasies, but in this case, it just is not making logical sense and there is no where to back track from since I can't get the processor to run off the battery at all. Quote Link to post Share on other sites
RobG 1,892 Posted November 24, 2014 Share Posted November 24, 2014 Few suggestions. Use one of the spare pins on MSP430 to detect power down. When there's no power, do not scan (set P1.0-P1.4 to low.) This will save you a lot of mA when powered from the battery. Increase base resistor values (R2, R15-R18,) 2k2 or 4k7 for example. I would also add 1uF and 0.1uF cap to MSP's Vcc and 1nF to RST (power spikes could be resetting your MCU.) Quote Link to post Share on other sites
rebeltaz 36 Posted November 24, 2014 Author Share Posted November 24, 2014 Few suggestions. Use one of the spare pins on MSP430 to detect power down. When there's no power, do not scan (set P1.0-P1.4 to low.) This will save you a lot of mA when powered from the battery. Increase base resistor values (R2, R15-R18,) 2k2 or 4k7 for example. I would also add 1uF and 0.1uF cap to MSP's Vcc and 1nF to RST (power spikes could be resetting your MCU.) I actually had thought about detecting power down and disabling the scan, but I wasn't sure how much current that would save. I may try that. For some reason, tonight I was able to get the msp to run using two AA batteries in place of the cr2032 and jumping the resistor out completely. Then for some unknown reason, the msp actually ran on the cr2032 when I went back to that, but I think all of this testing has drained it because it kept dipping below 1.8v so I need to replace that, but... I have another question. How far below the main power supply does the battery voltage have to be to ensure that the clock runs off the 78l33 and not the battery? I am going to have to decrease that resistor and see if I can't find a couple of germanium diodes in my junk box, as @@Foghorn suggested. Quote Link to post Share on other sites
RobG 1,892 Posted November 24, 2014 Share Posted November 24, 2014 I actually had thought about detecting power down and disabling the scan, but I wasn't sure how much current that would save. I may try that. I am going to have to decrease that resistor and see if I can't find a couple of germanium diodes in my junk box, as @@Foghorn suggested. Instead of germanium, you can try Schottky. Your base resistors are 470. Powered from the battery, base current will be ~4mA (R15-R18) + 4mA 50% duty (R2) This could be exceeding max cont discharge current of your battery. Standard discharge current of lithium CR2032 is about 0.4 mA and max cont dis curr about 3.0 mA Switching those transistors could cause spikes that reset your MCU. It will also drain your battery in about 24hrs. http://cr2032.co/ roadrunner84 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.