Electronics > Beginners
Programming Atmega 328pb using Arduino IDE (Arduino as ISP)
(1/1)
TechJunkie97:
Hi, I made my first PCB using Atmega 328pb micro controller. I have an ICSP header on the board for programming. I successfully burnt the bootloader using the OptiLoader ( https://github.com/WestfW/OptiLoader ) using an Arduino UNO board. However, I can't seem to program the microcontroller. I am trying to program the microcontroller using "Arduino as ISP". I took the following steps in the Arduino IDE.
1) Uploaded the Optiloader Sketch to Arduino UNO board.
2) Connected the ICSP header as described in the OptiLoader Sketch and opened Serial Monitor.
The bootloader was burnt successfully to the microcontroller.
3) Uploaded the Arduino ISP sketch using "AVRISP MkII" programmer option to the Arduino Uno Board.
4) Uploaded a test sketch (turning a pin HIGH/LOW every 500 ms) to the microcontroller using "Arduino as ISP". I chose the board as the "Arduino /Genuino Uno" in the "Tools" menu in the Arduino IDE.
The sketch got uploaded to the Arduino Uno board instead of the microcontroller. I don't know what I am doing wrong. Does anyone have any suggestions for this problem? I only have ICSP header available for programming.
Thanks!
Wigo:
You are on the right track. But there is one small detail every turorial is missing. Insetead of uploading the sketch via the arrow or the upload button, you have to choose the upload via programmer option. It is in the tab left to the tools options if i recall it correctly.
Oh and you can burn the bootloader via the arduino ide as well. As long as you have not to set other fuses.
TechJunkie97:
Thanks Wigo. You were totally correct about the upload via the programmer. It is in the "Sketch" drop-down menu. One more thing is that the Atmega328pb microcontroller is not supported natively in the Arduino IDE. I had to download 3rd party boards to make it work (https://github.com/watterott/ATmega328PB-Testing/find/master).
tooki:
You can modify the Arduino IDE preferences in a text editor to default to upload using the programmer, if that’s your primary method.
Navigation
[0] Message Index
Go to full version