Leonardo with ATMEGA16U4
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- customdev
- Posts: 19
- Joined: Fri Feb 25, 2011 12:06 pm
Leonardo with ATMEGA16U4
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.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Leonardo with ATMEGA16U4
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/
This page has more information, along with a part definition you can add to avrdude.conf:
http://www.dgkelectronics.com/adding-su ... the-fuses/
- customdev
- Posts: 19
- Joined: Fri Feb 25, 2011 12:06 pm
Re: Leonardo with ATMEGA16U4
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
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
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Leonardo with ATMEGA16U4
What are the exact input and output when you try to program? What command do you enter, and what error messages do you get?
- customdev
- Posts: 19
- Joined: Fri Feb 25, 2011 12:06 pm
Re: Leonardo with ATMEGA16U4
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.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Leonardo with ATMEGA16U4
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.
- customdev
- Posts: 19
- Joined: Fri Feb 25, 2011 12:06 pm
Re: Leonardo with ATMEGA16U4
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?
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?
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Leonardo with ATMEGA16U4
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.
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.
- customdev
- Posts: 19
- Joined: Fri Feb 25, 2011 12:06 pm
Re: Leonardo with ATMEGA16U4
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?
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Leonardo with ATMEGA16U4
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/
http://forum.arduino.cc/
Please be positive and constructive with your questions and comments.