Printer Friendly

Universal serial bus pulse width modulation interface.

Abstract: Result of my aim & device for managing any equipment via managing voltage. Device communicates via MIDI and USB protocols. At the output is pulse width modulation. Modulation value is given to value of the third byte in MIDI message. Value is sound power of operative note. There is device is connected as one of USB interfaces at the input. Device is connected to power transformation device on output. There are PWM managing devices connected as ending equipment. Paper describes one of the solutions by other authors, applied technologies for development and author hardware solution.

Key words: pulse width modulation, microchip, musical instrument digital interface, universal serial bus


Research target was to design simple, the most inexpensive, simply programmable high variable device. Variability was intended for various lights systems. At the current time usage of computers in music is standard how for live performance so for music recording. MIDI protocol is the most used for the live performance. It is basic for some setting of musical instruments on the stage. Important for design was real-time application. Accordingly zero MIDI USB transfer delay for live music performance. Simply put, visual effect must correspondence music performance in real-time. From the begging was evident that it will be one chip device with small requirements for voltage, maintenance and size. There is also a small percentage of failure as an additional criterion for the development of the equipment described below. Today, MIDI is a part of effect units for all music instruments, whether they are electric guitars, keyboards or some effects for singers or acoustic instruments.


Between existing solutions in this area at present belongs to the following applications

2.1 Harvey Twyman device

Harvey Twyman hardware module consists an integrated circuit HC11, produced by Motorola. This circuit sends MIDI messages to another device, which is Altera 8254 FPGA (Field Programmable Gate Array). This module provides a total of 12 channels. Rated power of each channel can be up to 300W. Thus conceived Twyman hardware provides 128 levels of light for each light. Setting these levels can be carried out directly from the editing programs such as Cubase. This setting can be used specifically Key Graphics Editor, List Editor, or Mixer Maps Editor. Author uses the last of the editors. The editors are part of the music software Cubase. Each light channel has three parameters, which can control the channel. There are the level of the channel, gain of channel and the overall level (Master Gain): Channel Level--the range is from zero up to 127.

Settings this parameter but the parameter is closely related to the overall level (see below).

Channel Level--the range is from zero up to 127. Settings this parameter is closely related to the overall level.

Gain Channel--serves as the setting of the luminance channel

Master Gain--to adjust the overall brightness of all channels (Twymann, 2002).


3.1 MIDI protocol

This text part will be describes the MIDI protocol and necessary parts of Universal Serial Bus norms for audio and MIDI devices. The basis of the MIDI communication is called a MIDI message, which consists three bytes. Each MIDI message (event) is presented as three eight-digit binary values, which are made up of zeros and ones. Each MIDI message can then contains in the each byte value from 0 to 255, for a total of 256 different values. MIDI messages are divided into two basic categories: Status messages and Data messages. Status message determines the type of information that is sent via MIDI. Status message indicates a device that receives a message that the event belongs to which channel the MIDI event belongs and what it is. It may be an event: Note On, Pitch change, Program Change (patch change) and After Touch (the last event occurs when it is developed further pressure on already depressed note). Data bytes contained in the device informed about what values are assigned to events, which carries the status byte.

3.2 USB MIDI Event packet

MIDI data is transmitted via USB using 32--bit MIDI Event Packet. Data transmission is performed using the standard reports of four bytes. With this USB MIDI Event Packet is to create a virtual connection between the endpoints USB host and USB MIDI devices. This method of connection is advantageous for its low latency, which does not require a large number of endpoints, like other types of USB devices. Each MIDI event has own USB MIDI packet, which prevents creation of many mistakes.

