Up to now,follow
http://www.subtours.com/ralph/theory/atmega16witharduino.html this article,i'v modified pins_arduino.c in arduino-0018\hardware\arduino\cores\arduino\
added
#elif defined(__AVR_ATmega16__)
const uint16_t PROGMEM port_to_mode_PGM[] = {
NOT_A_PORT,
&DDRA,
&DDRB,
&DDRC,
&DDRD,
};
const uint16_t PROGMEM port_to_output_PGM[] = {
NOT_A_PORT,
&PORTA,
&PORTB,
&PORTC,
&PORTD,
};
const uint16_t PROGMEM port_to_input_PGM[] = {
NOT_A_PIN,
&PINA,
&PINB,
&PINC,
&PIND,
};
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
// PORTLIST
PD, /* 0 */
PD,
PD,
PD,
PD,
PD,
PD,
PD,
PB, /* 8 */
PB,
PB,
PB,
PB,
PB,
PC, /* 14 */
PC,
PC,
PC,
PC,
PC,
PC,
PC,
PA,/* 22*/
PA,
PA,
PA,
PA,
PA,
PA,
PA,
};
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
// PIN IN PORT
// -------------------------------------------
_BV(0), /* 0, port D */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(6),
_BV(7),
_BV(0), /* 8, port B */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(0), /* 14, port C */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(6),
_BV(7),
_BV(0), /* 22, port A */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(6),
_BV(7),
};
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
// TIMERS
// -------------------------------------------
NOT_ON_TIMER, /* 0 - port D */
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
TIMER1B,
TIMER1A,
NOT_ON_TIMER,
TIMER2,
NOT_ON_TIMER, /* 8 - port B */
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,/* 14 - port C */
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER, /*22 port A */
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
};
boards.txt in arduino-0018\hardware\arduino
added
##############################################################
atmega16.name=The mega16 w/ ATmega16
atmega16.upload.protocol=stk500
atmega16.upload.maximum_size=7168
atmega16.upload.speed=19200
atmega16.bootloader.low_fuses=0xdf
atmega16.bootloader.high_fuses=0xca
atmega16.bootloader.path=atmega8
atmega16.bootloader.file=ATmegaBOOT.hex
atmega16.bootloader.unlock_bits=0x3F
atmega16.bootloader.lock_bits=0x0F
atmega16.build.mcu=atmega16
atmega16.build.f_cpu=16000000L
atmega16.build.core=arduino
Can't pass the compile...
Can anyone give me some advice on what i need to do?
Thank you very much.