USB
  USB - MIDI Source

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   USB - MIDI Source
radim100
New Member
posted September 09, 2009 12:44 PM     Click Here to See the Profile for radim100   Click Here to Email radim100     Edit/Delete Message
Hi , can some body please point me or send some code to implementUSB MIDI ( mainly controller ) on C8051F34X or 32X family of MCUs.
Thanks .

IP: Logged

Rambo
Member
posted September 09, 2009 01:09 PM     Click Here to See the Profile for Rambo   Click Here to Email Rambo     Edit/Delete Message
Google is your friend.

http://www.google.com/search?hl=en&source=hp&q=midi+source+code+8051&aq=f&oq=&aqi=

IP: Logged

radim100
New Member
posted September 09, 2009 03:12 PM     Click Here to See the Profile for radim100   Click Here to Email radim100     Edit/Delete Message
Thanks for info . I am more interested in some snippets of code for C8051F34X USb MIDI than generic 8051 and any MIDI ( no serial )
Regards

IP: Logged

Tsuneo
Member
posted September 09, 2009 05:25 PM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
Recently, I'm commenting about MIDI everywhere.
Is it current fashion of USB?


Implementation of MIDI is easy.
Follows the procedure on this LPC2000 post.

"USB Device Class for MIDI - followup"
http://tech.groups.yahoo.com/group/lpc2000/message/44602


As the starting example, I recommend this one.

"Optimization of SiLabs USB examples in code size"
http://www.cygnal.org/ubb/Forum9/HTML/000938.html

This example handles endpoints in the superloop of main, though (most of) SiLabs examples do it in USB interrupt. It fits to handle the events of device origin, like MIDI keyboard input.

For your service, I post the descriptors here. Replace USB_Descriptor.c and USB_Descriptor.h of above example. USB_MIDI_Type.h is same as USB_INT_Type.h, just the file name is changed.

Tsuneo


USB MIDI descriptors for 'F32x/'F34x
As usual, copy the formatted code from the edit pane of this post.

USB_Descriptor.c


//-----------------------------------------------------------------------------
// USB_Descriptor.c
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------

#include "USB_MIDI_Type.h"
#include "USB_Configuration.h"
#include "USB_Descriptor.h"

//-----------------------------------------------------------------------------
// Macro for two byte field
//-----------------------------------------------------------------------------

#if defined BIG_ENDIAN
#define LE(x) ((((x)&0x00FF)<<8)|(((x)&0xFF00)>>8)) // convert to little endian
#else
#define LE(x) (x) // no conversion
#endif

//-----------------------------------------------------------------------------
// Descriptor Declarations
//-----------------------------------------------------------------------------

//
// Device descriptor
//
Tdevice_descriptor code DeviceDesc =
{
sizeof(Tdevice_descriptor), // bLength
DSC_TYPE_DEVICE, // bDescriptorType
LE( VER_USB ), // bcdUSB
0x00, // bDeviceClass
0x00, // bDeviceSubClass
0x00, // bDeviceProtocol
EP0_PACKET_SIZE, // bMaxPacketSize0
LE( VID ), // idVendor
LE( PID ), // idProduct
LE( DEV_REV ), // bcdDevice
0x01, // iManufacturer
0x02, // iProduct
0x03, // iSerialNumber
0x01 // bNumConfigurations
}; //end of DeviceDesc

