<?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/9238" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2014-08-12T10:58:34+02:00</updated>

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

		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-08-12T10:58:34+02:00</updated>

		<published>2014-08-12T10:58:34+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27911#p27911</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27911#p27911"/>
		<title type="html"><![CDATA[Re: usbFunctionWrite incorrect length, need help]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27911#p27911"><![CDATA[
Here's the seller I got mine from for $2.46 individually shipped (mine was ePacket too for USA delivery, so faster and with tracking). <!-- m --><a class="postlink" href="http://www.ebay.com/itm/321454750990">http://www.ebay.com/itm/321454750990</a><!-- m --><br /><br />BTW, the original Arduino 328p board used a resonator, so this Baite one is actually <em class="text-italics">improving</em> quality over the official board. I've gotten at least a dozen inexpensive clones of various boards and been impressed with the quality of all of them so far. One other change on this Baite board that I like is that the VCC on the side serial connector connects directly to VCC, rather than going through a reverse-current protection diode as on the green Deek-Robot boards, and thus dropping VCC unless you connect a separate supply to the side VCC pin.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Tue Aug 12, 2014 10:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[baoshi]]></name></author>
		<updated>2014-08-12T05:01:52+02:00</updated>

		<published>2014-08-12T05:01:52+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27910#p27910</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27910#p27910"/>
		<title type="html"><![CDATA[Re: usbFunctionWrite incorrect length, need help]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27910#p27910"><![CDATA[
Thanks. Found it here. <br /><!-- m --><a class="postlink" href="http://www.aliexpress.com/store/product/1pcs-Pro-Mini-328-Mini-ATMEGA328-5V-16MHz-Free-Shipping/812021_1432585134.html">http://www.aliexpress.com/store/product ... 85134.html</a><!-- m --><br /><br />Nowadays these Chinese manufactures really keen on cutting cost. I get a recent Arduino Uno clone only to find they are also using ceramic resonate for the 328p, but when it is to the Atmega8U2, they used a crystal. They seems to know what they are doing  <img class="smilies" src="./../../../images/smilies/icon_confused.gif" alt=":?" title="Confused" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20583">baoshi</a> — Tue Aug 12, 2014 5:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-08-12T04:39:14+02:00</updated>

		<published>2014-08-12T04:39:14+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27909#p27909</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27909#p27909"/>
		<title type="html"><![CDATA[Re: usbFunctionWrite incorrect length, need help]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27909#p27909"><![CDATA[
That's too bad to hear. I got a bunch of those Deek-Robot atmega328p Arduino clones for $2 USD each recently and was hoping I could use some for V-USB reliably. I happened to also get a Baite version of this 328p board for only a little more and it seems to have a crystal oscillator (ceramic ones aren't accurate to 16.000 MHz):<br /><br /><img src="http://i.imgur.com/QvufQs1.jpg" class="postimage" alt="Image" /><br /><br />Just in case you're trying to find some that will work.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Tue Aug 12, 2014 4:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[baoshi]]></name></author>
		<updated>2014-08-11T16:57:41+02:00</updated>

		<published>2014-08-11T16:57:41+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27907#p27907</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27907#p27907"/>
		<title type="html"><![CDATA[Re: usbFunctionWrite incorrect length, need help]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27907#p27907"><![CDATA[
Totally make sense sir. Yes the board is using a murata 3pin ceramic oscillator.<br />I added CRC code and did DBG1 on every CRC error, it seems communication failure always occurred immediately after CRC error.<br />I'll find another board with crystal and test again.<br /><br />Thanks!<br /><br /><blockquote><div><cite>blargg wrote:</cite>Does the 328p board use a crystal oscillator or ceramic oscillator? I've got several 328p boards and they use ceramic resonators, which have lower accuracy and might cause occasional errors.<br /><br />Also, you could enable CRC checking on the V-USB side, and have it at least ignore packets with incorrect CRCs. Put this in your usbconfig.h:<br /><br /><div class="codebox"><p>Code: </p><pre><code>#define USB_RX_USER_HOOK( data, len ) { \<br />    if ( usbCrc16( data, len + 2 ) != 0x4ffe )\<br />        return;\<br />}<br /></code></pre></div></div></blockquote><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20583">baoshi</a> — Mon Aug 11, 2014 4:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-08-11T09:31:18+02:00</updated>

		<published>2014-08-11T09:31:18+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27903#p27903</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27903#p27903"/>
		<title type="html"><![CDATA[Re: usbFunctionWrite incorrect length, need help]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27903#p27903"><![CDATA[
Does the 328p board use a crystal oscillator or ceramic oscillator? I've got several 328p boards and they use ceramic resonators, which have lower accuracy and might cause occasional errors.<br /><br />Also, you could enable CRC checking on the V-USB side, and have it at least ignore packets with incorrect CRCs. Put this in your usbconfig.h:<br /><br /><div class="codebox"><p>Code: </p><pre><code>#define USB_RX_USER_HOOK( data, len ) { \<br />    if ( usbCrc16( data, len + 2 ) != 0x4ffe )\<br />        return;\<br />}<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Mon Aug 11, 2014 9:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[baoshi]]></name></author>
		<updated>2014-08-11T04:10:12+02:00</updated>

		<published>2014-08-11T04:10:12+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27901#p27901</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27901#p27901"/>
		<title type="html"><![CDATA[usbFunctionWrite incorrect length, need help]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9238&amp;p=27901#p27901"><![CDATA[
Hi,<br /><br />I'm trying V-USB on an ATmega328p board, using INT0 on D- (for USB suspend detection).<br />My project is modified from hid-data example, but I changed HID report size to 18 bytes. I wanted to test USB reliability so in the firmware side I simply copy the SET_REPORT 18 bytes buffer to a static buffer and return them for each GET_REPORT request. Because there are 18 bytes, I suppose the complete transmission should be split into 3 packets and each has 8-8-2 number of bytes.<br /><br />The PC side is modified from hid-data commandline application on Windows 7/MingW, I generate 18 random bytes and send to the device, then get them back for comparison. The test is put in a while loop and I count how many iterations can be made without error.<br /><br />The result appears to be not very solid. I will have an error on every 700-3000 loops randomly. When the error occurs, I can observe the length passed to usbFunctionWrite is not 8 or 2, but 6 (mostly) of the time or 7 (occasionally). This causes mismatch on the amount of data and host will think USB transaction to either stalled or cancelled.<br /><br />I wonder if there are anything I can do to improve it. <br /><br />TIA<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20583">baoshi</a> — Mon Aug 11, 2014 4:10 am</p><hr />
]]></content>
	</entry>
	</feed>
