Search for hardware\arduino\cores\arduino directory. Open Arduino.h file and add the following line after the last timer-defined line, that is, after #define TIMER5C 17, which comes after line number 184.
#define TIMER0 18
Open Tone.cpp file in the cores directory and add/modify the following to suit Timer2 of ATmega32.
After line number 39, add defined(__AVR_ATmega32__) as shown below:
#if defined(__AVR_ATmega8__) || defined(__
AVR_ATmega128__) ||defined(__AVR_
ATmega32__)
After line number 56, add !defined(__AVR_ATmega32__) as shown below:
#if !defined(__AVR_ATmega8__) ||
!defined(__AVR_ATmega32__)
After line number 96, add defined(__AVR_ATmega32__) as shown below:
#elif defined(__AVR_ATmega8__) ||
defined(__AVR_ATmega32__)
Open WInterrupts.c in the same cores directory and add following for ATmega32 int2 after line number 147:
#elif defined(MCUCSR) && defined(ISC2)
MCUCSR = (MCUCSR & ~(1
<< ISC2)) | ((mode & 1) << ISC2);
GICR |= (1 << INT2);
After line number 324 add:
if defined(ISC2)
ISR(INT2_vect){
if(intFunc[EXTERNAL_INT_2])
intFunc[EXTERNAL_INT_2]();
}
#endif
Open wiring.c in the same directory cores and add following after line number 201:
#if defined(TCCR0) && defined(WGM00) &&
defined(WGM01)
sbi(TCCR0,WGM00);
sbi(TCCR0,WGM01);
#endif
In the same directory open Wiring_analog.c and add following after line number 129:
#if defined(__AVR_ATmega32__)
case TIMER0:
sbi(TCCR0, COM01);
OCR0 = val; // set pwm duty
break;
#endif
In the same directory open Wiring_digital.c and add following after line number 98:
#if defined(TCCR0) && (COM01)
case TIMER0:
cbi(TCCR0, COM01);
break;
#endif
In the same directory open wiring_private.h and add following after line number 56:
#elif defined(__AVR_ATmega1284__) || defined(__
AVR_ATmega1284P__) || defined(__
AVR_ATmega644__) || defined(__
AVR_ ATmega644A__) || defined(__
AVR_ ATmega644P__) || defined(__
AVR_ ATmega644PA__) || defined(__
AVR_ ATmega32__)
These modifications are sufficient. You can now select Arduino ATmega32 under Tools>Board on Arduino IDE 1.0.5 as shown in Fig. 5. You may perform all the steps for ATmega32 on this IDE like any other Arduino board. But with this you cannot load the sketches without an external programmer because we have not loaded bootloader on ATmega32 yet.
However, without the bootloader, it is also advantageous as full memory space is available for sketches\application programs on ATmega32. If we use bootloader, it will consume 2k memory of ATmega32.
With this project, you can use Arduino IDE for various designing purposes using ATmega32 MCUs.
Why can’t we use latest Arduino IDE?
The author was suppose to add the design with FT232 USB to ttl converter.
as the prototype image is with the FT232.
Dear sir ,
Can u suggest me Embedded C language books for the Arduino compatibility. for practices based purpose or student level.
Sorry, we cannot help you personally but we’d recommend you to join our forum (http://forum.electronicsforu.com/forum.php) and post your question there. Our community members could help you out.
Sir the article is excellent, however just like the prototype board we would like to use an FTDI chip to program it directly using a USB, please contact.
good article
Can I use atmega16 also
Yes, you can use ATmega16 also