Electronic – PIC32 intermittent resets – revisited

flybackinductivepicresetsolenoid

This is a follow-up on a previous question that I have asked before, after making some changes as suggested through valuable inputs by other members, but with the problem persisting.

In a nutshell, the situation is as follows: I have a system that controls a lot of solenoids. Wires from the switching circuitry are rather long – between 2 to 10 meters. The heart of the system is a Microchip PIC32 microcontroller.

As stated in my previous question, the PIC undergoes intermittent resets when the solenoids are switched. This happens at random and not necessarily with a particular switching sequence.

The system consists of two PCBs – one contains all of the switching circuitry (from here on referred to as the "host" PCB), and the other (from here on referred to as the "core" PCB) contains only the PIC32 and a few other ICs (EEPROM and USB/UART bridge). The idea of having the PIC32 on a separate PCB is to make it easier to maintain the system in the event of a software bug/update, where only the small PCB containing the PIC32 can be replaced, and not the whole system (to make it a modular design).

Having said this, the core PCB is rather small – 66 x 38 mm. All of the unrouted area on this PCB is filled with a ground plane on both sides. Furthermore, there is only one single pin on this PCB that connects to the power and ground signals to the host PCB.

On the host PCB, all of the switching circuitry is optically isolated from the core PCB. There are also separate power connections between the two sides of the host PCB (thus, the two grounds are also separated). The system does make use of only one external power supply, with separate power connections for the two parts of the host PCB that are branched as close to the power supply as possible. The location where these power wires meet are thus as far away as possible from the circuitry to help prevent the inductive kickback from the solenoids coupling into the power supply for the core PCB.

This is an excerpt from the core PCB circuit showing the PIC pins in question:

PIC32 power pins

This is the actual PCB layout of the circuit described above:

PIC32 PCB

So far, I have taken the following steps to keep the power supply to the core PCB as clean and constant as possible and to prevent the unintentional resets:

  • Use Schottky diodes at the switching circuitry side of the host PCB for faster response against the inductive kickback caused by switching the solenoids.
  • Decoupling capacitors (C2-C7 in the above circuit) for all the power pins of the PIC on the core PCB, including at the MCLR pin.
  • Replacing the pull-up resistor at the MCLR pin (R1 in the above circuit) with a short circuit to force it high at all times.
  • Added a 1000 uF capacitor across the power supply for the FET drivers ("Local battery concept" as recommended by user analogsystemsrf in the previous question)
  • Placing a common-mode choke in the power supply circuit for the core PBC, as in the circuit below:

PIC power supply

As mentioned, the resets still occur. I can only think of the following to further attempt the prevention of the resets:

  • Add a big capacitor (in the order of 1000 uF) across the main power and ground pins on the core PCB that come from the host PCB.
  • Add additional decoupling capacitors of various values to all of the power pins.
  • Use a completely separate power supply for the core PCB (this would be a last resort if all else fails).

Although I can perhaps just use a completely separate power supply for the core PCB, I do not want to resort to that unless I really have no other option. I am convinced that this problem can be solved by other means.

Please comment and provide some guidance on my options that I have listed here. Also, if there is anything else that anybody can recommend, that will be greatly appreciated.

Best Answer

I suspect it's going to be caused by high frequency power noise. You can also use an oscilloscope to confirm this. If this is the issue, I would switch to a four layer board so that the power is routed through a plane. Additionally, you might want to add lower value capacitors targeted to the frequency of the noise.