Trying to burn the bootloader

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
diegzumillo
Posts: 31
Joined: Sat Apr 28, 2018 3:16 am

Trying to burn the bootloader

Post by diegzumillo »

Hey there

I'm trying to put the bootloader on my atmega and I'm having some trouble. First of all, the part that got here (I got it from the shopping list somewhere here) seems to be atmega644-20pu. Wasn't it supposed to be just 644p? or are these the same thing?

Anyway, I moved forward and tried to do the thing. I'm using avrdude and an arduino uno as isp. It seems to not recognize the target board if I use -p m644 or m644p. Even if I override the check with -F it moves forward but at the end of the process it reads the flash and accuses a mismatch with the bootloader.hex file.

Since it reads the device signature I decided to look for a list of these signatures to figure out what exactly is this thing I'm using. The signature is 0x1e950f, which means it's a 328p. Can this be right?? Anyway, just out of curiousity, I tried to to write the bootloader now specifying it as a 328p, and the process stops saying 'address 0xf010 out of range at line 1 of bootloader". The way I'm interpreting this is that this atmega might actually be a 328p with the wrong label and the bootloader wasn't made for it, that's why it fails.

I'm new to this stuff though. Any ideas? I'm inclined to just buy a new atmega from a reliable source.
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: Trying to burn the bootloader

Post by ry755 »

diegzumillo wrote: Sun Sep 16, 2018 4:16 am First of all, the part that got here (I got it from the shopping list somewhere here) seems to be atmega644-20pu. Wasn't it supposed to be just 644p? or are these the same thing?
644-20PU is correct. The 20PU shows that it's the DIP version, versus the surface mount one (or the newer 20AU)
diegzumillo wrote: Sun Sep 16, 2018 4:16 am Since it reads the device signature I decided to look for a list of these signatures to figure out what exactly is this thing I'm using. The signature is 0x1e950f, which means it's a 328p. Can this be right?? Anyway, just out of curiousity, I tried to to write the bootloader now specifying it as a 328p, and the process stops saying 'address 0xf010 out of range at line 1 of bootloader". The way I'm interpreting this is that this atmega might actually be a 328p with the wrong label and the bootloader wasn't made for it, that's why it fails.

I'm new to this stuff though. Any ideas? I'm inclined to just buy a new atmega from a reliable source.
Make sure you flashed the Arduino-as-ISP sketch to your Uno first, and also check your wiring. Avrdude is trying to overwrite the bootloader on the Arduino Uno instead of the 644. (the Uno uses a 328p)
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Trying to burn the bootloader

Post by uze6666 »

An atmega644-20pu should work just fine. And I don't think you can get fakes of those considering their importance! Now it's hard so say where the problem lies...could it be with the programmer. Personally I'd say avoid the trouble and get yourself and AVR Ice if you can afford it or a AVRISPMKII clone. After that, we'll be on the base and I will be able to help you much more. :P
User avatar
Jubatian
Posts: 1561
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Trying to burn the bootloader

Post by Jubatian »

If you suspect the programmer, and would rather prefer to stay on the cheap side, I could recommend this one: Pocket AVR Programmer. I have this, and it works fine with Avrdude, I succesfully burned all ATmega644 variants which fit in the Uzebox's DIP socket, and also the 1284s. Any DIP ATmega644 variant should work fine in the Uzebox, however occasionally you might happen to stumble upon one which just doesn't like running overclocked to 28.6MHz. 1284s doesn't work (or you would have to be very lucky to pick one which does).
diegzumillo
Posts: 31
Joined: Sat Apr 28, 2018 3:16 am

Re: Trying to burn the bootloader

Post by diegzumillo »

I think I'm making some progress. At least now I know a few things, I know which programmer to use in the command line, which target to use. Being confident about those is a good step, now I don't see the device identification wrong anymore.

The problem I see now is stkk500_getsync(): not in sync: resp=0x00

I checked the wiring. Nothing seems wrong. I suspect the programmer; a lot of people online having difficulties with this setup of arduino uno as isp. Maybe it is just not a beginner setup, but I had an Uno lying around doing nothing, might as well put it to work. But I give up for now and I'll get the AVRISP mkII clone or the pocket programmer.

I wish there was an easy way of testing the chip though. I can test my uno with the arduino ide by uploading sketches, so I know it works as intended, but the atmega just sits there completely dead.

BTW, a slightly off topic question; I just finished soldering everything to the PCB. Should I see the LED turn on when I apply power? even without programming the atmega? I was expecting that to happen, and it would be a confirmation that I didn't mess up anything, but it does not turn on.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Trying to burn the bootloader

Post by CunningFellow »

The LED is turned on by the ATMega644. So no program inside chip = no LED.

Your cheapest way out it probably an USBISP programmer from AliExpress or eBay. Should be sub $2 and that will be one less thing to worry about. The USBISP is a open source AVR programmer that uses the OBDEV software USB libs to let AVRDUDE program a wide range of AVR chips.

It is not as robust as the one Jubatian linked to from Sparkfun which is a clone of the AVR910 programmer from Atmel. But it is a lot cheaper.

Next up from there - you can get an AVR-ISP clone from AliExpress for sub $20.

All of these will work fine for an ATMega644.

If you are planing on programming newer Atmel chips in the future (including the ones used in the 32 bit Arduinos the ATSamD series) then the $100 AVR_ICE is the way to go.
diegzumillo
Posts: 31
Joined: Sat Apr 28, 2018 3:16 am

Re: Trying to burn the bootloader

Post by diegzumillo »

All rightey then. The programmer being the most likely suspect that is what I will do now. I think for my noob face the Pocket AVR seems like a good compromise of easy to use and low cost.

I will report back when it arrives and I get some time to work on this again :mrgreen:
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: Trying to burn the bootloader

Post by ry755 »

Wait, before you order a new programmer, try this avrdude command:

Code: Select all

avrdude -p m644 -b 19200 -c avrisp -P /dev/ttyACM0
That should make your Arduino work as an ISP, as long as you have flashed the ArduinoISP sketch and replace /dev/ttyACM0 with the correct port.
diegzumillo
Posts: 31
Joined: Sat Apr 28, 2018 3:16 am

Re: Trying to burn the bootloader

Post by diegzumillo »

Oh no! I missed this! the programmer is under way now. But I'll give this a shot anyway, later today. baud rate makes sense to give a sync problem.
diegzumillo
Posts: 31
Joined: Sat Apr 28, 2018 3:16 am

Re: Trying to burn the bootloader

Post by diegzumillo »

Hey! the new programmer arrived and the process seems to have worked just fine. Flashed the hex and set the fuses. The led turns on now, so that's nice. But I get no signal on my tv, so that's not nice. I don't have an SD card yet though but I thought it would at least turn on and boot into an empty list selector or something. Not sure if it's a video problem or something more serious.
Post Reply