Micro restarting likely power issue - Page 1
Forum section: electronics / projects

author: jrozner
author_rank: Contributor
timestamp: June 29, 2018, 05:36:57 am
content: I've been working on a design and finally have just about everything working except for that a few of the boards, but not all, are having an issue where they will randomly restart. They're being powered by a single CR123A and I'm usinghttp://www.skyworksinc.com/uploads/documents/AAT1217_202050B.pdfto boost the voltage up from the ~3V to 3.3V. The board has an ATmega64 and ESP8266 to run most of the code and essentially just a couple LEDs and 16x2 display.When I power it by the bench power supply at 3.3V everything is fine. I tried stepping it down to 3V and it was significantly more stable but still saw some occasional restarts. The datasheet for the boost converter says it should be good up to 500mA and the bench power supply shows it barely pulling 100mA. Not sure how to go about debugging this and would appreciate some help.

author: Siwastaja
author_rank: Super Contributor
timestamp: June 29, 2018, 05:47:08 am
content: 1) Since it's a switch mode converter, even though very integrated and simple, show us the PCB layout2) Add input bulk capacitance. It needs to have Cbulk >> Cceramic, and with relatively high ESR. 4.7uF ceramic alone in the input can, in worst cases, create severe peaking and oscillations while connecting power, sometimes even causing overvoltage destruction. At least a 47uF low-cost aluminium electrolytic capacitor works here, but since ESP8266 is known to use high peak currents for fairly long times, unless your power cabling is short and the 3V supply is very solid, a bigger bulk capacitor can help.

author: jrozner
author_rank: Contributor
timestamp: June 29, 2018, 06:16:34 am
content: Sure, here is the pcb layout.

author: Siwastaja
author_rank: Super Contributor
timestamp: June 29, 2018, 06:24:41 am
content: Your regulators FB pin is completely forgotten unconnected. No wonder it's not working.For layout, move C5 and C4 even closer to the regulator, add ground vias for them and add ground pours on all layers.

author: jrozner
author_rank: Contributor
timestamp: June 29, 2018, 06:26:06 am
content: Quote from: Siwastaja on June 29, 2018, 06:24:41 amThe datasheet for the typical application shows it left unconnected.

author: Siwastaja
author_rank: Super Contributor
timestamp: June 29, 2018, 06:32:55 am
content: Oh, I see.But do take a look at: Figure 2: AAT1217 Evaluation Board Layout

author: jrozner
author_rank: Contributor
timestamp: June 29, 2018, 07:41:16 am
content: According to the data sheet for fixed output voltage, which I'm trying to get to with 3.3v, the pin should be left unconnected."The AAT1217 has two fixed output voltage options: 3.3V and 5V. An internal resistor divider is connected to the FB pin inside the package which eliminates the need for external feedback resistors. When designing with the fixed output voltage option, remember to leave the FB pin open; otherwise the output voltage will be affected. However, a feed-forward capacitor can still be added between the FB and VOUT pins to enhance the control loop performance."

author: Siwastaja
author_rank: Super Contributor
timestamp: June 29, 2018, 10:01:06 am
content: Yes, I understood; it's clearly not the issue.But do look at the layout. It's super important. These fast little switcher have no chances working at all againts even small stray inductances. Current in long, thin traces just cannot change fast enough, and when it finally changes, there's an opposite overshoot. With these edge rates, "long" often means just 5mm. And you don't use traces for power; you use polygon fills.Even if this wasn't the actual and only problem here, fixing the layout is necessary anyway, so better start from there.Luckily, these small guys are so integrated and simple to use that you can often just copy the reference layout as is. With the integrated feedback resistors on-chip, the layout is even simpler and doable in single layer, leaving the bottom layer for additional solid ground plane.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 29, 2018, 02:05:53 pm
content: Don't you have an oscilloscope to look at the output of the boost converter? That would be a lot easier to debug than just guesswork.

author: jrozner
author_rank: Contributor
timestamp: July 02, 2018, 02:10:26 am
content: Probed it with the oscilloscope and the output pin of the boost is definitely noisy but is this enough to cause it to constantly be restarting? If so, is the solution to adjust the board layout to bring the capacitor for the output closer to the boost converter or change the capacitor value or is there something else I should be doing.

