Skip to main content
  • Products
  • Evaluate our Software
  • Downloads
  • Free Utilities
  • Purchase
  • Support
  • About Us
  • Blog
  • Forum
  • Search
    • Contact Us
    • Forum
    • Wiki
    • Web Shop
    • Newsletter
    • RSS
  •   Jobs
  •   Videos
  •   Blog
  •   Sustainability
  • emUSB-Host
  • Samples
  • Technology
  • Add-Ons
  • Accessories
emUSB Host Product Icon SEGGER (Blue)

emUSB-Host Samples - Take a Look

Barcode Scanner

example scan

General Information:

Connecting a barcode scanner to a target device is an easy task when using emUSB-Host. Most barcode scanners are simple HID devices that are supported out of the box.

These scanners behave like a keyboard. Each time a barcode is scanned, the scanner translates the code into a series of key presses and releases. So scanning a barcode indicating www.segger.com

SEGGER barcode scanner

sends a sequence of key pressed and key released for each character. The sample USBH_HID_Start can visualize this:

'w'-key is pressed, 'w' is released
'w'-key is pressed, 'w' is released
'w'-key is pressed, 'w' is released
'.'-key is pressed, '.' is released
's'-key is pressed, 's' is released
'e'-key is pressed, 'e' is released
'g'-key is pressed, 'g' is released
'g'-key is pressed, 'g' is released
'e'-key is pressed, 'e' is released
'r'-key is pressed, 'r' is released
'.'-key is pressed, '.' is released
'c'-key is pressed, 'c' is released
'o'-key is pressed, 'o' is released
'm'-key is pressed, 'm' is released
'Enter'-key is pressed, 'Enter' is released

Using the USBH_HID_Keyboard sample project will display the following output:

The following text was entered: www.segger.com

The output can be seen in the Terminal window of a debugger such as Ozone, the Terminal Window of an IDE such as Embedded Studio or in J-Link RTT Viewer.

Download sample project for
STM32F746-DISCO Board

Download sample project for
emPower-USB-Host board

emPower USB Host

Text Display for PoS Systems

example display

General Information:

POS Displays are available in different configurations. Those can be connected via RS232, RS484 or SPI but also via USB, in normal cases which will be recognized as either a CDC-ACM device (USB-to-UART) or a FTDI device.
Even though they use different connectors they all have in common that they support either a common command set and/or a vendor command set to output data on the display. One of the common used ones is ESC/POS which allows to send special commands such as initialize or put the following line on second line.

Displays with a USB interface are the easiest one as they allow plug'n'play, does not need to be parameterized (UART speed, parity, data bits etc) and in case of a failure it can be replaced while the system is running.

Connecting such a target device where emUSB-Host with the CDC component and FT232 component enabled is running is very simple.
Using the USBH_TERM_API a POS display is detected automatically and can easily used to display text.

A simple application could be look like the following:

  USBH_TERM_Init();

  USBH_TERM_Print(0, 0, "     SEGGER     ");
  USBH_TERM_Print(1, 0, "It simply works!");

The following POS terminals are known to work with this sample:

  • PartnerTech CD-7220-UN POS Display
  • Tipro POS terminal
  • EPSON M58DC (DM-D110)
  • Wincor Nixdorf BA63 USB

Download sample project for
STM32F746-DISCO Board

Download sample project for
emPower-USB-Host board

emPower USB Host

4G/LTE Data USB Stick

usb stick cdc

General Information:

4G/3G sticks are quite handy as they enable connections to the internet by simply plugging such a device into a PC, install the driver, and configure the device. Current LTE/4G sticks are connected just like a USB-to-Ethernet Adapter not requiring configuration at all.

Having a target system with emUSB-Host with the LAN component and emNet allows you to use such a 4G stick. Currently the Huawei E3372-H is supported and with some little modification in one single file other 4G sticks will work.

In order to use the Huawei stick, please note, that a SIM card without PIN verification is necessary in order to connect automatically to Internet.

Download sample project for
STM32F746-DISCO Board

Download sample project for
emPower-USB-Host board

emPower USB Host

Ethernet-over-USB adapter

USB 2 Ethernet Adapter

General Information:

Ethernet-over-USB adapters can be used to extend your embedded system with network connectivity.

Internally Ethernet-over-USB adapters use different protocols, depending on the vendor or model of the device. CDC-ECM or protocols from the company ASIX are most common in Ethernet-over-USB adapters, Android phones often use RNDIS to communicate. emUSB-Host LAN supports all these protocols.

