Hi
I'm working on a remote control project using an Arduino. I will be using the Atmega328p (au - smd version) and I'm not quite sure how I'm going to upload the sketch to the IC...
How many different ways are there to program an Arduino (SPI, I2C, Serial, ...)?
And because the IC is new, the bootloader probably won't be installed aswell. So which pins should I make accessible for programming?
Are you doing Arduino without an Arduino board? In other words, you are going to hook up the MCU yourself so it emulate an Arduino board with your IC?
That is certainly not a problem. I have a couple of ATMEGA328p-pu running that way. I do need to match the Digital/Analog pins aligned with the way Arduino has them. In my case, my naked 328p thinks it is an UNO.
But the NANO is so cheap it saves a lot of work... Comes bootloader loaded and ready to go.
If you have an Arduino UNO handy, there is an example sketch that allows this to program blank Atmega's. But the USBasp is a worthwhile investment for 'unbricking' AVR's.
I believe the Arduino bootloader hex is in the Arduino directory, so this would need to be flashed, and the fuse bits set. I shunned Arduino for many years, but now pretty much all of my Atmega's have an Arduino bootloader on them now for the sheer convenience.
It doesn't have to be an UNO. The Ardunio NANO will also work. The pin layout is different (such as where is a certain Pin) but as long as you plug it into the right arduino-pin number, ArduinoISP will work nicely. The NANO has all the pins UNO has except D0/D1 instead it has RX/TX and additional A6/A7 that UNO doesn't have.
The Ardunio Nano is so cheap (under $3USD) I dedicate one only to be my ISP Programmer so it is always handy.
As to fuse setting, Arduino has a list. You can find the right fuse setting under:
[arduino directory]\hardware\arduino\boards.txtSince > 1.6.1, boards.txt might have moved.
Look for text "high_fuses" and "low_fuse" and you will find the fuse setting section.
So, fuse setting may depends on if you want your 328p to run like it is in a nano (or whatever), you can find that in boards.txt. The MCU match is what is necessary. Other things (defaultBaud/clock/etc) may different between boards for the same MCU.