v-usb midi problem

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Solaris_M
Posts: 3
Joined: Sun Mar 20, 2011 7:37 pm

v-usb midi problem

Post by Solaris_M » Sun Mar 20, 2011 8:00 pm

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?

adrian.gin
Posts: 9
Joined: Thu Oct 21, 2010 12:33 pm

Re: v-usb midi problem

Post by adrian.gin » Mon Mar 21, 2011 2:01 pm

"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.

Solaris_M
Posts: 3
Joined: Sun Mar 20, 2011 7:37 pm

Re: v-usb midi problem

Post by Solaris_M » Mon Mar 21, 2011 2:46 pm

Yes, on win7 and second winXP(!!!) device is shows up in device_manager, but feiders work only.

adrian.gin
Posts: 9
Joined: Thu Oct 21, 2010 12:33 pm

Re: v-usb midi problem

Post by adrian.gin » Mon Mar 21, 2011 9:08 pm

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

Solaris_M
Posts: 3
Joined: Sun Mar 20, 2011 7:37 pm

Re: v-usb midi problem

Post by Solaris_M » Tue Mar 22, 2011 11:43 am

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

Post Reply