//
// Configuration descriptor
//
Tconfiguration_desc_set code ConfigDescSet =
{
{ // Configuration descriptor
sizeof(Tconfiguration_descriptor), // bLength
DSC_TYPE_CONFIG, // bDescriptorType
LE( sizeof(Tconfiguration_desc_set) ), // bTotalLength
DSC_NUM_INTERFACE, // bNumInterfaces
0x01, // bConfigurationValue
0x00, // iConfiguration
DSC_CNFG_ATR_BASE | DSC_CNFG_ATR_BUS_POWERED, // bmAttributes
DSC_CNFG_MAXPOWER( 100 ), // bMaxPower (mA)
// <= 100mA: Low power
// <= 500mA: High power
},
// Audio control interface
{ // Interface descriptor - standard AC interface
sizeof(Tinterface_descriptor), // bLength
DSC_TYPE_INTERFACE, // bDescriptorType
DSC_INTERFACE_0, // bInterfaceNumber
0x00, // bAlternateSetting
0x00, // bNumEndpoints
0x01, // bInterfaceClass - Audio
0x01, // bInterfaceSubClass - Audio_Control
0x00, // bInterfaceProcotol
0x00, // iInterface
},
{ // CS Interface descriptor - Audio control interface
sizeof(Tac_interface_descriptor), // bLength
DSC_TYPE_CS_INTERFACE, // bDescriptorType
DSC_SUBTYPE_CS_MIDI_HEADER, // bDescriptorSubtype
LE( 0x0100 ), // bcdADC
LE( sizeof(Tac_interface_descriptor) ), // wTotalLength
0x01, // bInCollection - number of streaming interfaces
0x01, // baInterfaceNr - streaming interface 1
},
// MIDIStreaming interface
{ // Interface descriptor - standard MS interface
sizeof(Tinterface_descriptor), // bLength
DSC_TYPE_INTERFACE, // bDescriptorType
DSC_INTERFACE_1, // bInterfaceNumber
0x00, // bAlternateSetting
0x02, // bNumEndpoints
0x01, // bInterfaceClass - Audio
0x03, // bInterfaceSubClass - MIDI streaming
0x00, // bInterfaceProcotol
0x00, // iInterface
},
{

{ // CS Interface descriptor - MIDI streaming interface
sizeof(Tms_header_descriptor), // bLength
DSC_TYPE_CS_INTERFACE, // bDescriptorType
DSC_SUBTYPE_CS_MIDI_HEADER, // bDescriptorSubtype
LE( 0x0100 ), // bcdADC
LE( sizeof(Tcs_midi_stream_descriptor_set) ), // wTotalLength
},
{ // MIDI IN jack - embedded
sizeof(Tmidi_in_jack_descriptor), // bLength
DSC_TYPE_CS_INTERFACE, // bDescriptorType
DSC_SUBTYPE_CS_MIDI_IN_JACK, // bDescriptorSubtype
DSC_MIDI_EMBEDDED, // bJackType
0x01, // bJackID
0x00, // iJack
},
{ // MIDI IN jack - external
sizeof(Tmidi_in_jack_descriptor), // bLength
DSC_TYPE_CS_INTERFACE, // bDescriptorType
DSC_SUBTYPE_CS_MIDI_IN_JACK, // bDescriptorSubtype
DSC_MIDI_EXTERNAL, // bJackType
0x02, // bJackID
0x00, // iJack
},
{ // MIDI OUT jack - embedded
sizeof(Tmidi_out_jack_descriptor), // bLength
DSC_TYPE_CS_INTERFACE, // bDescriptorType
DSC_SUBTYPE_CS_MIDI_OUT_JACK, // bDescriptorSubtype
DSC_MIDI_EMBEDDED, // bJackType
0x03, // bJackID
0x01, // bNrInputPins
0x02, // baSourceID
0x01, // baSourcePin
0x00, // iJack
},
{ // MIDI OUT jack - external
sizeof(Tmidi_out_jack_descriptor), // bLength
DSC_TYPE_CS_INTERFACE, // bDescriptorType
DSC_SUBTYPE_CS_MIDI_OUT_JACK, // bDescriptorSubtype
DSC_MIDI_EXTERNAL, // bJackType
0x04, // bJackID
0x01, // bNrInputPins
0x01, // baSourceID
0x01, // baSourcePin
0x00, // iJack
},
{ // Endpoint1 OUT descriptor
sizeof(Tms_endpoint_descriptor), // bLength
DSC_TYPE_ENDPOINT, // bDescriptorType
EP1_OUT, // bEndpointAddress
DSC_EP_BULK, // bmAttributes
LE( EP1_OUT_PACKET_SIZE ), // MaxPacketSize
0, // bInterval
0x00, // bRefresh
0x00, // bSynchAddress
},
{ // MS Bulk OUT Endpoint Descriptor
sizeof(Tcs_bulk_endpoint_descriptor), // bLength
DSC_TYPE_CS_ENDPOINT, // bDescriptorType
DSC_SUBTYPE_CS_MIDI_GENERAL, // bDescriptorSubtype
0x01, // bNumEmbMIDIJack
0x01, // baAssocJackID
},
{ // Endpoint1 IN descriptor
sizeof(Tms_endpoint_descriptor), // bLength
DSC_TYPE_ENDPOINT, // bDescriptorType
EP1_IN, // bEndpointAddress
DSC_EP_BULK, // bmAttributes
LE( EP1_IN_PACKET_SIZE ), // MaxPacketSize
0, // bInterval
0x00, // bRefresh
0x00, // bSynchAddress
},
{ // MS Bulk IN Endpoint Descriptor
sizeof(Tcs_bulk_endpoint_descriptor), // bLength
DSC_TYPE_CS_ENDPOINT, // bDescriptorType
DSC_SUBTYPE_CS_MIDI_GENERAL, // bDescriptorSubtype
0x01, // bNumEmbMIDIJack
0x03, // baAssocJackID
},

},
}; //end of Configuration

