User Tools

Site Tools


products:atmega32u4breakout:index.html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
products:atmega32u4breakout:index.html [2011/10/28 21:16]
ladyada [Restart and test]
products:atmega32u4breakout:index.html [2016/01/28 18:05]
127.0.0.1 external edit
Line 18: Line 18:
   * ...a larger reset button   * ...a larger reset button
   * ...all the pins broken out for use with a breadboard   * ...all the pins broken out for use with a breadboard
-  * ...as of October 28, 2011 all boards come with an Arduino 1.0 "​Leonardo" ​bootloader ​**but** the silkscreen does not have the Arduino pins labeled+  * ...open source ​bootloader ​that works with AVRdude
  
 That doesn'​t in any way mean that it is better or replaces the Teensy. Here are some reasons we will still use the teensy for many projects That doesn'​t in any way mean that it is better or replaces the Teensy. Here are some reasons we will still use the teensy for many projects
Line 54: Line 54:
 There is a 3V pin from the microcontroller'​s internal regulator (USB signals are at 3V) you can use this for maybe 10mA or so, it might work as a reference voltage) There is a 3V pin from the microcontroller'​s internal regulator (USB signals are at 3V) you can use this for maybe 10mA or so, it might work as a reference voltage)
  
-===== Newer Leonardo Bootloader ​=====+===== Pinout ​=====
  
