login

Author Topic: Bootloader Question: Custom board with Atmega644p, 8MHz crystal running at 3.3V  (Read 8135 times)

0 Members and 1 Guest are viewing this topic.

mkroll

Hello,
I want to create a custom Wiring Board, using the ATmega644p-20AU chip.
Now my question is which boot loader to I need to burn onto my chip?
I want to use an external crystal @ 8MHz.

Do I need to copy another board definition to the boards.txt file such as:

===
atm644p8MHz.name=ATmega644P(A) @ 8 MHz (internal)
atm644p8MHz.upload.protocol=wiring
atm644p8MHz.upload.maximum_size=63488
atm644p8MHz.upload.speed=57600
atm644p8MHz.bootloader.low_fuses=0xE2
atm644p8MHz.bootloader.high_fuses=0xD4
atm644p8MHz.bootloader.extended_fuses=0x05
atm644p8MHz.bootloader.path=
atm644p8MHz.bootloader.file=WiringBoot_ATmega644_8MHz.hex
atm644p8MHz.bootloader.unlock_bits=0x3F
atm644p8MHz.bootloader.lock_bits=0x2F
atm644p8MHz.build.mcu=atmega644p
atm644p8MHz.build.f_cpu=8000000L
atm644p8MHz.build.core=AVR8Bit
atm644p8MHz.build.hardware=ATmegaXX4P-PA
===

And modify the fuse settings accordingly or do I need to patch the boot loader source as well?

Thank you for your valuable input.
Cheers,
Michael.

bhagman

Yep.  :)

Nothing to change in the bootloader (i.e. just use the 8MHz version), and copy the boards.txt entry, using new fuse information (and that's only if you want to burn the bootloader from the IDE).

mkroll

Yes, I want to burn the boot loader from the IDE.
Where can I find a good description on how to change the fuses accordingly?

Thanks,
Michael.

mkroll

I found something on the web to calculate the fuses.
But since I'm very new to this fuse kind of thing, I think I need to modify the low fuses to use an external crystal.

How should this setting look like?

Thank you very much,
Michael.

bhagman

You can use the ATmega644P(A) datasheet to calculate the fuses, but it might be a little tedious.

I often just use the Atmel AVR Studio AVR Programmer tool - but you have to have that installed.

Here are the fuses for your configuration:

Code: [Select]
LOW = 0xFF
HIGH = 0xD4
EXTENDED = 0x05

mkroll

Thank you very much.
I was a little confused which Startup time to choose. So I will try the configuration you sent me tomorrow, after I received the missing capacitors for the crystal.

Kind Regards,
Michael.

bhagman

Yeah, the timings are probably pretty confusing, but unless you are working with something that requires REALLY quick start-ups, just pick the longest oscillator start-up time.

mkroll

I now added a custom board configuration to the boards.txt file.
When I choose this board and try to burn the boot loader I'm getting the following error from the IDE:

avrdude: WARNING: Programmer doesn't support extended parameters, -x option(s) ignored
avrdude was compiled without usb support.

The programmer I'm using is the AVRISP mkII
Do I need to upgrade the programmer?

Hmm... I tried to reflash the Original Wiring S board with a new boot loader, but I get the same error here.

I'm running the IDE on MacOSX 10.7.3


bhagman

yeah, this is an oversight in the bootloader burning function in the IDE.  The avrdude "-x" option is being added to all of the programmer types, when it is only intended for the WiringISP bootloader.  It'll be added as an issue.

For now, your best bet is to do the bootloader burn by command line using avrdude.

mkroll

Can I somehow dump the parameters which are passed by the IDE to avrdude?

barragan

Press the Shift key while doing the procedure for verbose output. Let me know.

mkroll

It makes no difference to call avrdude from the command line or the IDE to program the boot loader. BTW: I can't see -x options? Are they in .conf?
What about the missing usb support? "avrdude was compiled without usb support"

###

./avrdude -C/Applications/Wiring.app/Contents/Resources/Java/tools/avr/bin/avrdude.conf -v -v -v -v -patmega644p -cstk500v2 -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xD4:m -Ulfuse:w:0xFF:m -xsnooze=3000

avrdude: Version 5.11, compiled on Sep 15 2011 at 22:06:27
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Wiring.app/Contents/Resources/Java/tools/avr/bin/avrdude.conf"
         User configuration file is "/Users/michaelkroll/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

avrdude: WARNING: Programmer doesn't support extended parameters, -x option(s) ignored
         Using Port                    : usb
         Using Programmer              : stk500v2
avrdude was compiled without usb support.

avrdude done.  Thank you.

###

mkroll

Ok, I changed the command line to use the avrmkii accordingly:

./avrdude -C/Applications/Wiring.app/Contents/Resources/Java/tools/avr/bin/avrdude.conf -v -v -v -v -patmega644p -cavrispmkII -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xD4:m -Ulfuse:w:0xFF:m -xsnooze=3000

###


avrdude: Version 5.11, compiled on Sep 15 2011 at 22:06:27
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Wiring.app/Contents/Resources/Java/tools/avr/bin/avrdude.conf"
         User configuration file is "/Users/michaelkroll/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

avrdude: WARNING: Programmer doesn't support extended parameters, -x option(s) ignored
         Using Port                    : usb
         Using Programmer              : avrispmkII
avrdude was compiled without usb support.

avrdude done.  Thank you.

###

mkroll

Any ideas how to solve this? I connected my custom board to AVR Studio5 using the AVRMKII Programmer and the 644p is detected. So It seems that the wiring ok.

From the IDE, when I don't connect a serial FTDI connector and choose the correct serial port I only see the error: "Error while burning boot loader".

Are there any plans to release a new IDE Version where this bug is fixed?

Cheers,
Michael.

mkroll

Any Ideas how to get my bare 644p running?