//
// String descriptors
//

#define STR0LEN 4

static BYTE code String0Desc[STR0LEN] =
{
STR0LEN, DSC_TYPE_STRING, 0x09, 0x04
}; //end of String0Desc

#define STR1LEN sizeof("SILICON LABORATORIES INC.")*2

static BYTE code String1Desc[STR1LEN] =
{
STR1LEN, DSC_TYPE_STRING,
'S', 0,
'I', 0,
'L', 0,
'I', 0,
'C', 0,
'O', 0,
'N', 0,
' ', 0,
'L', 0,
'A', 0,
'B', 0,
'O', 0,
'R', 0,
'A', 0,
'T', 0,
'O', 0,
'R', 0,
'I', 0,
'E', 0,
'S', 0,
' ', 0,
'I', 0,
'N', 0,
'C', 0,
'.', 0
}; //end of String1Desc

#define STR2LEN sizeof("C8051F320 Development Board")*2

static BYTE code String2Desc[STR2LEN] =
{
STR2LEN, DSC_TYPE_STRING,
'C', 0,
'8', 0,
'0', 0,
'5', 0,
'1', 0,
'F', 0,
'3', 0,
'2', 0,
'0', 0,
' ', 0,
'D', 0,
'e', 0,
'v', 0,
'e', 0,
'l', 0,
'o', 0,
'p', 0,
'm', 0,
'e', 0,
'n', 0,
't', 0,
' ', 0,
'B', 0,
'o', 0,
'a', 0,
'r', 0,
'd', 0
}; //end of String2Desc

// serial number string

#define STR3LEN sizeof("0001")*2

static BYTE code String3Desc[STR3LEN] =
{
STR3LEN, DSC_TYPE_STRING,
'0', 0,
'0', 0,
'0', 0,
'1', 0
}; //end of String3Desc

BYTE code * code StringDescTable[] =
{
String0Desc,
String1Desc,
String2Desc,
String3Desc
};

BYTE code StringDescNum = sizeof( StringDescTable ) / sizeof( StringDescTable[0] );

//-----------------------------------------------------------------------------
// End Of File
//-----------------------------------------------------------------------------

USB_Descriptor.h


//-----------------------------------------------------------------------------
// USB_Descriptor.h
//-----------------------------------------------------------------------------

#ifndef USB_DESCRIPTORS_H
#define USB_DESCRIPTORS_H

//-----------------------------------------------------------------------------
// Definition of descriptors
//-----------------------------------------------------------------------------

//------------------------------------------
// Standard Device Descriptor Type Defintion
//------------------------------------------
typedef struct {
BYTE bLength; // Size of this Descriptor in Bytes
BYTE bDescriptorType; // Descriptor Type (=1)
UINT bcdUSB; // USB Spec Release Number in BCD
BYTE bDeviceClass; // Device Class Code
BYTE bDeviceSubClass; // Device Subclass Code
BYTE bDeviceProtocol; // Device Protocol Code
BYTE bMaxPacketSize0; // Maximum Packet Size for EP0
UINT idVendor; // Vendor ID
UINT idProduct; // Product ID
UINT bcdDevice; // Device Release Number in BCD
BYTE iManufacturer; // Index of String Desc for Manufacturer
BYTE iProduct; // Index of String Desc for Product
BYTE iSerialNumber; // Index of String Desc for SerNo
BYTE bNumConfigurations; // Number of possible Configurations
} Tdevice_descriptor; // End of Device Descriptor Type

//--------------------------------------------------
// Standard Configuration Descriptor Type Definition
//--------------------------------------------------
typedef struct {
BYTE bLength; // Size of this Descriptor in Bytes
BYTE bDescriptorType; // Descriptor Type (=2)
UINT wTotalLength; // Total Length of Data for this Conf
BYTE bNumInterfaces; // number of Interfaces supported by Conf
BYTE bConfigurationValue; // Designator Value for *this* Conf
BYTE iConfiguration; // Index of String Desc for this Conf
BYTE bmAttributes; // Configuration Characteristics
BYTE bMaxPower; // Max. Power Consumption in Conf (*2mA)
} Tconfiguration_descriptor; // End of Configuration Descriptor Type

//----------------------------------------------
// Standard Interface Descriptor Type Definition
//----------------------------------------------
typedef struct {
BYTE bLength; // Size of this Descriptor in Bytes
BYTE bDescriptorType; // Descriptor Type (=4)
BYTE bInterfaceNumber; // Number of *this* Interface (0..)
BYTE bAlternateSetting; // Alternative for this Interface
BYTE bNumEndpoints; // No of EPs used by this IF (excl. EP0)
BYTE bInterfaceClass; // Interface Class Code
BYTE bInterfaceSubClass; // Interface Subclass Code
BYTE bInterfaceProtocol; // Interface Protocol Code
BYTE iInterface; // Index of String Desc for Interface
} Tinterface_descriptor; // End of Interface Descriptor Type

//---------------------------------------------
// Standard Endpoint Descriptor Type Definition
//---------------------------------------------
typedef struct {
BYTE bLength; // Size of this Descriptor in Bytes
BYTE bDescriptorType; // Descriptor Type (=5)
BYTE bEndpointAddress; // Endpoint Address (Number + Direction)
BYTE bmAttributes; // Endpoint Attributes (Transfer Type)
UINT wMaxPacketSize; // Max. Endpoint Packet Size
BYTE bInterval; // Polling Interval (Interrupt) ms
} Tendpoint_descriptor; // End of Endpoint Descriptor Type

//---------------------------------------------
// Standard MS Bulk Data Endpoint Descriptor
//---------------------------------------------
typedef struct {
BYTE bLength; // Size of this Descriptor in Bytes
BYTE bDescriptorType; // Descriptor Type (=5)
BYTE bEndpointAddress; // Endpoint Address (Number + Direction)
BYTE bmAttributes; // Endpoint Attributes (Transfer Type)
UINT wMaxPacketSize; // Max. Endpoint Packet Size
BYTE bInterval; // Polling Interval (Interrupt) ms
BYTE bRefresh;
BYTE bSynchAddress;
} Tms_endpoint_descriptor; // End of Endpoint Descriptor Type


//---------------------------------------------
// Class specific descriptors
//---------------------------------------------

