<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/1352" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2017-08-31T12:06:54+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/1352</id>

		<entry>
		<author><name><![CDATA[horo]]></name></author>
		<updated>2017-04-02T17:41:45+02:00</updated>

		<published>2017-04-02T17:41:45+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=32124#p32124</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=32124#p32124"/>
		<title type="html"><![CDATA[Re: USB MIDI Interface]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=32124#p32124"><![CDATA[
Hi,<br /><br />me again. I've cleaned up the attiny85 midi code at <a href="https://bitbucket.org/horo/v-usb-midi" class="postlink">bitbucket</a>, added pwm out and a 2nd analog input.<br /><br />Possible tested I/O functions are:<br />PB0: Digital input or digital output or pwm output.<br />PB1: Digital input or digital output or pwm output (active high LED attached).<br />PB2: Digital input or digital output or analog input ADC1.<br />PB3, 4: USB data lines.<br />PB5: 1 analog input (ADC0, shared with the /Reset function, but you can apply a voltage between Vcc/2 and Vcc -&gt; 512..1023 without resetting the device). <br /><br />Ciao, Martin<br /><br />EDIT 20170403:<br />I did some timing tests with an empty main loop, PB1 toggles every 3µs (idle) with a gap of 150µs (USB transfer) every 2ms. <br />So we still have &gt;90% CPU time for our program available. This looks similar to <a href="https://forums.obdev.at/viewtopic.php?f=8&amp;t=1352&amp;start=15#p9092" class="postlink">my measurements</a> from 2009.<br />Test system: Lenovo T400 with Linux 4.10.8-towo.1-siduction-amd64 #1 SMP PREEMPT siduction 4.10-14 (2017-03-31) x86_64 GNU/Linux.<br /><br />Short test on Win7 -&gt; USB transfer every 8ms.<br /><br />Win / Mac users: please double check on your systems.<br /><br /><div class="codebox"><p>Code: </p><pre><code>int main(void) // test loop<br />{<br />   uchar iii, value;<br />   uchar midiMsg&#91;8&#93;;<br /><br />   DDRB |= 2;      // LED pin output<br />   PORTB |= 2;      // LED on<br /><br />   setName( 0 );<br /><br />   usbDeviceDisconnect();<br />   for(iii=0;iii&lt;20;iii++){  /* 300 ms disconnect */<br />      _delay_ms(15);<br />   }<br />   usbDeviceConnect();<br />   PORTB &amp;= ~2;      // LED off<br /><br />   wdt_enable(WDTO_1S);<br />   usbInit();<br />   sei();<br />   value = 0;<br />   for(;;){    /* main event loop */<br />      PORTB ^= 2;   // toggle LED while idling<br />      wdt_reset();<br />      usbPoll();<br />      if ( usbInterruptIsReady() ) {   // prepare and start USB transfer<br />         iii = 0;<br />         midiMsg&#91;iii++&#93; = 0x0B;<br />         midiMsg&#91;iii++&#93; = 0xB0;<br />         midiMsg&#91;iii++&#93; = 70; // cc 70<br />         midiMsg&#91;iii++&#93; = value++;<br />         midiMsg&#91;iii++&#93; = 0x0B;<br />         midiMsg&#91;iii++&#93; = 0xB0;<br />         midiMsg&#91;iii++&#93; = 71; // cc 71<br />         midiMsg&#91;iii++&#93; = value++;<br />         usbSetInterrupt(midiMsg, iii);   // transfer message<br />         if ( value &gt; 127 ) {<br />            value = 0;<br />         }<br />      }<br />   }<br />   return 0;<br />}<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=891">horo</a> — Sun Apr 02, 2017 5:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[horo]]></name></author>
		<updated>2017-08-31T12:06:54+02:00 </updated>

		<published>2017-03-30T18:31:38+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=32118#p32118</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=32118#p32118"/>
		<title type="html"><![CDATA[Re: USB MIDI Interface]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=32118#p32118"><![CDATA[
Hi,<br /><br />after a quite long time I've added a new demo project - V-USB-MIDI-ATtiny85.<br />Runs on a real cheap development board, e.g. <a href="http://digistump.com/products/1" class="postlink">Digispark</a> - available as china clone for about 1..2 € or $.<br /><img src="https://cdn.instructables.com/FJI/GKJ2/IDWXMS4L/FJIGKJ2IDWXMS4L.MEDIUM.jpg" class="postimage" alt="Image" /><br /><img src="https://www.mikrocontroller.net/attachment/336580/attiny85-breakout-board.jpg" class="postimage" alt="Image" /><br />The board has it's own USB bootloader - no need for a programmer - connect via USB and download your *.hex <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br />16.5 MHz without xtal, 1 key input,one potentiometric analog input.<br />MIDI out is also possible, e.g. PWM or digital.<br /><br />Have a look at my <a href="https://bitbucket.org/horo/v-usb-midi" class="postlink">Bitbucket</a>.<br /><br />Ciao, Martin<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=891">horo</a> — Thu Mar 30, 2017 6:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[winelight]]></name></author>
		<updated>2017-03-24T16:26:27+02:00</updated>

		<published>2017-03-24T16:26:27+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=32099#p32099</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=32099#p32099"/>
		<title type="html"><![CDATA[Re: USB MIDI Interface]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=32099#p32099"><![CDATA[
I <strong class="text-strong">think</strong> the exchange rate is determined by the operating system on the PC and how quickly it polls the USB port. Obviously there is an upper limit imposed by the speed of USB too.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=9486">winelight</a> — Fri Mar 24, 2017 4:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2017-01-24T15:38:10+02:00</updated>

		<published>2017-01-24T15:38:10+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=31894#p31894</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=31894#p31894"/>
		<title type="html"><![CDATA[Re: USB MIDI Interface]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=31894#p31894"><![CDATA[
Hello,<br /><br />Does the VUSB MIDI work with latest linux kernel versions still with 2ms high speed?<br /><br />Thx in advance<p>Statistics: Posted by Guest — Tue Jan 24, 2017 3:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Coda]]></name></author>
		<updated>2016-01-28T09:20:26+02:00</updated>

		<published>2016-01-28T09:20:26+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30774#p30774</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30774#p30774"/>
		<title type="html"><![CDATA[Re: USB MIDI Interface]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30774#p30774"><![CDATA[
@jokkebk - no the USB does not cause an issue with 31250 baud serial comms, I have successfuly programmed a MIDI-USB cable using a tiny4313 which can handle large streams of sysex in both directions. It sounds like you are getting an overrun because you are not doing any flow-control. You need to make a buffer of at least 16 bytes in ram (I used 32), so that the receive routine has got somewhere to store incoming bytes for the USB routine. Then you need to make sure you are servicing USB requests every 1 millisecond (check the binterval, as written above by 'Eye').<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=6646">Coda</a> — Thu Jan 28, 2016 9:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jokkebk]]></name></author>
		<updated>2016-01-11T00:48:22+02:00</updated>

		<published>2016-01-11T00:48:22+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30715#p30715</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30715#p30715"/>
		<title type="html"><![CDATA[Re: USB MIDI Interface]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30715#p30715"><![CDATA[
Hi all!<br /><br />Thanks to Martin for the great V-USB MIDI efforts. I combined Adafruit Trinket USB HID keyboard code and MIDI project to arrive at Adafruit Trinket &amp; Pro Trinket MIDI library:<br /><br /><a href="https://github.com/jokkebk/TrinketMIDI" class="postlink">https://github.com/jokkebk/TrinketMIDI</a><br /><br />Unfortunately, my ultimate goal wiring the Pro Trinket hardware UART RX line to a old school MIDI connector (via optoisolator of course) has failed. It may be bugs in my code, but because ATmega328's &quot;data overrun&quot; flag in USART registers is getting set, I'm suspecting V-USB communication under OS X is taxing the MCU too much to receive 31 250 baud UART transmissions (there's only 2 byte FIFO in the thing, Trinket ATtiny85 did not even have HW UART so that was useless).<br /><br />Does someone know how long V-USB interrupts, usbPoll and sending the MIDI packet takes? Based on quick calculation, two bytes of 8N1 MIDI data take 640 us. Is there a way to measure V-USB processor usage? Oscilloscope? Timing usbPoll()? Timing usbSetInterrupt()? It would be helpful if there was documentation how different parts of V-USB work together to even puzzle out which methods take up the most time...<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5127">jokkebk</a> — Mon Jan 11, 2016 12:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[winelight]]></name></author>
		<updated>2015-09-14T09:38:46+02:00</updated>

		<published>2015-09-14T09:38:46+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30266#p30266</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30266#p30266"/>
		<title type="html"><![CDATA[Re: USB MIDI Interface]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30266#p30266"><![CDATA[
OK I did remember eventually. But in usbport.sys in W10 I can't find any of the relevant byte sequences.<br /><br />So I did some research and it appears that Microsoft has removed the poll rate limitation in Windows 10.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=9486">winelight</a> — Mon Sep 14, 2015 9:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[winelight]]></name></author>
		<updated>2015-08-05T23:45:39+02:00</updated>

		<published>2015-08-05T23:45:39+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30074#p30074</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30074#p30074"/>
		<title type="html"><![CDATA[Re: USB MIDI Interface]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30074#p30074"><![CDATA[
I am guessing (it is only a guess) that it will be similar to 7 and Vista; but at a different location and with a slightly different byte sequence. Next week I may have time to take a look if that will help (and if I remember!).<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=9486">winelight</a> — Wed Aug 05, 2015 11:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2015-08-05T11:02:46+02:00</updated>

		<published>2015-08-05T11:02:46+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30069#p30069</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30069#p30069"/>
		<title type="html"><![CDATA[USB MIDI Interface - W10?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=30069#p30069"><![CDATA[
Ok, there's a solution for Vista and W10, what's about W10?<br /><br />jasmin<p>Statistics: Posted by Guest — Wed Aug 05, 2015 11:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[winelight]]></name></author>
		<updated>2015-01-19T22:00:50+02:00</updated>

		<published>2015-01-19T22:00:50+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1352&amp;p=29129#p29129</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=29129#p29129"/>
		<title type="html"><![CDATA[Re: USB MIDI Interface]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1352&amp;p=29129#p29129"><![CDATA[
Thanks for that - looks great. I imagine it must be similar on Vista; will do some work on that when I get a chance.<br /><br />(edit) On Vista the location is different (on mine it was 01f824) and the byte sequence is slightly different too:<br /><br />3C 08 73 09 C6 86 1E 01 00 00 08<br /><br />Note the two 08s are in the same relative position.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=9486">winelight</a> — Mon Jan 19, 2015 10:00 pm</p><hr />
]]></content>
	</entry>
	</feed>
