Hello,
i have a microcontroller board with a atmega168 on it.
To prgramm it flashes the bootloader over isp and now want to use it with arduino.
The problem is that when i write a programm to the board, the first time it works. the second time i get this error:
avrdude: stk500_getsync(): not in sync: resp=0x7e
where the hexnumber in the end changes from time to time.
To flash a new programm i now always have to first flash the bootloader again, and then upload the programm from arduino again.
in my boards.txt i added the board
##############################################################
emcreprap.name=EMC2RepRap
emcreprap.upload.protocol=arduino
emcreprap.upload.maximum_size=14336
emcreprap.upload.speed=19200
emcreprap.bootloader.low_fuses=0xff
emcreprap.bootloader.high_fuses=0xdd
emcreprap.bootloader.extended_fuses=0x00
emcreprap.bootloader.path=atmega
emcreprap.bootloader.file=ATmegaBOOT_168_ng.hex
emcreprap.bootloader.unlock_bits=0x3F
emcreprap.bootloader.lock_bits=0x0F
emcreprap.build.mcu=atmega168
emcreprap.build.f_cpu=16000000L
emcreprap.build.core=arduino
and i flashed the ATmega_168_ng bootloader using avrdude (from the arduino ide my programmer wont work correctly)
so any ideas why it only works once everytime. looks to me like the boatloader somehow overwrites parts of itself ??