Created Mon, 16 Sep 2013 07:39:11 +0000 by unexpectedly
Mon, 16 Sep 2013 07:39:11 +0000
I have an independent power supply feeding my test bench. It's a quasi-computer molex power thing that gives out +12 and +5. And I bought a module to convert the 12V to 9V. So it's got 5,9, and 12V.
I started with 12V to my uC32 because that's what I did when I had an Arduino Mega as the MCU. But that got way too hot; definitely past 120 degrees F on the outside of my plastic enclosure. I go and reread the uC32 manual and "may get hot" is mentioned. Check. So I try 9V. Same deal, only the plastic exterior of the housing wasn't borderline painful to the touch. OK, now I bring out the 5V for the uC32 and it's now not too hot.
Problem now is my external Sparkfun I2C real time clock. It works when USB is connected but not when my test bench is in stand-alone mode (which will be its eventual usage mode).
I don't always use the 5/9/12V internal supply if just testing code, so the RTC now won't work if I switch its source from the uC32. Is there some kind of easy cheat I can do to have it switch?
And a related aside, if I hook up a crystal, is there a way I can hook up a coin cell to keep the internal RTC alive? (think about days, weeks, or months of power-off state)
BTW, I did see these threads: http://www.chipkit.org/forum/viewtopic.php?f=17&t=2171 http://www.chipkit.org/forum/viewtopic.php?f=15&t=2540 http://www.chipkit.org/forum/viewtopic.php?f=17&t=413&start=10
Thoughts and opinions appreciated - thanks! Chris
Mon, 16 Sep 2013 09:04:59 +0000
There is no facility, on any of the PIC32 chips, for a backup battery to the RTCC. All you can do is detect when the power fails and put the chip into sleep mode, using an interrupt pin to wake it up again when the power stabilizes.
Or just use an external RTC chip :P
I can't see why your existing one wouldn't work of a 5V supply, unless it's connected wrong. How are you connecting it?
Mon, 16 Sep 2013 16:19:02 +0000
The manual says that if you need 5v out on the 5v pin, to not supply the uC32 5v. So I have a feeling that's the problem. I'll just send the 5v from my internal PS and then alter my getDate function detect when there isn't a date ready.
Edit: just measured and confirmed 3.66V out the 5V pin when board is supplied 5.06v on the power connector. Hmph! I dare say something about the Arduino is better than chipKIT. Now I lose some of my unfair feelings of superiority.
Mon, 16 Sep 2013 17:01:37 +0000
The manual says that if you need 5v out on the 5v pin, to not supply the uC32 5v. So I have a feeling that's the problem. I'll just send the 5v from my internal PS and then alter my getDate function detect when there isn't a date ready. Edit: just measured and confirmed 3.66V out the 5V pin when board is supplied 5.06v on the power connector. Hmph! I dare say something about the Arduino is better than chipKIT. Now I lose some of my unfair feelings of superiority.
No, the arduino is the same. If you want to run from 5v you need to supply that 5v to the 5v pin, not the barrel Jack.
The barrel jack, and the Vin pin both go through a voltage regulator to drop it to 5V. That is the bit that gets very hot. That regulator has a "drop out" voltage - a minimum voltage above 5V you must stay above in order for it to give out a stable 5V. Typically that drop out voltage is around 1.2V, which is why the Arduino, and the chipKIT boards are all rated at 7V+ on the input.
That regulated 5V is then joined with the 5V from the USB via a MOSFET to stop any reverse current flowing down the USB connection (which would be very bad).
To run on a 5V input you need to (almost) ignore the 5V regulator. You can either just use the USB connection for the power (butcher an old USB cable), or you feed the power direct into the 5V pin on the power header, so your 5V joins the system after the 5V regulator. You note I said (almost) ignore it. There is one safety measure you can put in place just to protect the voltage regulator, which is to place a reverse biased diode across the input / output of the voltage regulator. That way any 5V you feed in can flow backwards to the Vin part of the circuit without damaging the voltage regulator. Not that it should be a problem anyway, as powering from 5V is the same as powering from USB.