-Shipments after Oct 282011 have the newer **leonardo** bootloader This bootloader ​is new and experimental but seems to work wellIt does not use the BOOT LED to indicate it is active (we'll try to modify the bootloader to use the LED once we've determined it works well) +Pins are labeled on the silkscreenbut for additional information,​ Johngineer has created [[http://​www.adafruit.com/​datasheets/​af_at32u4bb_pinout.pdf|a nice pinout diagram]] that is helpful for using this board.
  
-You can enter the bootloader by pressing the RESET button. The board will then show up as a Serial or COM port, and you can use **avrdude** to program it. The '​programmer name' is **stk500v1** or **arduino** so for example, to test you should run **avrdude -p m32u4 -P COM3 -c stk500v1** which will initialize the bootloader.+{{ :​products:​atmega32u4breakout:​8255357374_9f76b8de8a_o.png?500 |}} 
 +===== AVR109 Bootloader =====
  
-The bootloader will time out eventually (after about 3 seconds) +You can tell the bootloader is active when the **green '​Boot'​ LED pulses/​breathes** The board will then show up as a Serial or COM port, and you can use **avrdude** to program it. The '​programmer name' is **avr109** so for example, to test you should run **avrdude -p m32u4 -P COM3 -c avr109** which will initialize the bootloader.
-Because we are not using a USB/serial converter, bootloading is tremendously fast, we can program a full chip in under 2 seconds! +
- +
-The bootloader will 'auto reset' when used with Arduino 1.0 so you don't have to press the button anymore. The bootloader source code is in the Arduino 1.0 download (in the hardware bootloaders folder called "​DiskLoader"​). You can auto-reset the board yourself by connecting to it at 1200 baud and then closing the port which signals you want to jump to the bootloader. +
- +
-The bootloader takes up the last 2K of FLASH, so be aware that you will only have 30K instead of 32K. We have found that this isn't very constricting as 30K is still plenty. If you'd like more space, you can always use the 6-pin ISP connector and an AVR programmer (which will delete the bootloader) +
- +
-If you're using windows, you will need an **inf** driver file, you can download it below (in the **Downloads** section) +
- +
- +
-===== Older Bootloader ===== +
- +
-Shipments before Oct 28, 2011 have the older **avr109** bootloader. ​You can tell the bootloader is active when the **green '​Boot'​ LED pulses/​breathes** The board will then show up as a Serial or COM port, and you can use **avrdude** to program it. The '​programmer name' is **avr109** so for example, to test you should run **avrdude -p m32u4 -P COM3 -c avr109** which will initialize the bootloader.+
  
 {{  :​products:​atmega32u4breakout:​avr109.gif ​ |}} {{  :​products:​atmega32u4breakout:​avr109.gif ​ |}}
Line 88: Line 77:
 ===== USB Development ===== ===== USB Development =====
  
-The very nice thing about this chip is the USB core built in which makes USB-device development easy. What makes it even easier & better is [[http://​www.fourwalledcubicle.com/​LUFA.php|the full USB stack already written for you by Dean Camera]]. Called [[http://​www.fourwalledcubicle.com/​LUFA.php|"​LUFA"​]],​ the package comes with tons of working examples for all sorts of USB devices and its compeltely ​open source. We use the firmware as a '​starting point' which we then expand upon. Please check it out and if you find it useful consider donating time (fixing bugs, improving documentation) or funds to Dean.+The very nice thing about this chip is the USB core built in which makes USB-device development easy. What makes it even easier & better is [[http://​www.fourwalledcubicle.com/​LUFA.php|the full USB stack already written for you by Dean Camera]]. Called [[http://​www.fourwalledcubicle.com/​LUFA.php|"​LUFA"​]],​ the package comes with tons of working examples for all sorts of USB devices and its completely ​open source. We use the firmware as a '​starting point' which we then expand upon. Please check it out and if you find it useful consider donating time (fixing bugs, improving documentation) or funds to Dean. 
  
 ====== Using Teensyduino ====== ====== Using Teensyduino ======
  
- +Teensyduino is no longer suggestedif you want to use it with an AVR109 bootloader board[[http://www.ladyada.net/wiki/products/atmega32u4breakout/index.html?rev=1302835337|we have some hints here in the wiki]]
-===== Edit Boards.txt ===== +
-  +
-We'll need to tell the IDE about this breakout board. Open up **Arduino IDE/​hardware/​teensy/​boards.txt** +
- +
-Add the following text to the end of the filesave it +
- +
-<​file>​adafruit.name=Atmega32u4 breakout +
-adafruit.upload.protocol=avr109 +
-adafruit.upload.maximum_size=28672 +
-adafruit.upload.speed=57600 +
-adafruit.upload.disable_flushing=true +
-#​adafruit.serial.restart_cmd=true +
-adafruit.serial.safe_baud_rates_only=true +
-adafruit.upload.avrdude_wrapper=avrdude +
-adafruit.build.mcu=atmega32u4 +
-adafruit.build.core=teensy +
-#​adafruit.build.post_compile_script=teensy_post_compile +
-adafruit.build.serial_number=true +
-adafruit.menulist=usbtype,​cpuspeed +
-adafruit.menu.usbtype.title=USB Type +
-adafruit.menu.usbtype.name0=Serial +
-adafruit.menu.usbtype.name1=Keyboard + Mouse +
-adafruit.menu.usbtype.name2=Disk(Internal) + Keyboard +
-adafruit.menu.usbtype.name3=Disk(SD Card) + Keyboard +
-adafruit.menu.usbtype.define0=-DUSB_SERIAL +
-adafruit.menu.usbtype.define1=-DUSB_HID +
-adafruit.menu.usbtype.define2=-DUSB_DISK +
-adafruit.menu.usbtype.define3=-DUSB_DISK_SDFLASH +
-adafruit.menu.usbtype.pref1.fake_serial=teensy_gateway +
-adafruit.menu.usbtype.pref2.fake_serial=teensy_gateway +
-adafruit.menu.usbtype.pref2.build.elfpatch=mktinyfat +
-adafruit.menu.usbtype.pref3.fake_serial=teensy_gateway +
-adafruit.menu.cpuspeed.title=CPU Speed +
-adafruit.menu.cpuspeed.name0=16 MHz +
-adafruit.menu.cpuspeed.name1=8 MHz +
-adafruit.menu.cpuspeed.name2=4 MHz +
-adafruit.menu.cpuspeed.name3=2 MHz +
-adafruit.menu.cpuspeed.name4=1 MHz +
-adafruit.menu.cpuspeed.pref0.build.f_cpu=16000000L +
-adafruit.menu.cpuspeed.pref1.build.f_cpu=8000000L +
-adafruit.menu.cpuspeed.pref2.build.f_cpu=4000000L +
-adafruit.menu.cpuspeed.pref3.build.f_cpu=2000000L +
-adafruit.menu.cpuspeed.pref4.build.f_cpu=1000000L +
-</​file>​ +
- +
-===== Fix avrdude and avrdude.conf ===== +
- +
-Arduino uses a **really** old version of Avrdude from 2007, before the chip existed. So we'll need to update ​it+
- +
-Download the following zip file  +
-{{:​products:​atmega32u4breakout:​avrdude510.zip|AVRDUDE 5.10 (windows)}} +
-and uncompress it. Copy **avrdude.exe** to **ArduinoIDE/​hardware/​tools/​avr/​bin** and **avrdude.conf** to **ArduinoIDE/​hardware/​tools/​avr/​etc** +
- +
-If you're using Linux or Mac, just copy the **avrdude.conf** file +
- +
-===== Update the Vendor ID ===== +
- +
-Open the file **Arduino\hardware\teensy\cores\usb_serial\usb_private.h** and find the lines +
- +
-<​file>​ +
-// Mac OS-X and Linux automatically load the correct drivers. ​ On +
-// Windows, even though the driver is supplied by Microsoft, ​an +
-// INF file is needed to load the driver. ​ These numbers need to +
-// match the INF file. +
-#define VENDOR_ID ​              ​0x16C0 +
-#define PRODUCT_ID ​             0x0483 +
-</​file>​ +
- +
-and change it to +
- +
-<​file>​ +
-// Mac OS-X and Linux automatically load the correct drivers. ​ On +
-// Windowseven though the driver is supplied by Microsoft, an +
-// INF file is needed to load the driver These numbers need to +
-// match the INF file. +
-#define VENDOR_ID ​              ​0x239A +
-#define PRODUCT_ID ​             0x0001 +
-</file> +
- +
-===== Update the USB descriptor ===== +
-Open up ArduinoIDE/Hardware/Teensy/cores/​usb_serial/​usb.+
- +
-and change the text starting with **static uint8_t PROGMEM device_descriptor[] ​{** to the following +
- +
-<​file>​ +
-static uint8_t PROGMEM device_descriptor[= { +
- 18, // bLength +
- 1, // bDescriptorType +
- 0x01, 0x01, // bcdUSB +
- 2, // bDeviceClass +
- 0, // bDeviceSubClass +
- 0, // bDeviceProtocol +
- ENDPOINT0_SIZE,​ //​ bMaxPacketSize0 +
- LSB(VENDOR_ID),​ MSB(VENDOR_ID),​ //​ idVendor +
- LSB(PRODUCT_ID),​ MSB(PRODUCT_ID),​ //​ idProduct +
- 0x00, 0x01, // bcdDevice +
- 0, // iManufacturer +
- 1, // iProduct +
- 0, // iSerialNumber +
- 1 // bNumConfigurations +
-}; +
-</​file>​ +
- +
 ====== Download ====== ====== Download ======
  
-  * [[http://​www.adafruit.com/​datasheets/​atmega32u4cdc.inf|Bootloader INF file for windows (mac/linux don't need a driver)]]+  * [[http://​www.adafruit.com/​datasheets/​atmega32u4cdc.inf|Bootloader INF file for the AVR109 ​windows (mac/linux don't need a driver)]]
   * [[http://​github.com/​adafruit/​Atmega32u4-Breakout-Board|Schematic and Board layout files]]   * [[http://​github.com/​adafruit/​Atmega32u4-Breakout-Board|Schematic and Board layout files]]
   * [[http://​github.com/​adafruit/​Atmega32u4-Breakout-Board/​raw/​master/​atmega32u4bbsch.png|Schematic in PNG format]]   * [[http://​github.com/​adafruit/​Atmega32u4-Breakout-Board/​raw/​master/​atmega32u4bbsch.png|Schematic in PNG format]]
   * [[http://​www.fourwalledcubicle.com/​LUFA.php|The LUFA USB-stack website]]   * [[http://​www.fourwalledcubicle.com/​LUFA.php|The LUFA USB-stack website]]
-  * [[http://​github.com/​adafruit/​lufa-lib|Our minor fork to the LUFA core]] - this is where our bootloader lives (in Bootloaders/​CDC) +  * [[http://​github.com/​adafruit/​lufa-lib|Our minor fork to the LUFA core]] - this is where our AVR109 ​bootloader lives (in Bootloaders/​CDC) 
-  * [[http://pjrc.com/teensy/teensyduino.html|Teensyduino from PJRC]]+ 
 +====== Further reading ====== 
 + 
 +  * Buy it through the "Buy it!" link at http://​www.ladyada.net/​products/​atmega32u4breakout/​ , which is mostly autogenerated from http://​ladyada.net/​wiki/​products/​atmega32u4breakout/​index.html . 
 +  * Ladyada'​s ATMEGA32U4 Breakout board+ has better mounting holes and is more breadboard-friendly than Sparkfun'​s ​[[https://www.sparkfun.com/products/11117 | ATMEGA32U4 Breakout]]. 
 +  * Ladyada'​s ATMEGA32U4 Breakout board+ is used in the [[tutorials:​make:​ledbelt:​index.html | Programmable LED belt]] and [[http://​learn.adafruit.com/​gps-dog-collar/​code | the GPS Dog Collar ]] 
 +  * Linux users: [[http://​forums.adafruit.com/​viewtopic.php?​f=24&​t=23266 | How to get started with the Atmega32u4 Breakout Board+ on Linux]] 
 +  * [[http://​forums.adafruit.com/​viewtopic.php?​f=19&​t=43801 | "​atmega32u4 BB driver install"​ ]] 
 +  * [[http://​forums.adafruit.com/​viewtopic.php?​f=25&​t=43404 | "​Atmega32u4 Breakout Board with Arduino IDE"​]] 
 +  * [[http://​forums.adafruit.com/​viewtopic.php?​f=22&​t=42025 | "​Mounting Atmega32u4 Breakout Board, screw size question"​ ]]: like most Adafruit PCBs, the Atmega32u4 Breakout board+ has mounting holes for M2 screws. That's about a #1 or #2 in UNC/UNF terms. 
 +  * [[http://​forums.adafruit.com/​viewtopic.php?​f=19&​t=24723 | "​Atmega32u4 Breakout Board Leonardo blink"​]] 
 +  * [[http://​forums.adafruit.com/​viewtopic.php?​f=22&​t=28330 "​Atmega32u4 Breakout+ digital and analog I/O"]] has some details on the ICSP header that maybe we should copy to this wiki page. 
 +  * [[http://​www.adafruit.com/​category/​92 | The Flora]], the Leonardo board, and the Esplora board, all use the same Atmega32U4 AVR microcontroller as this breakout. 
 +  * [[http://​forums.adafruit.com/​viewtopic.php?​f=47&​t=40729 | "​ATMEGA32U4 pin mapping"​ ]] attempts to clear up some of the confusion between the text written on the Atmega32u4 Breakout board+ (the official Atmel Port+pin letter+number),​ the physical pin numbers of the package, and the "​Arduino pin numbers"​ (a third completely different way of referring to the same pin).
  
/home/ladyada/public_html/wiki/data/pages/products/atmega32u4breakout/index.html.txt · Last modified: 2016/02/09 22:46 by ladyada