Stability issues flashing bootloader to ATMEGA1284p on PCB

Hi Arduino-fellows,

I'm having problems flashing bootloader to a standalone Atmega1284p chip on a PCB that I designed. I'm trying to summarize what I did:

I have no problems flashing bootloader to a standalone Atmega328p or an Atmega1284p with 16MHz quartz oscillator and 2x20pF caps as well as MOSI, MISO, SCK connected to Arduino UNO (Pin 11, 12, 13) and Reset pin of the chips connected over 10k to Pin10 on Arduino UNO and pulled high over +3V3 VCC.
I am using the bootloader of maniacbug:

Flashing bootloader sometimes works and sometimes not. It is more likely to work when flashing the 8MHz version rather than the 16MHz version of the maniacbug library.

Attached below is an image of the PCB board. I've placed a 16MHz oscillator and 20pF caps, as recommended.

Do you think that the problem could be the 5V logic of the Arduino UNO when flashing bootloader and it should be 3.3V? But then, I don't understand why it works flawlessly with the DIP package standalone chips.

Another solution could be using an FTDI adapter to flash bootloader. I am curious about your ideas.

Thank you!

mbobinger:
and Reset pin of the chips connected over 10k to Pin10 on Arduino UNO

Why 10K resistor? I've never heard of that being done. The 10K resistor should be on the reset pin's pull-up line, not the line to pin 10 of the Uno.

mbobinger:
I am using the bootloader of maniacbug:

GitHub - maniacbug/mighty-1284p: Mighty 1284P Platform for Arduino

I don't think it has anything to do with your problem, but that project is so outdated. I highly recommend using the far superior MightyCore:

mbobinger:
Flashing bootloader sometimes works and sometimes not.

Please do this:

  • (In the Arduino IDE) File > Preferences
  • Check the checkbox next to "Show verbose output during: upload
  • Click "OK"
  • Tools > Burn Bootloader
  • After the Burn Bootloader process fails, you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the Burn Bootloader output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

mbobinger:
Do you think that the problem could be the 5V logic of the Arduino UNO when flashing bootloader and it should be 3.3V?

What is the ATmega1284P powered at? If it's powered at 5 V, then the 5 V logic of the Uno is fine. If it's powered at 3.3 V then the 5 V logic is not fine and could be damaging the ATmega1284P.

mbobinger:
Another solution could be using an FTDI adapter to flash bootloader.

Although that is supposedly possible, I've never heard of any one actually doing it, and it is not likely to have any more chance of success. Stick with the Arduino as ISP, or if you want to upgrade, get a USBasp from eBay for ~$3.

mbobinger:
Attached below is an image of the PCB board.

@mbobinger's atmel1284p.PNG: