Leonardo with ATMEGA16U4

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
customdev
 
Posts: 19
Joined: Fri Feb 25, 2011 12:06 pm

Leonardo with ATMEGA16U4

Post by customdev »

I have been trying to add a board to the Arduino IDE that is physically identical to the Leonardo, but instead of using an ATMEGA32U4 it uses and ATMEGA16U4. I created the board.txt file as well as I added the 16U4 entries to the avrdude.conf file, but no luck I keep on getting an error and I cannot burn the program (I am downloading direct using a USBTinyISP, without the bootloader). Any help on this subject will be greatly appreciated.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Leonardo with ATMEGA16U4

Post by adafruit_support_mike »

You may be running into a factory defaults problem: apparently the ATmega16u4 ships with its lock bits set.

This page has more information, along with a part definition you can add to avrdude.conf:

http://www.dgkelectronics.com/adding-su ... the-fuses/

User avatar
customdev
 
Posts: 19
Joined: Fri Feb 25, 2011 12:06 pm

Re: Leonardo with ATMEGA16U4

Post by customdev »

Actually, I have not even gotten to that point, during compilation I get:
unknown MCU 'atmega16u4' specified
Known MCU names:
avr2
at90s2313
at90s2323
at90s2333
at90s2343...

I have already added the boards.txt file to my hardware folder so that I can select that configuration and I have added the definition for the ATMEGA16U4 to the avrdude config file

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Leonardo with ATMEGA16U4

Post by adafruit_support_mike »

What are the exact input and output when you try to program? What command do you enter, and what error messages do you get?

User avatar
customdev
 
Posts: 19
Joined: Fri Feb 25, 2011 12:06 pm

Re: Leonardo with ATMEGA16U4

Post by customdev »

When I press the "Check Compilation" button on the Arduino IDE I get the message on the posting above, just with a longer list of devices.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Leonardo with ATMEGA16U4

Post by adafruit_support_mike »

Scroll down through the list of responses and see if you find something that looks like 'ATmega16u4'. It's possible that this could be something as simple-but-hard-to-see as a typo.

User avatar
customdev
 
Posts: 19
Joined: Fri Feb 25, 2011 12:06 pm

Re: Leonardo with ATMEGA16U4

Post by customdev »

The Atmega16U4 is not part of the list, is there a place where you can list this devices?
I don't believe it is a typo, I have already re-checked. When you add a microcontroller to the Arduino IDE besides the boards.txt and the configuration on the avrdude.comf what else has to be done?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Leonardo with ATMEGA16U4

Post by adafruit_support_mike »

In the folder where your 'boards.txt' file lives, there should be another folder named 'variants'.

Inside that will be a set of folders whose names match the '[board name].build.mcu=[microcontroller]' lines in 'boards.txt'. In each of those will be a file named 'pins_arduino.h' that maps the physical pins on the chip to pin numbers in the Arduino libraries.

You'll need a variant folder named 'atmega16u4' (or whatever you put in the xxx.build.mcu=xxx line) with a header file for that chip.

User avatar
customdev
 
Posts: 19
Joined: Fri Feb 25, 2011 12:06 pm

Re: Leonardo with ATMEGA16U4

Post by customdev »

Thanks for you help, but after adding the folders and the pins_arduino.h file I am still getting the same error, is there any other place for the mcu to be listed?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Leonardo with ATMEGA16U4

Post by adafruit_support_mike »

At this point you're pretty much at my limit for modding the Arduino IDE. You'll probably need to check over in the Arduino forums for more information:

http://forum.arduino.cc/

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”