Greetings, I'm working on a project and I need to design a board. In such a board, I'd like to mount an ATMega328p (SMD version) in order to upload my .ino code. Is the procedure for the bootload burning and sketch upload any different from what it's written here?
That tutorial has a couple of problems - the quality of much of the hardware advice on the official site is depressingly poor (this is not the only one where they leave out a decoupling capacitor). These apply equally whether SMD or DIP.
You must have a 0.1uF ceramic cap for decoupling between Vcc and Ground, right next to those pins on the chip. It is best practice to put a separate 0.1uF cap for each Vcc pin, as well as for AVcc (so 2 for DIP package, 3 for SMD). Without this essential component, your chip may fail to program, or may accept a program, but reset or hang under unpredictable circumstances; due to manufacturing differences, some individual chips are more or less sensitive to this than others.
The diagram also depicts the crystal and loading cap being several inches away from the pins they connect to; the length of these connections should also be minimized.
Additionally, if you want to program it via serial with a USB-serial adapter, you probably want the DTR autoreset circuit, so you need an additional 0.1uF cap between the DTR line of the serial adapter and the reset line of the chip.
Thanks for the reply. On the board I'm about to design all the decoupling capacitors will be placed accordingly, the crystal (and its two 22pF caps) is just 4mm away from the OSC1 and OSC2 pins. I'd like to avoid placing a USB header on my board because I just want to be able upload the bootloader and the sketch one time only. The ideal would be to be able to use an Arduino UNO board to help with the bootloader and program upload. Hence I need to know which pins need to be accessible.
Do you want to upload just once or occasionally? You need not the bootloader. Just do it via ISP.
Put the 2x3 pin ICSP header in - miso/mosi/sck/reset/vcc/gnd. That way you can plug an ISP programmer like usbasp or usbtinyisp In to easily program via ICSP. These are cheap, and much less of a pain to use than arduino as ISP, since just one connector, not a rats nest of jumpers
If planning to use bootloader and external serial adapter for programming, also do the 1x6 pin ftdi-style header.
Can copy ICSP from uno, ftdi from pro mini.
ISP/ICSP seems to be the way to go, but what's this all about? What do I need in order to do that? Is This guide any useful or I need more? Also I don't understand if I need to burn the bootloader or not. How is my MCU supposed to understand the Arduino code if there's no bootloader? Thanks
The bootloader is a program needed for uploading via serial line. The bootloader is uploaded via ISP and of course, you can upload your program by the same way via ISP and it will work normally.