View previous topic :: View next topic |
Author |
Message |
nakarman
Joined: 06 Feb 2008 Posts: 2 Location: Moscow. Russia
|
USB-midi problem with sending messages to pc |
Posted: Wed Feb 06, 2008 2:57 pm |
|
|
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
|
Problem solved! |
Posted: Thu Feb 07, 2008 3:48 pm |
|
|
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 |
Posted: Mon Mar 24, 2008 4:30 pm |
|
|
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
|
|
Posted: Sun Feb 12, 2012 7:00 am |
|
|
Hello, can you upload the most recent working code ? Perhaps you can put it in the library. |
|
|
|