//---------------------------------------------
// AC Interface Descriptor
//---------------------------------------------
typedef struct {
BYTE bLength;
BYTE bDescriptorType;
BYTE bDescriptorSubtype;
UINT bcdADC;
UINT wTotalLength;
BYTE bInCollection;
BYTE baInterfaceNr;
} Tac_interface_descriptor;

//---------------------------------------------
// MS Interface Header Descriptor
//---------------------------------------------
typedef struct {
BYTE bLength;
BYTE bDescriptorType;
BYTE bDescriptorSubtype;
UINT bcdADC;
UINT wTotalLength;
} Tms_header_descriptor;

//---------------------------------------------
// MIDI IN Jack Descriptor
//---------------------------------------------
typedef struct {
BYTE bLength;
BYTE bDescriptorType;
BYTE bDescriptorSubtype;
BYTE bJackType;
BYTE bJackID;
BYTE iJack;
} Tmidi_in_jack_descriptor;

//---------------------------------------------
// MIDI OUT Jack Descriptor
//---------------------------------------------
typedef struct {
BYTE bLength;
BYTE bDescriptorType;
BYTE bDescriptorSubtype;
BYTE bJackType;
BYTE bJackID;
BYTE bNrInputPins;
BYTE baSourceID;
BYTE baSourcePin;
BYTE iJack;
} Tmidi_out_jack_descriptor;

//---------------------------------------------
// MS Bulk Data Endpoint Descriptor
//---------------------------------------------
typedef struct {
BYTE bLength;
BYTE bDescriptorType;
BYTE bDescriptorSubtype;
BYTE bNumEmbMIDIJack;
BYTE baAssocJackID;
} Tcs_bulk_endpoint_descriptor;


//---------------------------------------------
// Configuration Descriptor Set
//---------------------------------------------

typedef struct {
Tms_header_descriptor m_ms_header_desc;
Tmidi_in_jack_descriptor m_midi_in_jack_desc_emb;
Tmidi_in_jack_descriptor m_midi_in_jack_desc_ext;
Tmidi_out_jack_descriptor m_midi_out_jack_desc_emb;
Tmidi_out_jack_descriptor m_midi_out_jack_desc_ext;
Tms_endpoint_descriptor m_endpoint_desc_OUT;
Tcs_bulk_endpoint_descriptor m_cs_bulk_endpoint_desc_OUT;
Tms_endpoint_descriptor m_endpoint_desc_IN;
Tcs_bulk_endpoint_descriptor m_cs_bulk_endpoint_desc_IN;
} Tcs_midi_stream_descriptor_set;

typedef struct {
Tconfiguration_descriptor m_config_desc;
Tinterface_descriptor m_interface_desc_0;
Tac_interface_descriptor m_ac_interface_desc;
Tinterface_descriptor m_interface_desc_1;
Tcs_midi_stream_descriptor_set m_ms_desc_set;
} Tconfiguration_desc_set;


// Descriptor type
#define DSC_TYPE_DEVICE 0x01
#define DSC_TYPE_CONFIG 0x02
#define DSC_TYPE_STRING 0x03
#define DSC_TYPE_INTERFACE 0x04
#define DSC_TYPE_ENDPOINT 0x05

// Configuration descriptor: bmAttributes
#define DSC_CNFG_ATR_BASE 0x80 // D7: base attribute, always 1
#define DSC_CNFG_ATR_SELF_POWERED 0x40 // D6: bus-powered: 0, self-powered: 1, both: 1
#define DSC_CNFG_ATR_BUS_POWERED 0x00
#define DSC_CNFG_ATR_REMOTEWAKEUP 0x20 // D5: remote-wakeup disabled: 0, enabled: 1

// Configuration descriptor: bMaxPower
#define DSC_CNFG_MAXPOWER( x ) (((x) + 1) / 2) // 1 unit = 2mA

