Belajar Arduino IDE for programming Atmega Microcontrollers

Arduino IDE is designed to program Arduino boards featuring an AVR microcontroller with an Arduino bootloader. But Do you know that the same Arduino IDE can be used to program other Atmega microcontrollers, even without a bootloader?.

Arduino Mega

Arduino Mega

 

Well it can. But you need an extra AVR programmer like USBASP. This method has many advantages like extra program memory space of about 2 Kb due to not using a bootloader, short prototyping time compared to coding in C. Moreover, one need not buy the Arduino board for every project, as we can use the cheaper Atmegas.

I tried Atmega 8 and Atmega 32. Both of them works flawless with the Arduino IDE.The hardware is simple and consists of just the power supply, a crystal (8MHz for atmega 8 and 16MHz for Atmega32 etc. The Atmega to Arduino pin mapping for both of them is given below

Arduino-To-Atmega8-Pins

Arduino-To-Atmega8-Pins

Arduino to Atmega32 pin map

Arduino to Atmega32 pin map

The Arduino IDE uploads sketches default using the bootloader and through the serial port. Now we have to change it to the USBASP. This can be done by editing the file named programmers.txt located at ~/arduino-xxx/hardware/arduino directory. We have to add an entry corresponding to our USBASP to the end of the file named programmers.txt.

Selengkapnya baca di :

Arduino IDE for programming Atmega Microcontrollers