Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Prerequisite

By Arpit jain

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

 

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.

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!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)
  • An Embedded Developer’s Perspective on IOT (Internet of Things)

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Dynamic power consumption.
  • Limits of duty cycle for ICM7555 IC?
  • pmos folded cascode vs nmos folded cascode for LDO
  • Pic 16f877A Hex file
  • Need help to choose accelerometer

RSS Electro-Tech-Online.com Discussions

  • Need help working with or replacing a ferrite tube
  • Help wanted to power an AC120v induction motor ( edited from Brushless motor - thank you @SHORTBUS= )
  • Funny Images Thread!
  • How does a NOAC work?
  • How to designing a battery charging indicator circuit for 18650 battery pack
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering