Author Topic: Programming Atmega 328pb using Arduino IDE (Arduino as ISP)  (Read 2290 times)

0 Members and 1 Guest are viewing this topic.

Offline TechJunkie97Topic starter

  • Contributor
  • Posts: 24
  • Country: ca
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!
 

Offline Wigo

  • Contributor
  • Posts: 44
  • Country: at
Re: Programming Atmega 328pb using Arduino IDE (Arduino as ISP)
« Reply #1 on: June 02, 2019, 09:51:54 pm »
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.
 
The following users thanked this post: TechJunkie97

Offline TechJunkie97Topic starter

  • Contributor
  • Posts: 24
  • Country: ca
Re: Programming Atmega 328pb using Arduino IDE (Arduino as ISP)
« Reply #2 on: June 02, 2019, 10:16:15 pm »
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).
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 13157
  • Country: ch
Re: Programming Atmega 328pb using Arduino IDE (Arduino as ISP)
« Reply #3 on: June 04, 2019, 12:27:13 am »
You can modify the Arduino IDE preferences in a text editor to default to upload using the programmer, if that’s your primary method.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf