[HARD] Atmega328 Hardware Design - The Right Way

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


 

For 99% of all cases this design is the right way to start with a '328 design...

 

 

#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: Mon. Feb 24, 2020 - 04:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And as a PDF.

Attachment(s): 

#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."

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


The ISP connectors viewed from the top of the connector looking down towards the PCB...

 

#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: Mon. Feb 24, 2020 - 01:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would add pins and pinout to ISP.

 

David

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

DAFlippers wrote:

I would add pins and pinout to ISP.

 

Good idea. Done.

#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."

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

Brian, Your ISP connector (first schematic) looks a bit odd, it seems to imply all the pins are shorted together.

Other than that, a very nice posting!

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

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

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

Also, show an optional Xtal for Uart operation

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

ki0bk wrote:

Brian, Your ISP connector (first schematic) looks a bit odd, it seems to imply all the pins are shorted together.

 

It's just a style thing, all my schematics, even the CAD ones, have that style of connector.

 

 

avrcandies wrote:

Also, show an optional Xtal for Uart operation

Done.

 

Thanks for the suggestions. I'm probably going to stop there as any further tweaks will take it away from my 99% goal.

#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."

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

(optional) filter inductor for AVCC ?

 

The reset circuitry looks more complex than I've seen in real life.  "Decrease life of switch"?  Because of those harsh 0.25uJ discharges?

 

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

Hi Brian,

 

Why do you have 4.7k ohm resistors in series with the SPI signals?  For impedance matching to to typical PCB traces, it is more common to use values around 33-39 ohms (allowing some 10-15 ohms for the on-chip driver impedance).  At 4.7k ohms, parasitic capacitances may severely limit the speed of the SPI bus.

 

Also, I'm not sure about this device - I exclusively have used XMEGAs - but the RESET# signal is used by the PDI, and putting capacitance on RESET# will strangle PDI operation.  Does the ATmega328 do something different?

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

Yes - impedance matching! Not for transmission line effects but so that the ISP signals can override other devices connected to SPI when programming the flash.

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

Kartman wrote:
Yes - impedance matching! Not for transmission line effects but so that the ISP signals can override other devices connected to SPI when programming the flash.

 

Ugh.  It appears that my decision to stick with the XMEGAs was a good one.  I can get maximum speed out of the SPIs.  Thanks for the explanation.

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

Kartman wrote:
Yes - impedance matching! Not for transmission line effects but so that the ISP signals can override other devices connected to SPI when programming the flash.

Altazi wrote:
Why do you have 4.7k ohm resistors in series with the SPI signals? 

 

I myself use 220 ohm resistors in series, but Hey Ho, whatever works.

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Greater than 220 ohms is recommended though if the attached SPI device is de-selected and not in tri-state then 4K7 may work for an Atmel-ICE.

Shared Use of SPI Programming Lines | AVR® Microcontroller Hardware Design Considerations (AVR042)

...

Typically, the resistor value R can be of 330Ω.

...

These typical values are used to limit the input current to 10 mA for a supply voltage (VCC) of 3.3V. It may vary depending on the programmer/debugger used and the requirements of specific hardware design.

...

Pull-up Resistors | AVRISP mkII

... i.e. the resistor should have a value of 820Ω or more.

...

 edit : typo

 

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

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

I was not saying my 220 ohms were used for pullup. But for isolation of downstream devices from the ISP when used.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

I have a (stupid I'm sure( question on this ISP connector pinout.

 

I have the Atmel ICE package, the ATMega328 Explained board (and a couple others).

Looking at the schematic and the pinouts, I traced everything out and it seems to match.  The problem is the connector itself that comes with the ICE.

(we called them "Berg" connectors back in the day).

The connector block itself has a small, hard to see, arrow denoting pin on.  This doesn't match anything.

The connectors pin on would (looking down on to the connector from the top) connect to pin 5, or 2, depending on which way you plugged it in.

 

Plus, I notice that the Number One wire, the red stripe, actually connects to "3" (again, looking down), which is next to the pin one (would be on the left).

 

I'd like to get this clarified before I plug this thing in.  Without a key to ensure you plug this in only one way, it's a might confusing.

 

The PCB's, all match up, pin one being in the lower left, or upper right corner, depending on board orientation.  (which matches the drawing here)

 

I can post photo's if that would help clarify things, but that little arrow on the connector may not show up as it's very hard to see.

 

 

 

 

EDIT.....  never mind, I just looked at the ICD documentation, (don't ask me why I didn't think of this before....) and Atmel ignores the pin one marker on the connector.  That pin that is marked as number one, is indeed number 5 by Atmel configuration.

 

Sorry.

Just gettin' started, again....

Last Edited: Sat. Apr 25, 2020 - 12:17 AM