// Endpoint transfer type
#define DSC_EP_CONTROL 0x00
#define DSC_EP_ISOC 0x01
#define DSC_EP_BULK 0x02
#define DSC_EP_INTERRUPT 0x03

// Endopoint address
#define EP1_OUT 0x01
#define EP2_OUT 0x02
#define EP3_OUT 0x03
#define EP1_IN 0x81
#define EP2_IN 0x82
#define EP3_IN 0x83

// Descriptor type (Class specific)
#define DSC_TYPE_CS_INTERFACE 0x24

#define DSC_SUBTYPE_CS_MIDI_HEADER 0x01
#define DSC_SUBTYPE_CS_MIDI_IN_JACK 0x02
#define DSC_SUBTYPE_CS_MIDI_OUT_JACK 0x03
#define DSC_SUBTYPE_CS_MIDI_ELEMENT 0x04

#define DSC_TYPE_CS_ENDPOINT 0x25

#define DSC_SUBTYPE_CS_MIDI_GENERAL 0x01

// MIDI IN / OUT Jack type
#define DSC_MIDI_EMBEDDED 0x01
#define DSC_MIDI_EXTERNAL 0x02

//-----------------------------------------------------------------------------
// Global variables
//-----------------------------------------------------------------------------

extern Tdevice_descriptor code DeviceDesc;
extern Tconfiguration_desc_set code ConfigDescSet;
extern BYTE code * code StringDescTable[];
extern BYTE code StringDescNum;

#endif // USB_DESCRIPTORS_H

//-----------------------------------------------------------------------------
// End Of File
//-----------------------------------------------------------------------------

IP: Logged

radim100
New Member
posted September 10, 2009 09:19 AM     Click Here to See the Profile for radim100   Click Here to Email radim100     Edit/Delete Message
Thanks Tsuneo,
Your contribution to this forum and other forums is great and appreciated. I have implemented MIDI code you have posted above and so far device can be recognized by Win Xp. I will post code as soon as I will have
I/O part done .
Regards.

IP: Logged

radim100
New Member
posted September 11, 2009 12:25 AM     Click Here to See the Profile for radim100   Click Here to Email radim100     Edit/Delete Message
Hi,
I have compiled USB MIDI code as recommended by Tsuneo. Attched ZIP for Keil
UV3 . Code is fitted to go on Toolstick F342DC board . Pot is used for CC , SW! and Port1 for Keys . Code is running fine on my
2 machinnes . First one is Win XP Media Center SP3 , second Vista Home . However I have problem on 3rd PC which was originall Win Xp Pro SP2 . So I updated to SP3 and reisntalled all driver but problem persist .
Do you guys have any ideas .
I am testing with MIDI OX and several MID Hosts . Problem is the same . All off applications can see interface if plugged in but cannot transfer any data . There is long time delay and MIDI OX is locking and freezend if Audio Device enabled .
Thanks for any insite.
Regards Radim.
connect

IP: Logged

radim100
New Member
posted September 11, 2009 12:39 AM     Click Here to See the Profile for radim100   Click Here to Email radim100     Edit/Delete Message
Here is that Source Code :
http://www.micronix.ca/MIDI_USB/USB_MIDI_C8051F342DC.zip

IP: Logged

Tsuneo
Member
posted September 11, 2009 08:45 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
You mean, on a specific PC, the device is enumerated successfully, but bulk transfer fails.

a) Timing of packet transfer

As you put packets to the bulk IN always when it is possible for the endpoint, it may disturb the device driver on the PC with too frequent packet handling. Send a packet just when it is needed.


//-----------------------------------------------------------------------------
// Local Ptorotype
//-----------------------------------------------------------------------------

bit Send_Packet( void );


//-----------------------------------------------------------------------------
// Main Routine
//-----------------------------------------------------------------------------