author: xani
author_rank: Frequent Contributor
timestamp: July 02, 2018, 02:27:27 pm
content: I'd try connecting scope to both input and output, then setting a one-shot trigger to say < 2.8V and try to trigger the problem.Looking at the persistence on your image you definitely had moments where voltage was at ~2V.You might also want to try putting a shunt and measure the current during it.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 02, 2018, 04:46:53 pm
content: Quote from: jrozner on July 02, 2018, 02:10:26 amSet the acquisition mode to single shot and set a falling edge threshold of just above the min voltage for your MCU (brown-out voltage).With the display persistence though, we can already see from your capture that the output of the boost converter seems to occasionally drop by more than 1 V, probably enough to make the MCU reset (which one? There are two?) Also look up the datasheets to get the brown-out voltage figures.

author: jrozner
author_rank: Contributor
timestamp: July 03, 2018, 05:57:18 am
content: According to the data sheet the operating range for the micro (ATMega64A) is 2.7-5.5V. I set the scope to trigger on the falling edge at 2.68V and definitely saw it trigger during the reset on the output pin. I also probed the cap on the output and saw it dipping down more slowly. Something I realized is that the routing for the output pin to the cap is pretty long. It wanders around some other components which you can see as the top middle pin going to C5 on the layout. Is simply shortening that trace sufficient to clean this up and make it more stable?

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 03, 2018, 07:03:28 pm
content: This is some horrible routing indeed. Looks like it was autorouted. Was it? Anyway, this trace loop gives me shivers.You can try fixing this by hand by directly wiring the capacitor's end to the regulator's pin (shortest flying wire you can) and see what you get.

author: jrozner
author_rank: Contributor
timestamp: July 04, 2018, 12:44:49 am
content: ya, it was auto routed which I've definitely learned my lesson from a handful of other issues discovered. However, I soldered the shortest possible wire from the pin to the VCC side of the cap and haven't noticed any difference. I'm still seeing the same looking signal on the scope as above where it occasionally dips down below 2.7V. I also probed the bypass caps next to the ATmega64A and I'm seeing the same behavior there. Do I need to add more capacitance here or is there something else that I should be looking at? The capacitor values used are all straight out of the data sheet.Edit: I added another capacitor in parallel by stacking it on top and didn’t notice much of a change.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 04, 2018, 12:06:28 pm
content: Is it also powering the ESP8266 and is the WIFI active?

author: jrozner
author_rank: Contributor
timestamp: July 04, 2018, 07:24:57 pm
content: Yes it's also powering the ESP8266 and yes it's active but I'm pretty sure that's not it and I've found the issue. After cutting the trace off the Vout and adding a wire to go directly to the cap and adding another cap and not seeing it improve I was confused so I soldered the wire to the cap and connected the battery and confusingly the micro still powered up. Presumably it shouldn't have been getting power so I went through the layout and realized that the autorouter dropped a via on the loop around to the cap and that via was what was providing VCC to the micro essentially losing out on the capacitance provided there.I've added a cut before the via to stop that and wired the cap directly to the via which I'm now testing. Of course I'm having issues replicating the behavior on unmodified boards once I've finally figured out what it likely is but gonna keep these running for a bit and see if it still occurs. I'm going ahead and manually re-routing the board to fix this and other issues like VCC pins on the micro not being connected to the bypass caps next to it.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 05, 2018, 03:52:49 pm
content: At least you've learned your lesson blindly using an autorouter, and maybe a couple tricks to debug power supplies.Out of curiosity, what was the autorouter you used? The result kinda reminds me of old versions of Proteus.Anyway, a lot of seasoned PCB layouters will tell you they avoid autorouters like the plague. Some are less strict about this but have learned the hard way how to use them properly.In my experience, they are rarely worth the trouble. I have used them on occasion though, on very dense digital designs which would have taken ages to route manually. When I do, I try to place components the best I can, then manually route all power supplies, decoupling caps and sensitive signals (differential pairs, length-adjusted traces, signals sensitive to noise...). I also properly define net classes and power planes, and keepout areas if needed. Then and only then I start playing with the autorouter.

author: jrozner
author_rank: Contributor
timestamp: July 07, 2018, 12:15:38 am
content: Ya, I sent in the re-routes boards for fab and will hopefully be able to test them in a couple weeks. It was the Eagle 7 autorouter.