10
\$\begingroup\$

My Arduino Uno has a ATMEGA328P-PU microcontroller, and bunch of other stuff on the board. I'd like to program the chip without the Arduino software, and only the minimum of other components. I want to eventually create things without the cost of Arduino, and I want to learn about the other parts on the board and add them back as as needed. I'm comfortable with C and gcc, so I can probably figure out the software part. But what, if anything, besides these two products below, do I need to have in the breadboard with the microcontroller?

Atmel Programmer
Microcontroller

\$\endgroup\$
  • \$\begingroup\$ You could answer this question yourself by finding and reading the ATMEGA328P-PU datasheet. \$\endgroup\$ – Phil Frost Jan 11 '13 at 13:20
  • 6
    \$\begingroup\$ Maybe when I know more. The datasheet is 550 pages, I'm a beginner, and a skim revealed nothing to me. I do a lot of self-study, but I appreciate sites like this where I can get some answers from humans now and then. :) \$\endgroup\$ – Rob N Jan 11 '13 at 14:05
  • 5
    \$\begingroup\$ @PhilFrost That's the worst advice you could give to a beginner. \$\endgroup\$ – capcom Jan 14 '13 at 17:34
  • \$\begingroup\$ @capcom First google result for "site:atmel.com atmega typical application" finds AVR Hardware Design Considerations. Not only does this application note have a minimal circuit to get the MCU to work, it goes in to great detail on how to connect a programming port, select oscillators, deal with ESD hazards, potential glitches on the reset line, connecting JTAG, PCB layout, and basically everything a beginner needs. Finding this information is the most useful skill a beginner can have. \$\endgroup\$ – Phil Frost Jan 15 '13 at 3:38
  • 1
    \$\begingroup\$ OK, I'll rehprase. Rob, you should know that any manufacturer of a non-trivial device will publish documentation to answer exactly this question. The manufacturers have a clear interest in making it easy for you to use their product. Skimming the datasheet is the way to start. For complex things like microcontrollers, there might be a separate application note. "typical application" are the magic words you need to use in your search terms. It's not that it's bad to ask for help, but it's good to know how to fish. \$\endgroup\$ – Phil Frost Jan 15 '13 at 16:28
13
\$\begingroup\$

All you need apart from the programmer and the chip is a couple of decoupling caps, and some way of connecting the programming signals to the breadboard.

So:

  • 1 largish electrolytic cap (e.g. >100uF) You can maybe do without this if your source is nice and quiet (e.g. battery)
  • 1 100nF ceramic across the power pins of the micro
  • 1 10kΩ resistor to connect from the reset pin to Vcc to hold the micro out of reset.
  • Some jumper wire to connect up nodes on your breadboard (you can buy ready made jumper wires, but I use a 22AWG roll and cut my own - much cheaper if you do this a lot)
  • A header to plug your programmer cable into. According to the user guide it looks like you need a 2x3 pin 2.54mm pitch header.

Optional

  • A button to connect your reset line to ground if you wish to physically reset the chip (I don't use AVRs, but I'm 99.9% certain the programmer can do this from the IDE)
  • A crystal to use instead of the internal oscillator
  • 2 * 22pF capacitors for the crystal (place from either side to ground)
  • Passive components, LEDs, sensors, etc in order to do something useful with the code you write ;-)

Apart from the header (which is 10-pin with some unused pins - you can use the labels as a guide for your connections, the names are the same) this schematic is about the simplest I could find with a quick Google:

Simple AVR Schematic

Funnily enough I just wrote a blog on doing pretty much the same thing with a PIC microcontroller (may be worth a look, the two are very similar)

\$\endgroup\$
  • 3
    \$\begingroup\$ If we're talking absolute minimal, you don't need the pullup resistor on the reset line - the AVR has an internal pullup. And if we're talking advisable, you should include a cap on the reset line too - see this app note: atmel.com/images/doc2521.pdf . Also, the 2x3 pin ISP header you mention is much more common than the 2x5 shown in the schematic. \$\endgroup\$ – Nick Johnson Jan 11 '13 at 11:04
  • \$\begingroup\$ Thanks! If the 100nF cap is for the power pins, what is the >100µF cap for? \$\endgroup\$ – Rob N Jan 11 '13 at 14:23
  • 1
    \$\begingroup\$ @RobN the beefy capacitor is for power supply noise filtering / smoothing \$\endgroup\$ – vicatcu Jan 11 '13 at 15:18
  • \$\begingroup\$ @NickJohnson - thanks for the finer points - feel free to edit my answer if you wish (as mentioned I haven't used an AVR, my small micro of choice is the PIC - or indeed an ARM like the STM32F10xxx more often nowadays) \$\endgroup\$ – Oli Glaser Jan 11 '13 at 18:41
  • 1
    \$\begingroup\$ If you use the Arduino framework, you also need a 100nF capacitor between the DTR signal from the serial-to-USB adapter and the reset line, otherwise you will be forced to hand-solder an adapter platine on perfboard with a 0402 capacitor because that is the only package you have 100nF available in, and nobody would ever do such a silly thing. \$\endgroup\$ – Simon Richter Jan 11 '18 at 20:18
4
\$\begingroup\$

I'm only posting this as an answer to hide the ugly URLs. You should certainly have a look at Atmel Appnote AVR042: AVR Hardware Design Considerations.

\$\endgroup\$
  • \$\begingroup\$ +1 for an excellent reference, I was looking for something just like this to complement the "general" small micro setup advice. @RobN - you should have a thorough read of this document. \$\endgroup\$ – Oli Glaser Jan 11 '13 at 18:47
0
\$\begingroup\$

I also found this helpful link from the Arduino folks: https://www.arduino.cc/en/Main/Standalone It explains how to go from a chip you just got from DigiKey (or where ever) to loading the bootloader and the bare minimum support components.

\$\endgroup\$

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.