void main( void )
{
//
// initialization comes here
//

while ( 1 ) { // main loop
// task1: key scan and send MIDI packet
if ( packet_size == 0 ) {
Load_In_Packet();
} else { // just when any data to send is there, call Send_Packet()
if ( Send_Packet() )
packet_size = 0;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////

{ // task2: USB OUT EP handling
...
}
}
}

//-----------------------------------------------------------------------------
// Send_Packet
// Send a packet over bulk IN endpoint
//
// In_Packet : packet buffer
// packet_size: size of packet on the buffer
//-----------------------------------------------------------------------------

bit Send_Packet( void )
{ // USB IN EP handling
bit packet_sent = FALSE;
unsigned char EUSB0_save;

if ( Ep_StatusIN1 != EP_HALT ) {
// atomic access handling
#if defined KEIL
if ( _testbit_( IN_FIFO_empty ) ) { // when FIFO is empty
// KEIL generate JBC using _testbit_()
#endif // KEIL
#if defined SDCC
if ( IN_FIFO_empty ) { // when FIFO is empty
IN_FIFO_empty = FALSE; // SDCC generates JBC in this coding pattern
#endif // SDCC
// To prevent conflict with USB interrupt
EUSB0_save = EIE1 & 0x02; // save USB interrupt enable bit
EIE1 &= ~0x02; // disable USB interrupt temporarily
POLL_WRITE_BYTE( INDEX, 1 ); // Load packet to FIFO
FIFO_Write_idata( FIFO_EP1, packet_size, In_Packet ); // select one of FIFO_Write_
// FIFO_Write_pdata( FIFO_EP1, packet_size, In_Packet ); // depending on In_Packet memory assignment
// FIFO_Write_xdata( FIFO_EP1, packet_size, In_Packet );

POLL_WRITE_BYTE( EINCSRL, rbInINPRDY ); // set FIFO ready flag
EIE1 |= EUSB0_save; // restore USB interrupt

packet_sent = TRUE;
}
}
return packet_sent;
}

b) Conflict with SiLabs usb_interrupt device driver

VID/PID of your device is same as SiLabs usb_interrupt example.
Use another VID/PID for this MIDI device.
While in development, you can assign any VID/PID temporarilly, such as 0xFFFF/0x0001, unless it conflicts with other devices on the PC. USBDeview shows all VID/PID of registered devices on the PC.

USBDeview
http://www.nirsoft.net/utils/usb_devices_view.html

Before releasing your device off from your desktop, get an official VID/PID for the device.
SiLabs offer a unique PID under their VID for your SiLabs chip.

SiLabs MCU KB: "Obtaining a Unique PID"
http://portal.knowledgebase.net/article.asp?article=87271&p=4120

Tsuneo

[This message has been edited by Tsuneo (edited September 11, 2009).]

IP: Logged

radim100
New Member
posted September 12, 2009 02:48 PM     Click Here to See the Profile for radim100   Click Here to Email radim100     Edit/Delete Message
Hi ,
Thanks to Tsuneo for his help with my previous problem . After I have modified Sendding packets part of code it works on all 3 PC I have tested my code .
At this link :
http://www.micronix.ca/MIDI_USB/USB_MIDI_C8051F342DC.zip
there is Multiproject files for Keil UV3 which has demo MIDI code for all 3 evaluation bords for Toolstick F342Dc, F321DC and F327DC . Code is only to test MIDI USB on this hardware .
I have also changed VID /PID to 0xFFFF/0x0001 ( resp. 0x0002,0x0003 ) for prototyping stage .
Regards Radim.

IP: Logged

radim100
New Member
posted July 30, 2010 11:03 PM     Click Here to See the Profile for radim100   Click Here to Email radim100     Edit/Delete Message
I have had above code working for some time OK.
Now I would like to add HID to its MIDI as composite device. Any hints what needs to be added and what code to be modified ?
Thanks.

[This message has been edited by radim100 (edited July 30, 2010).]

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | MCU User Forum

Have you seen our MCU Knowledge Base?


Ultimate Bulletin Board 5.47b