1

I have made a standalone arduino board with a Atmega328p w/ Uno bootloader taking inspiration from this video https://youtu.be/sNIMCdVOHOM However, when I try to program mine all I get is "Problem uploading to board". I have confirmed that everything on the board works and that I could upload Blink through my arduino Uno via ArduinoISP but I would like to use this adapter to program the board instead.

Other things that I have tried: Swapping Tx/Rx from adapter to board

Adding 100nF capacitor on DTR to RST

Trying without DTR

(The board also has a 10k pullup resistor on the RST line)

Burning a new bootloader after programming with Arduino as ISP

Any suggestions are greatly appreciated.

Thanks,

Circuit picture

Verbose Upload Output

Sketch uses 928 bytes (2%) of program storage space. Maximum is 32256 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes. C:\Program Files\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM7 -b115200 -D -Uflash:w:C:\Users\Admin\AppData\Local\Temp\arduino_build_446007/Blink.ino.hex:i

     Using Port                    : COM7
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200

avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe8 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xe8 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe8 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe8 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xe8 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe8 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe8 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe8 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xe8 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe8

avrdude done. Thank you. Problem uploading to board.

  • Please edit your question to include the verbose upload output (File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK). – per1234 Aug 20 '17 at 2:48
  • What crystal did you use? – Chris Stratton Aug 20 '17 at 3:51
  • The crystal is a 16Mhz – Gregulimy Aug 20 '17 at 3:58
  • Well, one thing you should do is ISP load a sketch that actually uses the serial in both directions, and verify that you have that communication actually working. – Chris Stratton Aug 20 '17 at 4:14
  • I have previously tried using serial communication on the board via ISP with the UNO however, I was unable to receive understandable data - everything that came out was random symbols that wasn't what I was looking for. This is why I had swapped to using this adapter as I thought it would be much simpler to function :P – Gregulimy Aug 20 '17 at 4:33
2

There are two stages to programming a chip. First is to get the firmware (the bootloader, for example) on there, which you have done.

Second is to configure the chip to operate in the way you have wired it up. Specifically to configure the oscillator and clock source.

The bootloader and your sketch all expect the chip to be running at 16MHz. It uses that constant value to calculate things like the baud rate for serial communications. If the chip isn't running at 16MHz then all those calculations will be meaningless.

You have connected a 16MHz crystal, which is good, but unless you tell the chip to use it you will still be using the internal oscillator for your clock source as set in the factory. This is an 8MHz oscillator with clock division down to 1MHz.

You need to configure the fuse bits on the chip using avrdude and your Arduino as an ISP.

This article details exactly how to do it and teaches you what the fuses are and what they mean.

  • Fuses should automatically be set appropriately when the IDE is used to burn the bootloader, unless the boards file is broken. – Chris Stratton Aug 20 '17 at 16:16
  • @ChrisStratton Maybe it is. Or maybe he had the wrong board selected. Going by the comments the baud rate is wrong, which points to a mismatch between the oscillator (or fuses) and F_CPU. – Majenko Aug 20 '17 at 16:19
  • I just assumed that when I programmed it with Blink the first time on breadboard (with my UNO) it was all set up correctly as the timing looked correct. I will check that article and see. – Gregulimy Aug 20 '17 at 21:02
2

I have confirmed that everything on the board works and that I could upload Blink through my arduino Uno via ArduinoISP but I would like to use this adapter.

Because the ATmega family does not support a partial flash erase via ISP, loading a sketch via ISP removes the bootloader.

Therefore you must (re)load a suitable bootloader using the ISP connection, before you can perform a serial upload of a sketch using that bootloader.

  • Oh, I didn't know that. Would I be able to flash the bootloader from my Uno to use on this board, using the same ISP connection that I did previously? – Gregulimy Aug 20 '17 at 2:56
  • I just tried burning the booloader from my UNO onto my other board, then reconnecting the USB adapter and it still does not upload and I receive the same error. – Gregulimy Aug 20 '17 at 3:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.