Page 1 of 1

v-usb midi problem

Posted: Sun Mar 20, 2011 8:00 pm
by Solaris_M
Hello!
I build a midi controller on v-usb(running on atmega48, HID driver), it consist of 23 analog feider and 16 buttons(using 'mux'). I have a problem - on pc with winXP it works great, but on win7 it only half-working - buttons don't work, and on another pc buttons don't work even on winXP, i am confused. See this code

Code: Select all

din()
{....
                            midiMsg[0] = 0x0b;
                            midiMsg[1] = 0xb1; //b1 DIN!!!
                            midiMsg[2] = controll*8 + row;
               
                                    if(1& (input[controll]>>row)) sett = 0xff;
                                    else sett = 0;           
                            midiMsg[3] = sett;
}
ain()
{...
            midiMsg[0] = 0x0b;
            midiMsg[1] = 0xb0; //B0 AIN
            midiMsg[2] = controll;   
            midiMsg[3] = value; //>> 3; //naaea a ADC()

}
"ain" its function operational with analog input(feiders, ADC on atmega), "din" deals with buttons. Diffents beetwen "din" and "ain" is only second byte of midi_message. I even can replace "midiMsg[1] = 0xb1"(din) with "midiMsg[1] = 0xb0", i think it will be work, but i don't understand - why it wouldn't work so? On my pc with winXP it work propely, on second winXP it doesn't work! :?
What do you think about it?

Re: v-usb midi problem

Posted: Mon Mar 21, 2011 2:01 pm
by adrian.gin
"It does not work"

Does this mean that the device under the "Device Manager" shows up as not installed correctly?

under Windows7, they've blocked off the use of Bulk Endpoints for Low speed devices, you can however use interrupt endpoints.

Re: v-usb midi problem

Posted: Mon Mar 21, 2011 2:46 pm
by Solaris_M
Yes, on win7 and second winXP(!!!) device is shows up in device_manager, but feiders work only.

Re: v-usb midi problem

Posted: Mon Mar 21, 2011 9:08 pm
by adrian.gin
are you using usbPoll() in your main loop?

You also have to ensure that none of your data ie, midimsg2 or 3 exceeds 0x7F. by the looks of your code you send 0xFF and your midiMsg[2] looks to be possibly out of range.

Code: Select all

 midiMsg[1] = 0xb1; //b1 DIN!!!
 midiMsg[2] = controll*8 + row;             
 if(1& (input[controll]>>row)) sett = 0xff;
 else sett = 0;           


It's difficult to help you when you don't post all the code.

Adrian

Re: v-usb midi problem

Posted: Tue Mar 22, 2011 11:43 am
by Solaris_M
Really, midiMsg[] must be in range from 0x00 to 0x7f.. I'll try to replace it.
Link for downloading all another code - http://zalil.ru/30715774