Ads

Get STM32 tutorial using HAL at $10 for a limited time!

Saturday, January 11, 2014

Programming ATmega16/16A with Arduino IDE

In this tutorial, I will share how to program AVR ATmega16/16A using Arduino IDE. First, download the definition file from here. Next, Copy custom folder from extracted file to hardware folder in Arduino IDE.

Run the Arduino IDE, then from menu Tools select Board → ATmega16/16A (16MHz, External).


Select menu File → Preferences, and check the compilation check box.


This is pin configuration of ATmega16/16A on Arduino IDE.

For testing I’m using simple LED blink program.
void setup()
{
        // Pin 29 ATmega (PORTC.7)
        pinMode(23, OUTPUT);
}

void loop()
{
        digitalWrite(23, HIGH);
        delay(500);
        digitalWrite(23, LOW);
        delay(500);
}
Compile the sketch then upload file .hex using ISP programmer.


Reference Link:
http://hardwarefun.com/tutorials/use-arduino-code-in-non-arduino-avr-microcontroller
https://code.google.com/p/arduino/wiki/Platforms

2 comments :

  1. recipe.preproc.macros pattern is missing

    Error compiling for board ATmega16/16A (16MHz, External).

    ReplyDelete
  2. i have uploaded the sketch in atmega16a and the blink program is working perfectly for some pins only . how to troubleshoot.?

    ReplyDelete