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

USB HID Using LPC1768- (Part 18/21)

By Prabakaran P.M

This is the article to explain the implementation of Human Interface device(HID) in the USB module of the LPC1768. For setting up the Environment for the development of ARM cortex M3 is well discussed in this article.

The LPC 1768 is ARM Cortex- M3 based Microcontrollers for embedded application features in low power consumption and a high level of integration. The ARM Cortex M3 is designed in a such way to enhance debug features and a higher level of system integration. It clocks at a CPU frequency of 100 MHz, and incorporates a 3-stage pipeline and uses a Harvard architecture with separate local instruction and data buses for third bus peripherals. The ARM Cortex- M3 CPU have an internal pre-fetch unit to support speculative branching. The peripheral components include 512KB of flash memory, 64kb of data memory, Ethernet MAC, USB OTG, 4 UART’s, 8-channel general purpose DMA controller, 2 SSP Controllers, 10-bit DAC, Quadrature encoder interface, SPI interface, 3 I2C bus interface, 2 input plus 2 outputs I2S bus interface, 4 general purpose timers, ultra-low power Real-Time Clock (RTC) with separate battery supply, and up to 70 general purpose I/O pins, 6-output general purpose PWM. The LPC1768/66/65/64 is pin-compatible with the 100-pin LPC236x ARM7-based Microcontroller series.


This USB example project implements a HID (Human Interface Device) that connects via the USB interface to the PC. This does not require any special USB driver, since the support is already built into Windows or Linux. The Human Interface Device (HID) program allows the LPC1768 to act as a Windows HID while attached to your PC using a USB interface. With this program and the HIDClient.exe program, you can:

  • Control the LEDs connected to the LPC1768.

  • Respond to presses of the button connected to the LPC1768.

USB:

Universal serial Bus (USB), a connection technology for attaching peripheral devices to a computer, providing fast data exchange. USB connects more than computers and peripherals. USB gives you a single, standardized, easy-to-use way to connect up to 127 devices to a computer.

Interfacing USB:

Below figure shows how to interface the USB to microcontroller. The USB is a 4 wire bus that supports communication between a host and a number (127 max.) of peripherals. In USB data cable Data+ and Data- signals are transmitted on a twisted pair. No termination needed. Half-duplex differential signaling helps to combat the effects of electromagnetic noise on longer lines. Contrary to popular belief, D+ and D- operate together; they are not separate simplex connections.

Block Diagram Of USb HID Interfacing Microcontroller

Fig. 1: Block Diagram Of USb HID Interfacing Microcontroller

Interfacing USB with LPC2148:

The LPC1768 controller enables 12 Mb/s data exchange with a USB host controller. It consists of register interface, serial interface engine, endpoint buffer memory and DMA controller. The input, output signals and a USB Bus are used to connect with controller. The LPC2148 controller read the USB voltage as power supply for controlling peripherals without having an external voltage. The LPC1768 USB takes supply voltage either from USB or external power supply by using a Jumper connection.

Circuit Diagram to Interface USB 2.0 with LPC1768:

Circuit Diagram to Interface USB 2.0 HID with LPC1768

Fig. 2: Circuit Diagram To Interface USB 2.0 HID With LPC1768

Create a project using Keil uvision4 for LPC1768 Microcontroller:

In this section, we will start creating a project in Keil MDK we have already installed Keil µVision and Co-MDK Plug-in + CoLinkEx Drivers required for the CoLinkEx programming adapter. You can start by downloading the project files and kick start your practical experiment.

To build this example, first download and extract the quick start code base.

After downloading, upload the program to the LPC1768 Board, follow these steps to run the program.

Installing the USBHID Device:

  1. Disconnect the USB power cable from the board.

  2. Wait 10 seconds.

  3. Re-connect the USB power cable to the board.

The Windows operating system displays a “Found New Hardware” message, but you don’t have to load any special drivers. Because support is built into Windows or Linux, HIDs do not require a custom USB driver.

  1. Review the status of the USB Controllers using the Device Manager.

  2. Right click on My Computer to open the System Properties – Hardware dialog.

  3. Then click on Device Manager.

  4. Right-click on the USB Human Interface Device to open the Properties dialog which contains the description and status of the HID device.

Installing the Application:

After installing the HID device, install the USB Client application.

  • Open the extracted folder.

  • Double click on HIDClient.EXE.

  • Select the Device: NXP LPC17XX USB HID from the drop-down list.

Installing NXP LPC17XX USB HID Client application for HID Interface with LPC1768

Fig. 3: Installing NXP LPC17XX USB HID Client Application For HID Interface With LPC1768

Running the HID Device:

The Inputs (Buttons) and Output (LEDs) groups represent the data input and output from the LPC1768 Board. 

Running the HID Device

Fig. 4: Running The HID Device

  • Checking of the box in the Inputs (Buttons) group acts as pressing the buttons, and unchecking the box releases the button (clears the 0 bit).

  • Checking or unchecking the boxes in the Output (LEDs) group turns the LEDs connected to the LPC1768 on and off, respectively.

Unchecked Buttons in HID Interface

Fig. 5: Unchecked Buttons In HID Interface

Project Source Code

###
 
The codes are linked in Description ###

Circuit Diagrams

CIrcuit-Diagram-of-USB-HID-Using-LPC1768

Project Video


Filed Under: ARM

 

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

  • What are the battery-selection criteria for low-power design?
  • 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)

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

  • Unusual gap shape of ETD59 ferrite core?
  • Vco cadencd
  • WH-LTE-7S1 GSM module and SIM card problem
  • Effect of variable gain amplifier and LNA on the input RF signal's phase
  • Pic 16f877A Hex file

RSS Electro-Tech-Online.com Discussions

  • HV Diodes
  • Very logical explanation on low calue C3
  • intro to PI
  • Need help working with or replacing a ferrite tube
  • Help wanted to power an AC120v induction motor ( edited from Brushless motor - thank you @SHORTBUS= )
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