Mega serial resets with noise on digital pins?

Why would noise (spikes) on a digital pins cause a Mega to freeze up that only a power cycle will start again. The serial port also locks up (USB).

The spikes are 100's of mv's (from an ignition system) and the mega will lock up after 15 seconds or so.

Is it something to do with the serial UART?

The answer is found in basic knowledge about integrated circuits. It's elementary. The modern circuits of today uses low voltages and as low current as possible, by using high impedances inside the circuit.

kpg:
The spikes are 100's of mv's (from an ignition system) and the mega will lock up after 15 seconds or so.

How have you measured the voltage?

Make a drawing showing how everything is connected to your Mega and post a photo of the drawing.

...R
Simple Image Posting Guide

Gents,

The cct is actually a Speeduino ECU that uses a Mega as its CPU.

The ignition trigger outputs use digital outputs to switch FET high current switches for the primary of ignition coils.

What I believe I am seeing is the HT side of the coil spiking back to the LT side which then gets to the digital lines. This takes the serial port out. A power cycle restarts it all.

If I run it without the coil firing it all works fine, its just with the coil in circuit I can scope the noise spikes.

I was wondering if I could decouple (capacitors) the serial port somehow.

The circuit for the speeduino showing the ignition circuits is here.....

kpg:
The cct is actually a Speeduino ECU that uses a Mega as its CPU.

Sorry. That's well beyond my pay grade.

...R

If I run it without the coil firing it all works fine, its just with the coil in circuit I can scope the noise spikes.
I was wondering if I could decouple (capacitors) the serial port somehow

.
Actually, its the TC4424EPA that's missing a required decoupling (bypass) capacitor. This could be the main problem.

Overall, all the 100K pulldown resistors seem weak, I think it would be better to use 10K on the MCU side of the circuit. However, this probably isn't directly related to your problem.

I would configure all unused pins with the internal pullups enabled.

The A4988 stepper driver circuit seems incomplete ... no capacitors?

Might need to add opto-isolation to the Ignitor circuit inputs, however, maybe first of all overall grounding could be improved and/or placing your circuit in an EMI/RFI protective case, or adding ferrite core(s) to the power supply connections would help.

What circuitry is between "IGN-1-OUT" and ground? Post a drawing.
Same with "INJ-1-OUT.

I am only using Ignition out at the moment. The output goes through a FET switch (ignition module) to a 3 ohm primary ignition coil.

Detail attached.

If it is noise feeding back down the ignition lines, why would this lockup the UART?

Where would I put the decoupling cap on the TC4424, size of cap?

To remove the issue of PSU noise I am running the Speeduino/Mega from a separate power supply.

Thanks guys...this is the last bit in a 2 year project and very frustrating right now.....

ignmod2.PNG

ignmod2.PNG

Check 3.3 Supply Input in the datasheet. You’ll need a 0.1µF ceramic cap as close as possible to the VDD and GND pins.
You’ll probably need one of these or these
Wrap as many turns as you can of the 12V and GND (or 5V and GND) power suppply wires through the hole. This isn’t just to reduce power supply noise, it’ll reduce effects of EMI/RFI from the primary ignition coil.

Have you configured all unused pins with pullups? This will reduce the number of “antennae” pins bringing EMI/RFI energy directly into the MCU. You probably have a lot of unused pins on the Mega.

Thanks, I will definitely do that and check the pullups.

At the moment I am running speeduino supply from an external PSU so noise on its +v will be minimised but this can only help.

How do stop it coming back down the ignition LT lines? Can I use the same coils?

How do stop it coming back down the ignition LT lines? Can I use the same coils?

If the ignition LT lines are the control lines, then yes, I think a ferrite core would help, but ferrite(s) on the power lines would provide the most benefit.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.