Using external programmer (e.g. USBasp)

Hello,

Just a quick question, because unfortunately something is not clear for me about this article.

If a sketch is uploaded with Upload using programmer procedure a previously burned bootloader on the chip will be cleared/deleted?

Thanks in advance.

Yes, the bootloader will be wiped out.

Got it, thanks!

I'm planning to build a custom board with 8 MHz crystal and 5V VCC.

Fuses doesn't contain anything related to VCC, so this should work, right?

1. Burn bootloader to set fuses (Arduino Pro or Pro Mini, 3.3V, 8 MHz)
kép

2. Upload sketch using programmer (this will delete bootloader but keep fuses)

I'm dubious that it changes any fuses. AFAIK, that menu only changes the timer settings because they are running from a different clock frequency.

My board has arrived, I really hoped that it would work like a charm, but I was just naive again. :smiley:

I get the following error if I'd like to upload a simple sketch to the board (USBasp, Upload Using Programmer, selected Arduino Pro or Pro Mini, 3.3V, 8 MHz):

An error occurred while uploading the sketch
avrdude: error: program enable: target doesn't answer. 1 
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

Then I found an article stating:

"Brand new AVR chips usually come configured from the factory with an internal clock of 1MHz. This is set as part of the “fuse bits” inside the microcontroller. If you use the Arduino IDE it gets reprogrammed to use the external 16MHz crystal when you upload the Arduino bootloader."

But unfortunately this command line upload also gives an error:

avrdude -B 4 -c usbasp -p atmega328p -u -U flash:w:ledCheck.ino.hex
avrdude: set SCK frequency to 187500 Hz
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.
avrdude done.  Thank you.

Voltages seems OK, I added the ICSP header according to the KiCad pinout, reset has a 10k pullup.

What should I do now?

The programmer works fine with a standard UNO board with the same chip: MEGA328P U-TH 354730.

I removed R8 from the SCK line, maybe the transistor current somehow messes with the SCK signal.

Still not working.

I checked the RESET line with a handheld oscilloscope, it gets correctly pulled down for 100ms anytime I execute a command. I guess this is OK.

Ok, design failure. :smiley:

There is C5 and C6 filter capactiors on the MISO, MOSI line...not good for programming.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.