Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Prerequisite

By Arpit jain April 21, 2008

Prerequisite
 
This article provides helpful information that will be used in article series of Atmega32u4 USB applications. Please refer the below topics when required in the articles.
 
Basics of LUFA
 
What is LUFA?
 
LUFA stands for Lightweight USB Framework for AVRs. It is an open source framework for building USB applications using Atmel USB AVR microcontrollers. It uses the AVR-GCC compilers for the compiling the source code firmware. It supports the following Atmel microcontrollers that contain USB:
 
• 8-bit AVR
• 32-bit AVR
• XMEGA AVR
 
The LUFA can be used to design USB based devices using Atmel controllers. It is a great tool to add USB protocol in project development.
More detail resources about LUFA can be found at http://www.fourwalledcubicle.com/LUFA.php
 
The LUFA can be downloaded from Github.
 
https://github.com/abcminiuser/lufa
 
PID/VID, Manufacture Name and Product Name
 
The Descriptors.c contains the definitions for the Device Descriptor, Configuration Descriptor, Interface Descriptor, Endpoint Descriptor and String Descriptor. The PID/VID, Manufacture String and Product String are declared in this file.
 
The PID and VID are declared inside the device descriptor. They can be found in Device Descriptor definition with declarations as below:
.VendorID = 0x03EB
.ProductID = 0x2041 
 
The Manufacture and Product name declarations can be found in the String Descriptors. The declarations will be like:
 
ManufacturerString = USB_STRING_DESCRIPTOR(L”Dean Camera”);
ProductString = USB_STRING_DESCRIPTOR(L”LUFA Mouse Demo”);
 
USAGE Report
 
The Usage Report for the HID class communications are defined inside the HIDClassCommon.h. 
 
The file is located at: LUFADriversUSBClassCommon
 
The file contains the following:
 
• Declarations for Keyboard Key codes, 
• Usage Report for Keyboard
• Usage Report for Mouse
• Usage Report for Joystick
• Data Report structure declaration for Mouse
• Data Report structure declaration for Keyboard
 
Compiling the firmware or source code
 
For compiling the source code, we will use WinAVR Programmers Notepad. The software can be downloaded from here https://sourceforge.net/projects/winavr/
 
Open the .c source file using Programmers Notepad and click on Tools -> Make All.
 
If the file is successfully complied with no error, the hex file will be created in the same folder.
 
Burning the Hex file
 
After generating the Hex file from the compilation, we need to transfer Hex code to Atmega32u4. For uploading the code we will use AVR Dude. If you are already using Arduino IDE in your desktop, then AVR Dude is already installed. It can also be downloaded from http://www.nongnu.org/avrdude/
 
Before using AVR Dude we need to check the COM port number at which Arduino Pro Micro is recognized as a bootloader. For checking the COM Port number, open the Device Manager, expand the Ports tab and then plug-in the Arduino using micro USB cable. After plugging the cable, reset the Arduino using Reset pin. The Arduino bootloader will be shown under Ports tab with a COM Port number. After some seconds, the Arduino Bootloader will be vanished from the Ports Tab. So the process of noting down the COM port number needs to be done after resetting the Arduino and before vanishing. The Arduino bootloader vanishes from the Ports Tab because Application firmware gets executed after bootloader section in microcontroller.
 
 

Project Source Code

 

Project Source Code

###

//Program to 

###

 



Filed Under: Electronic Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • connector model question
  • Color Laser printer, printing pcb layout on transparant sheet
  • Snooping Around is All
  • Industrial Relay Board Design for Motorcycle Use
  • Research on challenges in Analog Layout design

RSS Electro-Tech-Online.com Discussions

  • Faulty heat air gun (dc motor) - problem to locate fault due to Intermittent fault [unrepairable]
  • using a RTC in SF basic
  • Dismantling a WestinghouseRoku TV ?
  • Does US electric code allow branching ?
  • My Advanced Realistic Humanoid Robots Project

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • How IoT network topologies work
  • The top five AI startups to watch in 2025
  • STMicroelectronics unveils SoC based on secure MCU
  • Nexperia’s 48 V ESD diodes support higher data rates with ultra-low capacitance design
  • Taoglas releases Patriot antenna with 18 integrated elements covering 600 to 6000 MHz

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe