Standalone Atmel2560 problem?

Hello all!

first i want to tell that i have made a board with a atmega2560-16AU
i have put the required components like a cristal and 2x 22pf capacitors.
also the decoupling capasitors.

to burn the bootloader into the chip with the ISP connector is working i think,
because my USBASP 2.0 adapter is blinking and the arduino IDE tell’s me that it
is done. i did also the trick with the Fuse D8 change to D9.

i can program a small blinksketch to it and the led to test i have set on PA7 (AD7) pin 71 (digital pin 29)
but the led is not blinking at all…

now i have read that not all cristals will work, can someone tell me to if i can use this small SMD cristal 16Mhz see this link for the datasheet. or do i something wrong with programming maby?

this is the name: QANTEK 16MHz Crystal ±20ppm SMD 2-Pin 5 x 3.2 x 1.1mm

I place also a picture of my CPU connections what is now on my PCB

Hope someone can help me out.

greetings,
Mark

Did you upload the blink sketch to the ATmega2560 using the USBasp or over serial using the bootloader?

According the schematics: RESET pin pulled down (to GND) with 10k resistor - wrong. It have to be pulled up to 5V otherwise it will keep down the MCU.

pert:
Did you upload the blink sketch to the ATmega2560 using the USBasp or over serial using the bootloader?

Im upload it trough the USBasp device connected on the ISP connector

OK, I think you’re encountering this:

My recommended solution is to update the firmware on your USBasp to this one:

Other workarounds:

  • Upload over serial instead of using the programmer.
  • Change the high_fuses to 0xD9 (but note that breaks serial uploads.

pert:
OK, I think you're encountering this:
Program doesn't run after Upload Using Programmer with USBasp (Mega2560) · Issue #246 · arduino/ArduinoCore-avr · GitHub
My recommended solution is to update the firmware on your USBasp to this one:
GitHub - PeterVH/usbasp: My repo for experimenting with the usbasp firmware from www.fischl.de</ti
Other workarounds:

  • Upload over serial instead of using the programmer.
  • Change the high_fuses to 0xD9 (but note that breaks serial uploads.

Ok i will look for that, but can i use my old UNO to go program it trough the UART port?
so i know that the bootloader need to be first at the atmega2560, but is that with the D8 or D9 version?

RePuDiaToR:
can i use my old UNO to go program it trough the UART port?

Yes you can do that. You need to understand a couple things:

  • When you uploaded the sketch using the USBasp you erased the bootloader on the ATmega2560 so you need to do another Burn Bootloader before you can do a serial upload.
  • The ATmega2560 must be reset just as the upload starts (after compilation finishes) to activate the bootloader. On your Uno, there is an auto-reset circuit that does this automatically. If you don't have the auto-reset connected on your ATmega2560 then you need to manually reset it.

RePuDiaToR:
is that with the D8 or D9 version?

0xD8, which is the default setting the Arduino IDE uses for the Mega board definition.

hmmm this is odd!

now i just want to upload a new bootloader to the 2560 and now the USBASP programmer does not work anymore pfff i get this now:

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
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.

im now confused hahahahah

I’ve had this error from using Arduino’s AVRDUDE 6.3.0 with the libusb-win32 driver. The solution was:

  • Download Zadig from http://zadig.akeo.ie/
  • Plug the USBasp into your computer
  • Start Zadig
  • Options > List all devices
  • Select USBasp from the dropdown menu
  • Select libusbK (v3.0.7.0)
  • Click “Install”

Note that Zadig is even recommended on the official USBasp website:
https://www.fischl.de/usbasp/

hmmm im try to remove all the shit that that program has installed but it is hard.
de reinstall with Zadig is not working… i still have that odd problem.

i tried with the regedit etc…

so it did someting in my system :frowning:

Which program?

pert:
Which program?

It is the program that i downloaded and try it, that AvrDude 6.x version, the latest.. but
it was not run in windows 10, i saw a screen pop up hen i start it and it was direct gone.

so i think that that program did something to my device maby PC.

It still doesn't make sense. AVRDUDE is included with the Arduino IDE. If you have the Arduino IDE there is no need to install AVRDUDE separately. You spoke of regedit so I guess you're using Windows. On Windows there is no need to do a real installation of the Arduino IDE if you use the "Windows ZIP file for non admin install" download. If you used the "Windows Installer, for Windows XP and up" then it does do an installation and writes to the Windows registry. If you use the "Windows app Requires Win 8.1 or 10" then I'm sure Windows does all sorts of idiotic things when installing the app. But there is nothing specific to AVRDUDE at all. It's just a single .exe file with a configuration text file and doesn't require any registry entries at all. If you got the stock version of AVRDUDE straight from its website it's the same thing, just unzip the downloaded file and put the contents anywhere you like, no installer. If you found some random unofficial 3rd party AVRDUDE then it's anyone's guess what that did to your system.

If you provide more details we might be able to help you. As it is now, it's really hard to understand what you're talking about. AVRDUDE by itself will absolutely not do anything to your PC. At the very most it will create a file but even that would only happen if you ran a command to download the program off your Arduino, which the Arduino IDE doesn't do and Arduino users almost never do.

ok, i will try to explain what the situation is a.t.m. :slight_smile:

before all was working good with my USPASP 2.0, if i played with that D8 and D9 stuff to load the bootloader into my custom made board with mega2560.

but suddenly i have this error:


avrdude: warning: cannot set sck period. please check for usbasp firmware update.
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.

the selected serial port
does not exist or your board is not connected

on my other computer i have exacly the same and i did not play with different programs to install drivers or what so ever. i get the same problem.

now i have solder the ISP connector again and try to load the bootloader into my orginal UNO but also the same error again. Could it be that the USBASP is currupted, if i do Upload using programmer then i see the LED R 1 time blink and i get that error showed above..

I did swapped the MISO and MOSI at the ISP connector 1 time, so i hope that this will not damage the programmer.

if i take out the 10 pin ribbon cable from the programmer, and do Upload using programmer then the same error again, i expected an error that it could not find the target AVR chip.

I hope it is a bit clear what my problem is atm...

Oh and the quistion about pogramming to the UART of a ARV can i just use this part?

https://www.digikey.com/product-detail/en/ftdi-future-technology-devices-international-ltd/USB-RS232-WE-1800-BT_0.0/768-1065-ND/2402469

i have this here a few, so i think i can just use this to program a arduino trough the TX and RX :slight_smile:

Yes, that will work. You can use the RTS line in place of the DTR line (which isn't broken out on those cables) to do the auto-reset. I prefer a dedicated solution like this over cobbling something up using an Arduino board for a USB to TTL serial adapter as some people do.