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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2015-06-07T22:21:56+02:00</updated>

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

		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2015-06-07T22:21:56+02:00</updated>

		<published>2015-06-07T22:21:56+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9864&amp;p=29827#p29827</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9864&amp;p=29827#p29827"/>
		<title type="html"><![CDATA[Re: Trouble with ATmega328P + V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9864&amp;p=29827#p29827"><![CDATA[
The 1M pulldown resistor isn't something I see in V-USB designs. Also, I couldn't find a pinout for your USB connector to verify that you have D+ and D- connected as listed in the schematic. If these don't yield anything, I'd put a very basic USB project on it first. Even an LED blink to be sure that the clock is working.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Sun Jun 07, 2015 10:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GarrettVD]]></name></author>
		<updated>2015-06-06T08:08:34+02:00</updated>

		<published>2015-06-06T08:08:34+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9864&amp;p=29815#p29815</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9864&amp;p=29815#p29815"/>
		<title type="html"><![CDATA[Trouble with ATmega328P + V-USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9864&amp;p=29815#p29815"><![CDATA[
Hi all,<br /><br />I'll preface this thread by stating that I'm relatively new to embedded development in general, so please forgive me if I've gleened over something completely obvious to a more experienced dev out there!<br /><br />So, I'm having some trouble getting my ATmega328P to successfully be recognized as a low-speed USB device when connected to a Linux (Ubuntu 14.10) or Windows 8.1 host.<br /><br /><ul><li>I'm using the V-USB library (release version 20121206).</li><li>I'm using an STK500 V2 programmer, connected to my Windows 8.1 host via a Prolific USB-to-RS232 adapter on port COM2.</li><li>I've created a GCC C Executable Project in Atmel Studio 6.2 and I'm compiling using avr-gcc in a Windows 8.1 environment.<br />Flashing and setting fuses using avrdude.</li><li>I'm using a 16MHz external crystal oscillator.</li><li>I've set the HIGH fuse to 0xD1 and LOW fuse to 0xFF, which appear to be the correct settings for use of an external 16MHz clock with a slow startup.</li></ul><br />I've read a few threads on this forum and an article within the V-USB Wiki that suggested some wonky behaviour with P-suffixed devices, and specifically mentioned that building for the ATmega168 instead of the ATMega328P may resolve the problem.  But after much fiddling about with the Makefile, I've yet to get the device to be recognized!<br />Schematic-wise, I'm basing this off of one I found on these forums (<!-- m --><a class="postlink" href="http://img607.imageshack.us/img607/7831/ai00.png">http://img607.imageshack.us/img607/7831/ai00.png</a><!-- m -->) with the addition of an LED + 680R from PC3 to GND.<br /><br />I'd had a hunch that perhaps it was something to do with the zeners; I'm using 0.5W 3v6 Zener diodes (1N5227B), which when testing voltage on the D- line, only appears to be providing 2.6V instead of the 3.3V as expected.  Because of this, I temporary removed the zeners and used a combination of an LM317 variable voltage regulator and two BC517 NPNs to get the voltage into a reasonable 3.3V range.  Still, no luck.<br />Any help would be greatly appreciated.<br /><br />You can <a href="https://bitbucket.org/gvandyk/atmega328p-v-usb/src/37b80027c8a41839b61f4249e3e19e075378f369/GccApplication1/?at=master" class="postlink">download / check out my code on my BitBucket repo</a>, some error messages when performing &quot;make program&quot;, as well as some logged errors from dmesg on Ubuntu.<br /><br /><div class="codebox"><p>Code: </p><pre><code>&#91;103420.573274&#93; usb 2-1.3: new full-speed USB device number 87 using ehci-pci<br />&#91;103420.661214&#93; usb 2-1.3: device descriptor read/64, error -32<br />&#91;103420.853549&#93; usb 2-1.3: device descriptor read/64, error -32<br />&#91;103421.029716&#93; usb 2-1.3: new full-speed USB device number 88 using ehci-pci<br />&#91;103421.437722&#93; usb 2-1.3: device not accepting address 88, error -32<br />&#91;103421.509886&#93; usb 2-1.3: new full-speed USB device number 89 using ehci-pci<br />&#91;103421.918192&#93; usb 2-1.3: device not accepting address 89, error -32<br />&#91;103421.918412&#93; hub 2-1:1.0: unable to enumerate USB device on port 3<br /></code></pre></div><br /><br /><div class="codebox"><p>Code: </p><pre><code>C:\Users\Garrett\Documents\Atmel Studio\6.2\GccApplication1\GccApplication1&gt; make program<br />avrdude -c stk500v2 -p atmega328p -P com2  -U flash:w:main.hex:i<br /><br />avrdude: AVR device initialized and ready to accept instructions<br /><br />Reading | ################################################## | 100% 0.06s<br /><br />avrdude: Device signature = 0x1e950f<br />avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed<br />         To disable this feature, specify the -D option.<br />avrdude: erasing chip<br />avrdude: reading input file &quot;main.hex&quot;<br />avrdude: writing flash (1510 bytes):<br /><br />Writing | ################################################## | 100% 0.84s<br /><br />avrdude: 1510 bytes of flash written<br />avrdude: verifying flash memory against main.hex:<br />avrdude: load data flash data from input file main.hex:<br />avrdude: input file main.hex contains 1510 bytes<br />avrdude: reading on-chip flash data:<br /><br />Reading | ################################################## | 100% 0.56s<br /><br />avrdude: verifying ...<br />avrdude: 1510 bytes of flash verified<br /><br />avrdude: safemode: Fuses OK<br /><br />avrdude done.  Thank you.<br /><br />avrdude -c stk500v2 -p atmega328p -P com2  -U hfuse:w:0xd1:m -U lfuse:w:0xff:m<br /><br />avrdude: AVR device initialized and ready to accept instructions<br /><br />Reading | ################################################## | 100% 0.05s<br /><br />avrdude: Device signature = 0x1e950f<br />avrdude: reading input file &quot;0xd1&quot;<br />avrdude: writing hfuse (1 bytes):<br /><br />Writing | ################################################## | 100% 0.01s<br /><br />avrdude: 1 bytes of hfuse written<br />avrdude: verifying hfuse memory against 0xd1:<br />avrdude: load data hfuse data from input file 0xd1:<br />avrdude: input file 0xd1 contains 1 bytes<br />avrdude: reading on-chip hfuse data:<br /><br />Reading | ################################################## | 100% 0.01s<br /><br />avrdude: verifying ...<br />avrdude: 1 bytes of hfuse verified<br />avrdude: reading input file &quot;0xff&quot;<br />avrdude: writing lfuse (1 bytes):<br /><br />Writing | ################################################## | 100% 0.01s<br /><br />avrdude: 1 bytes of lfuse written<br />avrdude: verifying lfuse memory against 0xff:<br />avrdude: load data lfuse data from input file 0xff:<br />avrdude: input file 0xff contains 1 bytes<br />avrdude: reading on-chip lfuse data:<br /><br />Reading | ################################################## | 100% 0.01s<br /><br />avrdude: verifying ...<br />avrdude: 1 bytes of lfuse verified<br /><br />avrdude: safemode: Fuses OK<br /><br />avrdude done.  Thank you.<br /></code></pre></div><br /><br />Thanks,<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=21380">GarrettVD</a> — Sat Jun 06, 2015 8:08 am</p><hr />
]]></content>
	</entry>
	</feed>
