CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

USB-midi problem with sending messages to pc

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nakarman



Joined: 06 Feb 2008
Posts: 2
Location: Moscow. Russia

View user's profile Send private message ICQ Number

USB-midi problem with sending messages to pc
PostPosted: Wed Feb 06, 2008 2:57 pm     Reply with quote

First of all, i want to ask users of this forum if you have some usb-midi-pic18f-related code to share it here or send me by email (nakarman[at] gmail.com). I would be happy to get some examples.

Okay, the problem.

I'm writing a test usb-midi program that would send test midi data, so later I can develop a usb-midi keyboard.

The descriptors are based on Thorsten Klose's work, I have also checked usb-midi datasheet.

The problem is that pc's do receive usb-midi-data packets, but no one program receives them. I open midi device in MIDI-OX, but it receives no input midi data. (The PC shows one in and one out midi ports for my device but they do not transmit any data)

I also have a usb-midi keyboard it works fine with the same software.

Maybe someone can tell how to send some sample note on event to pc? What is relation between IN endpoint and jacks, attached to it in the descriptor? How to form usb-midi-packets?

Maybe there is some initialisation routine except descriptors?

http://averin.ru/raznoe/payalovo/ccsforum/usbmidi-nodata.zip
This is a link to complete sorce code, based on custom_scope example.
I have checked device on 2 pc's and 2 chips.

chip 18f2550 rev.5 (also tested 4550)
nakarman



Joined: 06 Feb 2008
Posts: 2
Location: Moscow. Russia

View user's profile Send private message ICQ Number

Problem solved!
PostPosted: Thu Feb 07, 2008 3:48 pm     Reply with quote

Problem solved! The crappy driver didn't work when ep received data being unconfigured. Or it is crappy pic%)

Okay the code in demo should send data only after some time(maybe device gets configured or port opened). So use it. Just add a button that triggers midi send. I can also send you email with working MBHPUSB midi (the same code but ported to mbhpusb framework)

I should also mention to use capasitors on Vcc and Vusb, according to my tests this is critical.
luca
Guest







small bug
PostPosted: Mon Mar 24, 2008 4:30 pm     Reply with quote

NOTE: the source code has a small bug. When code read data, it check the buffer n.2, but read data from buffer n.1. Both instructions have to work with buffer n.2 (see code below)
Code:

if(usb_kbhit(2)) {
   rxlen = usb_get_packet(2,rxdata,8);
}

Luca
Skirmitt



Joined: 19 May 2009
Posts: 60

View user's profile Send private message

PostPosted: Sun Feb 12, 2012 7:00 am     Reply with quote

Hello, can you upload the most recent working code ? Perhaps you can put it in the library.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group