The first four bits starting at the MSB position contains information about the number of virtual MIDI cable, which it is transmitted by given MIDI information. The value of CN is an indication of the range 0x0 through 0xF indicates the number of the embedded jack, through which there is a link with appropriate MIDI functionality. Second nibl LSB has ended, then identification of the MIDI message. Table 1 shows how different byte write MIDI messages from the USB MIDI packet, which must be submitted if it will be to communicate and receive MIDI information via the USB protocol (Slovak, 2008), (


4.1 Microchip 18F2550

Heart of this module is microcontroller by Microchip company with type signature PIC 18F2550. It is single chip, which is compatible with USB protocol version 2.0. It also supports both USB transfer types, both low speed (1.5 Mbps) and full speed at 12 Mbit / s. It allows all types of USB transfers, so to ensure all possible available functionality in the USB protocol. The processor supports full number of two-way endpoints. In Run mode is controller, when running the processor and peripherals. In Idle mode runs only the peripherals. Sleep mode is set, even when is not running CPU or peripherals. The device can be connected to two external oscillator frequency of up to 48 MHz. The controller has its internal oscillator too. The user can choose from a total of eight oscillation frequencies between 31 kHz to 8 MHz(


The device is also possible to change the polarity, which has used during creation the final project. The first in a series of devices have switching diodes in a logical 1, and then there was a reversal of values taken by the Velocity parameter, which is contained in the third byte of MIDI message. The processor has 100 000x rewritable memory for program and 1000 000x rewritable EEPROM. It also includes 32 tier stack and instruction set, which contains 105 of system instructions. Function Code Protection prevents entry into selected areas of memory. If the microcontroller used in the internal oscillatory block EUSART--Enhanced Universal Synchronous Asynchronous Receiver Transmitter--is used in place of communication, where access to unused external oscillator, avoiding mistakes in the requirements for induction.

Universal serial bus pulse width modulation interface plate was designed as a versatile development board for PIC18F2550 microcontroller applications with emphasis on the use of USB microcontrollers. Power board provides via the USB port a stable 5V. To filter this voltage is added inductance (ferrite seed) and 100 [micro]F electrolytic capacitor. Microcontroller contains a stabilizer 3.3 Voltage, which is used to stabilize the output 1 [micro]F ceramic capacitor. The power supply also connected blocking capacitor 100nF located between GND (ground) and VCC pin microcontroller. The source for generating the clock signal is 20MHz XTAL with two 15pF ceramic capacitors. The value of the crystal was chosen because of its availability, the actual microcontroller allows the use of crystal in the values (4, 8, 12, 16, 20, 24, 40, 48 MHz). Microcontroller is also equipped with an internal RC oscillator, but using the USB connection you must use the exact source of the clock frequency--crystal. The connectors J2, J3 and J5 are connected input / output pins of the microcontroller. The J2 connector pins are connected RC6 and RC7--microcontroller serial port and ground. The J3 connector pins are connected to gate B (RB0 - RB7), which are parallel connected to 5V LED series resistor. J5 connector includes pins Gate A (RA0-RA5) and GND. The basic program board loader--bootloader has been programmed into the board using an external programmer connected to connector J4, which is represented on the board pads for soldering programmer wires. Reset the microcontroller is connected through resistor 10 k ohms or the power supply. The device has a total of eight functional outputs (channels) (



The proposal Universal serial bus pulse width modulation interface was to create a financially optimized, the cheapest possible, programmable robust equipment. The basic advantage of the device is that of the manufacturing cost. This cost is very low. The device is available via the USB connector and a jumper easily re-program by reason of changes in light assembly. An important benefit is the ability to exploit any effect devices, regardless of which protocol is or is not in their software toolkit. The only one prerequisite is to manage the output of the light kit with inductors for large wattage because of reasons of control by pulse width modulation. In this time is developed other new version of hardware device and its management software.


This work was performed with financial support of research project NPVII-2C06007, by the Ministry of Education of the Czech Republic. This work was supported by the grant Internal Grant Agency of Tomas Bata University under the project No. IGA SV30111148020.


Harvey Twyman MIDI hardware Available online: Accessed: 2002-01-01

PIC 18F2455/2550/4455/4550 Data Sheet.pdf, Available online: http ://www., Accessed :2004-04-01

Slovak, D. Protocol MIDI and stage equipment: Tomas Bata University, Faculty of Applied Informatics, Department of Applied Infomatics, 2008, 64 p. Thesis supervisor prof. Ing. Vladimir Vasek, CSc.

Universal Serial Bus specification.pdf, Available online :, Accessed:2000-01-01

Universal Serial Bus Device Class Definition for Audio Devices.pdf Available online: Accessed: 2011-01-01
Tab. 1. USB MIDI Event Packet structure

 Byte 0 Byte 1 Byte 2 Byte 3

 Code Index
cable MIDI generic First Second Third
number classification byte byte byte
COPYRIGHT 2011 DAAAM International Vienna
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 2011 Gale, Cengage Learning. All rights reserved.

Article Details
Printer friendly Cite/link Email Feedback
Author:Slovak, Dalibor
Publication:Annals of DAAAM & Proceedings
Date:Jan 1, 2011
Previous Article:Pulse width modulation MIDI application.
Next Article:Music learning management system.

Terms of use | Privacy policy | Copyright © 2019 Farlex, Inc. | Feedback | For webmasters