The demo is configured with a webserver, after programming the device and connecting it to your local network via an Ethernet-over-USB adapter you can use the URL "http://usbh.local" to open the web server demo.

Download sample project for
STM32F746-DISCO Board

Download sample project for
emPower-USB-Host board

emPower USB Host

MIDI

emUSB-Host MIDI playing a MIDI sequence on a synthesizer

General Information:

The MIDI protocol is designed to communicate with various audio and stage equipment.

The demo package contains two demo applications.

The first application (MIDI_Player) plays a static MIDI file on a connected synthesizer or sound module. If a display is available on the eval board a keyboard is displayed which shows the individual keys pressed.
The lyrics contained in the static MIDI file are also shown on the display.

The second application (MIDI_HID) allows a regular PC keyboard to be used to send MIDI events to all connected MIDI devices. As such it is possible to play notes on MIDI devices which can produce sound or control the LEDs of a MIDI sequencer via a regular PC keyboard.

The following MIDI devices have been tested with these samples:

  • Roland Juni-DS 63
  • Roland Juno DS-61
  • Roland TD-3
  • Roland TD-20
  • Native Instruments Komplete Kontrol S61 Mk 2
  • Native Instruments Komplete Kontrol A25
  • M-Audio Keystation 61ES
  • Tapco link.MIDI 4x4
  • Akai Discover DJ
  • Vestax Spin
  • Korg Electribe ER1
  • Alesis DM5
  • Alesis Performance Pad
  • Boss DB-90

Download sample project for
STM32F746-DISCO Board

Download sample project for
emPower-USB-Host board

emPower USB Host

AUDIO

USB Speaking

General Information:

The AUDIO protocol is designed to communicate with various audio devices.

The demo package contains two demo applications.

The first application (AUDIO_Speaker) plays a voice via a connected USB speaker. If additionally a USB memory stick is connected, that contains an audio file (extension ".wav"), the audio file is played. The audio file must be in WAV format, 16 bit PCM, stereo. The sample frequency of the WAV file must match a sample frequency supported by the USB speaker.

The second application (AUDIO_Microphone) reads audio data from an input device (like a microphone) and outputs a line of '#' characters in the debug terminal every 20 ms. The length of that line depends on the volume of the audio sound, which makes the volume visible.

Download sample project for
emPower-USB-Host board

emPower USB Host

More Information

Purchase

  • Pricing

Technology

  • Drivers
  • Performance
  • Quality Assurance
  • Resource usage
  • Samples
  • On-The-Go

Add-Ons

  • Audio Class
  • CCID Class
  • CDC Class
  • CP210x
  • FTDI UART
  • HID Class
  • LAN
  • MIDI Class
  • MSD Class
  • MTP Class
  • Printer Class
  • Vendor Class
  • Video Class

Accessories

  • emPower-USB-Host

About us

  • The Company
  • Partners
  • Job Offers
  • Media
  • Contact us

Support

  • Technical Support
  • Blog
  • Forum
  • Wiki

Downloads

  • Application Notes
  • Embedded Studio
  • embOS
  • emCompress
  • emCrypt
  • emFile
  • emLib
  • emLoad
  • emModbus
  • emNet
  • emPower
  • emSecure
  • emSSH
  • emSSL
  • emUSB-Device
  • emUSB-Host
  • emVNC
  • emWin
  • Flasher
  • Free Utilities
  • IoT
  • J-Link / J-Trace
  • Linux Studio
  • SystemView
  • CE / REACH

Social Media

Headquarters

SEGGER Microcontroller GmbH

Ecolab-Allee 5
40789 Monheim am Rhein, Germany
info@segger.com
Tel.: +49-2173-99312-0
Fax: +49-2173-99312-28

Locations

USA: SEGGER Microcontroller Systems LLC

Boston area
101 Suffolk Lane
Gardner, MA 01440, USA
us-east@segger.com
Tel.: +1-978-874-0299
Fax: +1-978-874-0599

Silicon Valley
Milpitas, CA 95035, USA
us-west@segger.com
Tel.: +1-408-767-4068

China: SEGGER Microcontroller China Co., Ltd.

Room 218, Block A, Dahongqiaoguoji
No. 133 Xiulian Road
Minhang District, Shanghai 201199, China
china@segger.com
Tel.: +86-133-619-907-60

ISO 9001 certified

ISO 9001

30+ years of experience

First-class embedded software tools since 1992
  • Imprint
  • Disclaimer
  • Privacy Policy

© 2023 SEGGER - All rights reserved.