---
title: 'Burning the Arduino Bootloader to an ATmega328P with a TL866II'
url: 'https://dmcmillan.co.uk/blog/burning-the-arduino-bootloader-to-an-atmega328-with-a-tl866ii'
markdown: 'https://dmcmillan.co.uk/blog/burning-the-arduino-bootloader-to-an-atmega328-with-a-tl866ii.md'
date: '2020-02-20'
description: 'I had previously programmed an ATmega328P using AVRDude - this was some time ago, and I was not even sure what program I had applied. When I attempted to overwrite the program using the Arduino IDE, I hit a dead end. I got the error message: stk500_recv(): programmer is not responding It was clear …'
taxonomy:
  tag:
    - Arduino
    - ATmega328
    - TL866II
---

# Burning the Arduino Bootloader to an ATmega328P with a TL866II

## [Burning the Arduino Bootloader to an ATmega328P with a TL866II](https://dmcmillan.co.uk/blog/burning-the-arduino-bootloader-to-an-atmega328-with-a-tl866ii)

    20th Feb 2020   [Arduino](https://dmcmillan.co.uk/blog/tag:Arduino#body-wrapper) [ATmega328](https://dmcmillan.co.uk/blog/tag:ATmega328#body-wrapper) [TL866II](https://dmcmillan.co.uk/blog/tag:TL866II#body-wrapper)  

I had previously programmed an ATmega328P using AVRDude - this was some time ago, and I was not even sure what program I had applied.

When I attempted to overwrite the program using the Arduino IDE, I hit a dead end. I got the error message:

`stk500_recv(): programmer is not responding`

It was clear that something was not quite right.

I inserted the chip into my TL866II and was able to see that the IC itself was working fine - data could be read and re-written to the device. However, even using a complied hex file from Arduino studio, the IC did not appear to work correctly in circuit. Recompiling and burning the hex file over and over was frustrating - I wanted to simply upload from the Arduino IDE.

I decided to start from scratch, with a clean Arduino bootloader, so I could easily continue development.

Within the Arduino installation directory, at C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\bootloaders\\optiboot there is a clean atmega328 hex file that can be programmed - optiboot\_atmega328.hex

I programmed this to the Atmega, but *again* was unable to program the chip using Arduino studio.

I discovered that specific fuse bits need to be set, and XGPro does not select these by default. The correct settings are:

```
Fuse Low Byte (none selected)
Fuse High Byte
    SPIEN=0
    BOOTRST=0
Extended Fuse Byte
    BODLEVEL1=0
Lock Bit Byte (none selected)
```

Setting the fuses in this manner, and re-programming the optiboot\_atmega328.hex then worked OK.

[Here](https://dmcmillan.co.uk/blog/burning-the-arduino-bootloader-to-an-atmega328-with-a-tl866ii/XGPro%20Blank%20328p.mpj) is a link to an XGPro project with the fuse links set correctly, and the Arduino bootloader included.

[Here](https://dmcmillan.co.uk/blog/burning-the-arduino-bootloader-to-an-atmega328-with-a-tl866ii/optiboot_atmega328.hex) is the bootloader hex if you are unable to find it in your Ardunio folder.

 [ Previous Post](https://dmcmillan.co.uk/blog/testing-a-6502-cpu-on-a-breadboard) [Next Post ](https://dmcmillan.co.uk/blog/repairing-a-microsoft-z80-softcard)

---

## Navigation

- Parent: [Blog](https://dmcmillan.co.uk/blog.md)
- Previous: [Repairing a Microsoft Z80 Softcard](https://dmcmillan.co.uk/blog/repairing-a-microsoft-z80-softcard.md)
- Next: [Testing a 6502 CPU on a breadboard](https://dmcmillan.co.uk/blog/testing-a-6502-cpu-on-a-breadboard.md)
