I burned the arduino bootloader within a atmega88, in order to program it directly from the serial port. But I can't download my code from the arduino IDE... But I get the famous : 'avrdude stk500_getsync() not in sync resp=0x00' error.
what I did :
I set the fuse :
- Fire the bootloader after RESET (BOOTRST fuse)
- Set the bootloader section size to 1024 words (2048 bytes), because the compiled bootloader is ~1400 bytes (BOOTSZ0 & BOOTSZ1)
- Enable SPI programming, of course, we don't want to brick the chip (SPIEN)
- Set the clock to the internal 8Mhz clock, since wee don't use an external one
which gives :
EFUSE = 0x00
LFUSE = 0xe2
HFUSE = 0xdf
through ISP port and an arduino as ISP:
avrdude -P COM3 -b 19200 -c avrisp -p m88 -v -U efuse:w:0x00:m -U hfuse:w:0xDF:m -U lfuse:w:0xE2:m
- I find a bootloader for the atmega88 (https://github.com/royshil/ATmega88-bootloader) and download it within the µC.
through ISP port and an arduino as ISP:
avrdude -P com3 -b 19200 -c avrisp -p m88 -v -e -Uflash:w:ATmegaBOOT_88_m88.hex -U lock:w:0x0F:m
- I tweaked $(ARDUINO)/hardware/arduino/boards.txt to add this:
atmega88.name=ATmega88 atmega88.upload.protocol=arduino atmega88.upload.maximum_size=7168 atmega88.upload.speed=19200 atmega88.bootloader.low_fuses=0xe2 atmega88.bootloader.high_fuses=0xdf atmega88.bootloader.extended_fuses=0x00 atmega88.bootloader.path=atmega88 atmega88.bootloader.file=ATmegaBOOT_88_m88.hex atmega88.bootloader.unlock_bits=0x3F atmega88.bootloader.lock_bits=0x0F atmega88.build.mcu=atmega88 atmega88.build.f_cpu=8000000L atmega88.build.core=arduino atmega88.build.variant=standard
Until here, everythings works fine. But finally I'm not able to download directly my code from the arduino IDE as usual (using an FTDI adapter).. and get the error ... stk500_getsync() not in sync resp=0x00
what can it be?!
here is the wiring of my board: (CON2 is the connector part for the FTDI adapter)
all help will be much appreciate!
Thank you internet ;)
atmega88.upload.speed=9600
– Nick Gammon♦ Aug 27 '15 at 21:50