0
\$\begingroup\$

Ok so I have finished laying out a board. I have an ATMega328P running with a 8MHz crystal. The board has two layers and I have chosen the top layer as the ground plane (GND) and the bottom layer as the power plane (VCC). Following design guidelines, I have kept the trace length between the crystal and the AVR minimal. Take a look at the layout and suggest any improvements if you can and also be sure to point out the faults.

EDIT: Added schematic.

EDIT2: I updated the board. The new one is here.

enter image description here

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$ – Dave Tweed Jul 25 '17 at 10:46
7
\$\begingroup\$

Probably far from the only issues, but you don't have any supply bypass capacitors and your ground return path from the crystal loading caps to the MCU has a huge loop area. Put a ground pour on the back side in the area of the oscillator components and MCU ground pins and some vias directly to it.

You may want to rethink that whole side power plane, and instead make most of it ground with a limited power pour capturing the things that needs that. I'd often start by connecting the power with traces and then pouring a shape to replace them.

It also looks like you may have failed to connect all of the required supply and ground pins to the MCU. You should probably put the PCB on hold for the moment and make sure the schematic has bypass capacitors and all required power, ground, and reference connections first.

You also seem to have failed to think about how you are going to get your firmware into this. Even if you're expecting a vendor to program them in a fixture before soldering, having access for ISP will save you lots of frustration in practice. And you should have a way to connect the UART pins for debug output. You'll want a way to trigger the reset on pin 29 too, as it's needed both for ISP and to easily get into a serial bootloader.

In general, you should probably review the AVR Hardware Design Considerations Application Note (AVR042)

\$\endgroup\$
  • \$\begingroup\$ But I thought only one VCC and GND were enough and the remaining supply pins were fine if left floating. Is that not the case here? \$\endgroup\$ – hacker804 Jul 24 '17 at 15:42
  • 4
    \$\begingroup\$ It is absolutely NOT the case. You must connect them all. Failure to do so on an ATmega is known to cause problems - for example the analog supply pin doesn't just supply the ADC. \$\endgroup\$ – Chris Stratton Jul 24 '17 at 15:43
  • \$\begingroup\$ I prototyped with a DIP28 package on a breadboard and it seemed to work fine if I just supplied one VCC and GND. \$\endgroup\$ – hacker804 Jul 24 '17 at 15:45
  • 4
    \$\begingroup\$ @hacker804 That's like saying "I overran my buffer in C and it worked fine." Like, yeah, sure it works now, but it's brittle and is not guaranteed to work. \$\endgroup\$ – Jashaszun Jul 24 '17 at 15:50
  • 3
    \$\begingroup\$ @hacker804 the bonding wire for ONE power pin will not carry the current that the entire device is rated for... Hence the multiple pins. Further, you can get weird voltage distribution across the device substrate. If you are only using a fraction of the current in your app it may work.. but it is not a good practice. \$\endgroup\$ – Trevor_G Jul 24 '17 at 15:52
0
\$\begingroup\$

Also i would recommend reading the datasheet for leaving the pins floating that are not connected to anything. Normally, floating options are not considered a good design. You can either pull it down or pull up based on the recommendation in design guide. Add some debug headers for I2C (SCL,SDA, GND), just in case you need to access it and avoid soldering after the board is fabricated and in previous comments, add by-pass capacitors to filter out voltage noise.

\$\endgroup\$
-1
\$\begingroup\$

I would use Capacitors at every Chip input VCC to ensure you can handle Peaks.

Also you could use some kind of reset. Either you use a special IC like the LM809 or you build one your self like i did in the Picture. This will ensure your Chip is starting correctly. You could take a look at the dadasheet and maybe you have something already built in.

I would recommend you something like a ISP or JTAG connector to flash the chip. I bought myself a Atmel ice box to flash and debug the chip. This is a very helpful tool but it costed me 200$. The JTAG/ISP is has also a Reset pin so you might need to consider the Reset.

\$\endgroup\$
  • 2
    \$\begingroup\$ Um, you might want to rethink those caps.... Decoupling caps in SERIES with the supply seldom do what you mean! \$\endgroup\$ – Dan Mills Jul 25 '17 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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