Go Down

Topic: General Microcontroller Question (Read 297 times) previous topic - next topic


Hey there,

So, I have done a little microcontroller programming and i want to get back into it. I have a new 2017 macbook pro, and i have typically used Atmega in the past. What i was wondering if there is a way to use an arduino as a programmer to program an atmega from my mac? Then would i be bale to use the Arduino software to program it in C/C++?

Also, if anyone has any other tips for programming from a mac, that would be awesome!



Yes, you can do what you've asked and lots more. What I'm unsure of is what kind of "tips" you're looking for... The Arduino IDE works the (almost) identically in OSX, Windows and Linux. The key to Arduino is a pre-installed bootloader on the processors that allows for a simple serial download of programs into the target microprocessor.

The base Arduino environment supports various chipsets from Atmel in the AVR and ARM families. Other add-ons support STM8 and 32, ESP8266 wifi chipsets, Freescale MK20/64/66 and far more others that I cannot think of at the moment.


Okay, good to know that i can do that. As in tips, is there a tutorial of how i can use an arduino as a programmer to program an Atmega chip using my mac?


It's mostly about setting up arduino compatible microprocessors and bootloaders as stand-alone chips, but most of that is applicable to programming other AVRs as well.  Basically, you use the "Arduino as ISP" sketch on your arduino, and then use "avrdude" (installed with the arduino software) from the a terminal window or xterm.  There are a significant number of tutorials on this, though I guess few are specifically aimed at Macs.   Since the compiler and avrdude are simple cross-platform CLI utilities, and the IDE runs everywhere, there isn't really much difference between using a Mac and using a PC.


Oct 06, 2017, 12:32 am Last Edit: Oct 06, 2017, 12:32 am by DrAzzy
If you want to write the code using the Arduino IDE, you need to locate and install an appropriate third party hardware package. Most of the 8-bit AVR chips you want to use have such a package available.

For most relevant ATmega chips, MCUDude (hansibull) has a core. For the ATTiny line, I maintain a core for almost every ATTiny that is appropriate for use with Arduino (see github link in sig)
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy


Ok, so i read the tutorial and what i understood is that i need to first use the arduino uno to flash a bootloader onto my chip, then i can program the chip using a serial port. So, if i have a chip that already has a bootloader, will i need to use the arduino uno in order to program it, or can i program it directly from my computer via the serial port.


If it has a bootloader then you can program it with the serial line.  You said so yourself in the first sentence of that post that you read exactly that.  If the chip came pre-loaded with the bootloader then someone just saved you one step. 
If at first you don't succeed, up - home - sudo - enter.

Go Up