Welcome! Log In Create A New Profile

Advanced

Uploading bootloader to ATmega1284P in Gen7 1.4.1 board

Posted by Raketenolli 
Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 06, 2013 10:55AM
I fabricated my own Generation 7 board, version 1.4.1, with an ATmega1284P, and I'm planning on running it at 20 MHz. The purely electrical part up to having installed the MOSFETs and the microcontroller, went without problems, following the instructions at [reprap.org]

I then installed the Arduino IDE and added the Gen7 files.

The programmer I'm using is [avr-programmer.com] which is supposedly using the STK500v2 protocol.

I only connected the programmer to the board and my (Windows 7) laptop, but no external power source for the Gen7 board. I then tried to execute the commands given at [reprap.org]

It starts with

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>REM write fuses

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>avrdude -C ..\etc\avrdude.
conf -c stk500v2 -p atmega1284p -P COM7 -B 5 -U lfuse:w:0xF7:m -U hfuse:w:0xDC:m
 -U efuse:w:0xFC:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x030000
avrdude: Expected signature for ATMEGA1284P is 1E 97 05
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

I admit to trying this several times, sometimes using the -F flag. It seems the device signature is changing. Originally it was 0x1e9700.

If I do try to write to the flash memory, it says it's writing 130244 bytes (which resembles the 128k on the ATmega), even though the hex file is only about 4k (in ASCII). But I get a verification error in the end.

I'm not really familiar with programming microcontrollers, so could someone please help me out here?

Thanks in advance,
Oliver
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 06, 2013 11:04AM
are you sure it is a ATmega1284P chip?
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 06, 2013 11:49AM
Well, that's what I ordered at Farnell and that's what it says on the chip itself:

[ATMEL logo]
ATMEGA1284P
PU
1228

Oliver
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 06, 2013 12:16PM
I tried with another ATmega1284P. Setting the fuses went through OK. Writing the bootloader results in the following message

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>avrdude -C ..\etc\avrdude.
conf -c stk500v2 -p atmega1284p -P COM7 -B 5 -U flash:w:..\..\..\Gen7\bootloader
s\Gen7\bootloader-1284P-20MHz.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x1e0f02
avrdude: Expected signature for ATMEGA1284P is 1E 97 05
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

As I said, it definitely is an ATmega1284P. This time I will not try the -F flag ...

Oliver
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 07, 2013 02:24PM
I had a similar problem, but it was my fault, because the oscillator capacitors that I'd soldered was 22µF instead of 22pF.

I think there are a lot of causes for an Signature Error, but I don't know more than the one I had. Sorry.
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 07, 2013 04:38PM
That doesn't seem to be the reason. On the packaging the capacitors came in it clearly says "22" means 22 pF. Even though there are other sources that say that "22." (note the decimal point) can mean 22 uF as well. I don't believe there is such a thing as a 22 uF ceramic capacitor.

Thanks for the hint anyway.

Oliver
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 08, 2013 03:53AM
Sorry: .22µF

But as I said, it was my mistake smiling smiley
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 08, 2013 06:53AM
Quote

I only connected the programmer to the board and my (Windows 7) laptop, but no external power source for the Gen7 board.

At least my programmer doesn't provide 5V, so I have to attach the power supply. Even without the PSU the Standby LED lights up a bit, though, due to whatever reasons.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 13, 2013 11:11AM
The Diamex programmer can also provide 5V to the board, the yellow LED lights up noticeably. No difference in behavior, though.

Oliver
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 14, 2013 07:31AM
Quote

Device signature = 0x1e0f02

This doesn't make sense, to my research there is no ATmega with this signature. Usually I recommend avoiding the -F flag, but this time it might be the right solution to get the chip running again.

Not sure which signature the bootloader will report in this case, the built-in one (which is correct then) or the one hardwired in the chip (which is apparently messed up). In the former case, uploading a firmware via bootloader would be just normal, in the latter case -F would be required for every firmware upload, too.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Uploading bootloader to ATmega1284P in Gen7 1.4.1 board
February 17, 2013 10:14AM
OK, using a fresh 1284P and switching on the Diamex power supply mode, it seems to work fine, no error messages except the expected verification error.

Now on to the next steps ...

Oliver
Sorry, only registered users may post in this forum.

Click here to login