1
\$\begingroup\$

I'm working on a project with PIC18F45Q43's 44 pin TQFP package. The PCB I designed had a power supply based on the 7805, but when I power the circuit; the PIC18F45Q43 burns out. I even tried powering with 3.3 V but it still burns out.

Surprisingly, when I power the 40 pin DIP package with the 7805; the circuit works completely fine.

What can be the cause of this? And what is the ideal power supply for the pic microcontrollers, especially the SMD packages?

Also, what is the best way to create 5 V and 3.3 V outputs for components in the same circuit using single input power source?

following is the schematic

enter image description here

enter image description here

\$\endgroup\$
10
  • 3
    \$\begingroup\$ Sounds like you have something hooked up incorrectly. Please post a schematic. \$\endgroup\$
    – vir
    Commented Aug 23, 2022 at 22:16
  • \$\begingroup\$ Thank you for the fast response. Just added the schematic. \$\endgroup\$ Commented Aug 23, 2022 at 22:20
  • \$\begingroup\$ Show us your PCB layout too - in particular the section around the PIC, \$\endgroup\$
    – brhans
    Commented Aug 24, 2022 at 1:09
  • \$\begingroup\$ Just added the PCB. \$\endgroup\$ Commented Aug 24, 2022 at 1:53
  • 2
    \$\begingroup\$ Have you checked if those voltage regulators are stable (not oscillating wildly)? That's a horrendous layout. The decoupling caps on those regulators might just aswell not even be there the way current has to snake around to get there ... \$\endgroup\$ Commented Aug 24, 2022 at 8:23

3 Answers 3

2
\$\begingroup\$

You issues are almost certainly PCB layout related, and the lack of supply decoupling capacitors at the PIC doesn't help either.
It also looks a lot like you've just let the auto-router do its thing all by itself with little to no supervision or rules - it's easy to spot when looking at your board by all the weird junctions and mismatched trace widths.

Some recommendations:

  1. Put 100nF decoupling caps at each pair of PIC supply pins. Physically locate these caps immediately adjacent to the PIC, and connect the cap directly to the PIC's pins (no wild loops or vias).
  2. Use bigger caps at the regulators, and place each of them physically close to the regulator they serve. Although the ones you have do technically meet the minimum spec for at least some regulator manufacturers, I don't know exactly who's "LM7805" or "LD1117" you're using, and their requirements may be different. Increase those caps by a factor of 10, and also ensure that the trace routing between the caps and their regulator pins is short & fat.
  3. Pay much closer attention to how you route the GND net all over your board. Some issues which jump out at me are:
    • the tiny trace on the bottom side between R7 and "AWY" is the only GND link between the regulators and the rest of the board!
    • another tiny trace on the bottom looping around C1 up to C2
    • tiny trace off the top of "HOM" leading to a weird branch on the top side below "DISARM"
    • and lots more examples like these all over the board
  4. I'd strongly recommend that you tear up all of your routing and manually route the GND net 1st, using traces with a width no less than 50mil. After that, route the Vcc and 3.3v nets with a similar width, as well as the supply to your "WIFI" coming from the "USE_3.3V" and "USE_5V" jumpers. Try as much as possible to keep all the GND and power traces together and on the same side of the board, only jumping to the other side for short hops where necessary and to avoid long loops.
  5. Once the power nets are manually routed, feel free to release the auto-router on the signals. None of these on your board are critical high-speed signals, so the messy result you get from an auto-router with no rules doesn't matter much, but once it's done - go back and do some manual cleanup! Move vias out of pads (for example at "DBL", C2, PIC pin-2, etc).
    Get rid of weird unnecessary loops and junctions. Some examples in your existing layout:
    • "LORA" pins 1-2 & 7
    • fork in the GND net on the top side between "DISARM" and "HOME"
  6. Take a closer look at the pad & hole sizes you have for the various components - are the holes for the buttons large enough, and do the holes for the "PASS" LEDs need to be as large as they are? I would strongly consider enlarging the pads for your off-board connectors ("PROG", "WIFI", "SOUND") as well as the "LORA" module.
\$\endgroup\$
1
\$\begingroup\$

It's not easy to tell from the layout image, but it looks like the supply tracks are not properly connected to pins 28 and 29 of the TQFP package.

PIC18F45Q43 TQFP-44 pinout

PCB Layout TQFP-44

Also, the capacitors on your voltage regulators are too small, and bypass capacitors may not be close enough to the PIC pins. In fact, they do not appear to be any bypass capacitors at all.

\$\endgroup\$
1
  • \$\begingroup\$ I see. I certainly did not have decoupling capacitors in my design. Also, the power supply bypass capacitors; what should be the values for those? And ofcourse, power suppy bypass capacitors should be placed close to the voltage regulator? Right? I'm thinking of using the AMS1117 5V regulator and adding decoupling capacitors in my new design. \$\endgroup\$ Commented Aug 24, 2022 at 11:19
1
\$\begingroup\$

As others have said, your layout is pretty bad. If you want easy layout the simplest way is to spring for a 4-layer board.

The proximate cause of the destruction of the MCUs can be found in the LD1117 datasheet:

Only a very common 10 µF minimum capacitor is needed for stability.

If the regulator is oscillating it can produce an output that oscillates almost up to the input voltage, which is very much not healthy for the chip.

The LD1117 is a very old regulator and the datasheet does not consider the possibility of a ceramic capacitor. If you don't want to use a tantalum or aluminum electrolytic, then use an (at least) 22uF ceramic capacitor (preferably rated for 10V) and add a couple ohms in series (due to voltage coefficient and too-low ESR).

The LM7805 is not going to oscillate in your circuit, however you still should have adequate bypass capacitors near the loads.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.