Arduino Forum

Using Arduino => Avrdude, stk500, Bootloader issues => Topic started by: jjunki20 on Jun 29, 2020, 09:56 am

Title: Burning bootloader atmega328P-AU using USBtinyISP
Post by: jjunki20 on Jun 29, 2020, 09:56 am
Hello guys,
I am now designing a new PCB Board for my project and having trouble in burning bootloader atmega328P-AU using USBtinyISP. And MCU is running with the supply voltage of 3.3V with Voltage regulator.

After setting Board/Processor/Programmer in the arduino [Tools] as attached below,
(https://i.postimg.cc/hjp9Cj4B/Arduino-Setup.png)
I tried to burn bootloader.
But the result always says "error: usbtiny_transmit: initialization failed, rc=-1"

(Many other folks also attach the full output of avrdude, however, I do not know how to get the full output. Please let me know this one as well.)

Here is my circuit design. Please see the below image.
(https://i.postimg.cc/MTTwQPvY/Circuit-Design.png)

First, I have one quick question.
Many people suggested that I connect reset with 10k ohm resistor. (as attached below)
(https://i.postimg.cc/DfPDTd0v/Circuit-Design-inquiry.png)

If this is not the issue, then, how can I troubleshoot this problem?
Is it a matter of the settings in Arduino program (Board/Processor/Programmer)?

Please help me guys!

Thanks
Best
Title: Re: Burning bootloader atmega328P-AU using USBtinyISP
Post by: m_k_akash on Jun 29, 2020, 12:21 pm
I think its a software problem. Check this (https://learn.adafruit.com/usbtinyisp/help) out. To get the verbose output you should enable it in the preferences of the Arduino ide
Title: Re: Burning bootloader atmega328P-AU using USBtinyISP
Post by: kprims on Jun 29, 2020, 04:26 pm
https://static-cdn.imageservice.cloud/5425761/in-circuit-system-programming-icsp-using-usbtinyisp-and-arduino.jpg (https://static-cdn.imageservice.cloud/5425761/in-circuit-system-programming-icsp-using-usbtinyisp-and-arduino.jpg)

Check your 6 Pin J3 connector. Looks like your pins are not the same as a standard connector. if you are using the 6 Pin cable with the USBTinyISP then it will not work.

The 10K resistor isn't needed for ISP programming usually, but you would want it for USB-TTL programming using the bootloader.
Title: Re: Burning bootloader atmega328P-AU using USBtinyISP
Post by: jjunki20 on Jul 01, 2020, 06:21 am
(https://ibb.co/k4BtpRD)
Above image is actual top view of the 3x2 connector.
And I checked this is correct
Could you please validate it once again?
Thanks
Title: Re: Burning bootloader atmega328P-AU using USBtinyISP
Post by: m_k_akash on Jul 01, 2020, 06:50 am
Are you powering your circuit with the usbtiny isp while programing ?
Title: Re: Burning bootloader atmega328P-AU using USBtinyISP
Post by: kprims on Jul 01, 2020, 04:07 pm
Quote
Above image is actual top view of the 3x2 connector.
And I checked this is correct
Could you please validate it once again?
Thanks
This is the layout of the 6 lead cable. I don't think they match up unless you are using individual single leads back to your USBTinyISP.
https://www.iot-experiments.com/content/images/2017/11/icsp_6pin.png (https://www.iot-experiments.com/content/images/2017/11/icsp_6pin.png)
Title: Re: Burning bootloader atmega328P-AU using USBtinyISP
Post by: jjunki20 on Jul 01, 2020, 04:41 pm
I think its a software problem. Check this (https://learn.adafruit.com/usbtinyisp/help) out. To get the verbose output you should enable it in the preferences of the Arduino ide

It doesn't work with a USB 3 port
We've noticed that USB 3 ports are sometimes a little more sensitive than USB 2. In this case you can try changing the cable (see this article) or placing an every-day USB hub between the USBtinyISP and your computer.

I'm running avrdude and I get "error: usbtiny_transmit: initialization failed, rc=-1"
This response means that it found the USBtiny, but could not communicate with it. The likely reason is that you found a version of avrdude that was not from WinAVR.
Differences in new versions of avrdude mean that it doesn't work with the libusb-win32 USBtinyISP driver.
Let me try to use every-day USB hub as my labtop only has usb 3 ports!
Is there any other suggestion?
I will try it right now
Thanks
Title: Re: Burning bootloader atmega328P-AU using USBtinyISP
Post by: CrossRoads on Jul 01, 2020, 04:54 pm
ICSP header is wrong
MISO  1   6   VCC
SCK     2   5  MOSI
Reset   3   4  GND

The programmer holds Reset Low during programming, if the Reset line is not held low, then programming will not be enabled.

Also, after you get the bootloader installed, you will need a 10K pullup resistor on Reset to pull the line after the DTR pulse pulls it low via the 0.1uF cap. 
Title: Re: Burning bootloader atmega328P-AU using USBtinyISP
Post by: jjunki20 on Jul 01, 2020, 05:09 pm
Are you powering your circuit with the usbtiny isp while programing ?
ICSP header is wrong
MISO  1   6   VCC
SCK     2   5  MOSI
Reset   3   4  GND

The programmer holds Reset Low during programming, if the Reset line is not held low, then programming will not be enabled.
(https://ibb.co/w0n9T5D)
https://ibb.co/w0n9T5D
(image upload is not working)

This is how I powered the board (using external 3.7V battery)
and how I connect the USBtinyISP to the board.

(https://ibb.co/NT6R8gj)
https://ibb.co/NT6R8gj
But this red light never lights up which means it is not connected with the target correctly.

CrossRoads,
"The programmer holds Reset Low during programming, if the Reset line is not held low, then programming will not be enabled."
Could you be more specific on what you meant by this? And how can I check if the reset line is held low?

Thanks everyone!