Burning bootloader atmega328P-AU using USBtinyISP

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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,

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.

 

First, I have one quick question.
Many people suggested that I connect reset with 10k ohm resistor. (as attached below)

 

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)?

Also,

Please help me guys!

Thanks
Best

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First off.   Connect factory made 8MHz Pro Mini ISP header pins to your USBtiny.

 

Select 8MHz Pro Mini in IDE

Select USBtiny in IDE

Burn Bootloader

 

Build and run Arduino examples.    Time Blink.ino is correct.

 

Then compare factory made 8MHz Pro Mini to your pcb.   Especially pcb traces and values of Y1, C1, C2.   e.g. 22pF not 22nF

A 10k pullup on RESET is not necessary but will do no harm.

Connect to your 3x2 header.

Select 8MHz Pro Mini in IDE

Select USBtiny in IDE

Burn Bootloader

 

Take notes on paper with each step.

 

David.

Last Edited: Mon. Jun 29, 2020 - 08:55 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply
By the way, could you be a little more specific on what you meant by "traces and values of Y1, C1, C2"?
Do you mean measuring with DMM? or something else?
I am really new to this topic.

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jjunki20 wrote:
"traces and values of Y1, C1, C2"?
Not sure what David means by that but one thing that is evident from your schematic is that things like resistors and diodes are numbered R1, R2, R3, D1, D2 etc but the majority of your capacitors all seem to be just "C" with no identifying ordinal number. When someone wants to say "shouldn't C3 have a larger value" or something it's going to be quite tricky unless you expect them to say "the upper cap near the crystal" or something?

 

(actually I say the Rs are numbered but then there is the current limiting resistor on the LED from pin PB5 which is just "R" so even the resistors are not perfect)

 

As for you question about the need for R on the DTR line - don't you just use the well proven Arduino board designs as a template to see "how to do it properly"?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

>> As for you question about the need for R on the DTR line - don't you just use the well proven Arduino board designs as a template to see "how to do it properly"?

 

Indeed. All Arduino designs are open-source hardware, so you're free to read, copy, clone, mash-up, etc as you see fit. PDF schematics and Eagle files can be found on each product's store page, e.g. https://store.arduino.cc/arduino... (Documentation tab).

 

What is the *actual, physical* pinout of your 2x3 ICSP header ? Your pin order is strange.

 

         +-----------+
         |           |
MISO     | 1       2 |    VCC
         |           |
SCK      | 3       4 |    MOSI
         |           |
RESET    | 5       6 |    GND
         |           |
         +-----------+

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The components are numbered.    Just in an unconventional way.    Look at the Microcontroller schematic.   Y1 is the crystal.   C1 is 22pF.  C2 is 22pF.

 

I was suggesting that you verify your "experience" of the Arduino IDE first.   i.e. by successfully connecting the ISP pins of a ProMini to your USBtiny.

 

I am intrigued by designing a new PCB Board for my project

There is a lot that can go wrong. 

e.g. pcb traces that are routed incorrectly.    Check connectivity between MCU pin,  XTAL pin,  C1 pins, ... with a DMM (and your eyeballs)

e.g. incorrect components.   Measure resistors with DMM.    Small Capacitors by inspecting markings,   comparing size and shape with other SMD components.

 

Believe me.   Everyone on this Forum has made mistakes.

 

Life is much safer with factory made boards e.g. Pro Mini or Nano.

Prototype your project with ready made modules e.g. from Ebay.

 

It is wise to get your schematics "conventional" before you go any further.   i.e. with components numbered clearly.

If you have space for a value,   add the value.   Otherwise list numbered component values in the Bill of Materials.

 

Don't be proud.    Find proven boards and steal the schematic, layout, ... for your custom project.

 

David.

Last Edited: Mon. Jun 29, 2020 - 02:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

jjunki20 wrote:
what you meant by "traces and values of Y1, C1, C2"?

These bits here:

 

Note how that's all a bit hard to read - as the text annotations are writing over each other!

 

clawson wrote:
the majority of your capacitors all seem to be just "C" with no identifying ordinal number.

I think they are actually there - but there seems to be some bizarre text wrapping going on:

 

 

 

 

the current limiting resistor on the LED from pin PB5 which is just "R" 

similarly, I think:

 

 

EDIT

 

David beat me to it.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Mon. Jun 29, 2020 - 02:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh it's the text wrapping! The C and its ordinal number are split across two lines. Would never have spotted that.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Oh it's the text wrapping! The C and its ordinal number are split across two lines. Would never have spotted that.

I don't think that is the reason.

Whatever the cause,   it needs fixing.

 

God created world conventions to make schematics understood in every country.

 

You don't have to follow conventions but your life is easier if you do.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

This is the actual Pin out of ICSP header.

Isn't it correct order?

If this is the problem, I really appreciate that you figured it out.

But, I have checked several different forum pages and it looks correct.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Correct IF looking from the top of the board.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think it is really good point and I definitely need to fix it.

However, I am wondering if this is the real cause of my primary question.

 

result always says "error: usbtiny_transmit: initialization failed, rc=-1" 

This initialization failed error is what I want to troubleshoot.

 

And annotation seems very improper. I agree. But, I try to refer many other arduino board designs.

 

I will definitely try to make same circuit with arduino nano. But I am wondering if it works but customized board does not work.

 

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes it it top view.

And I used same order for slightly different customized board. And at that time, I could burn bootloader.

It is very confusing.