ATMEGA328PB keeps resetting (H-BRIDGE and tiny motor)

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey guys,

 

I'm currently building a small motor driver (currently testing with a tiny motor without load, 120mA @ 6A) .

 

Since I have limited space and small requirements regarding switching time/speed, I decided to build a discrete H-bridge using a 4 layer PCB.

 

I took a lot of countermeasures to ensure system stability: Power supplies separated, GND surfaces connected via 50mA, 10R/100n close to the ATMEGA and 10R/100n accross the motor, logic on one side, power on the other side, GND in the middle layers, GND under the microcontroller.

 

Everything I check with the osci shows clean and stable signals. Spikes are below 220mV peak to peak but as soon as I switch on one part of the H-Bridge, the motor starts running and the controller resets. (keep in mind: separated power supplies, short circuit impossible because I would see it on the laboratory power supply for the power part)

 

MCUSR is empty.

 

When I doublechecked my layout, I see that the power wire (which is the only non logic wire in the middle layer) comes accross the crystal.

 

Is it possible that the power line in layer3 interferes the 16MHz clock in the crystal at layer4 and this causes a reset in the MCU? Tested with and without CFD, no difference.

 

How can I test that?

 

Thx!

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Switched to internal clock and it keeps running...

 

Oh boy, the ATMEGA328PB seems to be very sensitive with crystals. Never had problems with the P type.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Design with PB megaAVR high frequency crystal oscillators is more difficult yet do-able.

PB megaAVR follow-on have increased ΔtCLCL (order of magnitude)

Oscillators | AVR040: EMC Design Considerations

Example Layout of ATxmega32A4 and ATmega324PB Devices | AVR® Microcontroller Hardware Design Considerations (AVR042)

ATmega328PB - 8-bit AVR Microcontrollers

ATMEGA3208 - 8-bit AVR Microcontrollers

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wulfinator wrote:

Since I have limited space and small requirements regarding switching time/speed, I decided to build a discrete H-bridge using a 4 layer PCB.

 

Schematic? What steps have you taken to stop any shoot-through?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

Last Edited: Sat. Oct 17, 2020 - 02:10 PM