Arduino Forum

Using Arduino => Microcontrollers => Topic started by: fadecomic on Sep 23, 2018, 11:49 pm

Title: Atmega238 standalone, simplest way to program
Post by: fadecomic on Sep 23, 2018, 11:49 pm
I would really just like to program the ATMega328 the same way I program ATTiny chips. I want to connect up the SPI connections, select Arduino as ISP, select my chip, and then upload. This works so smoothly and so flawlessly with the ATTiny chips. Yet it seems monumentally impossible with the ATMega328. Every single tutorial I see has me burn a bootloader and remove the microcontroller from the Arduino, remove the SPI connection, and connect up a raw serial connection. If I don't want to use an external crystal, I have to use a boards.txt from sources I don't know.

Can I not just use the SPI connection and program the 328 like an ATTiny85 without bothering with the bootloader? My UNO, which I am using as the ISP, has an SMD chip, so I cannot remove the microcontroller as required by most of the tutorials I've read. What is the easiest way to get a sketch onto a 328 with no external crystal?

I should point out that I am quite familiar now with this link: https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard as it is the one that I am referencing above. This is the one that requires burning a bootloader and then removing the microcontroller from the Arduino being used as an ISP.
Title: Re: Atmega238 standalone, simplest way to program
Post by: ron_sutherland on Sep 24, 2018, 12:35 am
Perhaps try MiniCore's Upload Using Programmer option

https://github.com/MCUdude/MiniCore#programmers (https://github.com/MCUdude/MiniCore#programmers)

and let me know if it works...  thanks.
Title: Re: Atmega238 standalone, simplest way to program
Post by: fadecomic on Sep 24, 2018, 12:48 am
Ah, thank you. That is precisely the kind of thing I was looking for. I will let you know how it goes!
Title: Re: Atmega238 standalone, simplest way to program
Post by: fadecomic on Sep 24, 2018, 12:58 am
Yes! You are beautiful. Thank you. That works great!
Title: Re: Atmega238 standalone, simplest way to program
Post by: srnet on Sep 24, 2018, 10:46 am
This is the one that requires burning a bootloader and then removing the microcontroller from the Arduino being used as an ISP.
All that is about is using the Arduino USB to serial bit to connect to the bare bones ATmega.

There are plenty of cheap USB-Serial adapters that will do the same job, its how you program Arduino Pro Minis for instance. 
Title: Re: Atmega238 standalone, simplest way to program
Post by: ron_sutherland on Sep 25, 2018, 12:11 am
Welp that reaction was hilarious, MCUdude has done an excellent job figuring out how to get lots of options into the IDE.

I am guessing @fadecomic is not a noob even though he has ten post (atm). I only noticed a few words, like Tiny and ISP and avoiding the use of a bootloader... everything else was skipped or ignored. I get a lot of criticism for doing that but this is an internet forum (verified) and if you want real help... well good luck with that.
Title: Re: Atmega238 standalone, simplest way to program
Post by: fadecomic on Sep 25, 2018, 05:18 am
Yeah, I got that point of the linked tutorial was to program via serial, but that was actually what I was trying to avoid. I know I could buy a serial programmer cable, but I've already got this handy UNO, and a nice set of jumper wires. I just wanted to hook up MISO, MOSI, RESET, SCK and program that way.

Not a noob, just don't post here often. Unless I've been staring at a breadboard for a while.