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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2007-09-18T15:56:27+02:00</updated>

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

		<entry>
		<author><name><![CDATA[mvdoornik]]></name></author>
		<updated>2007-09-18T15:56:27+02:00</updated>

		<published>2007-09-18T15:56:27+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=698&amp;p=2427#p2427</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=698&amp;p=2427#p2427"/>
		<title type="html"><![CDATA[AVR-Doper with 16Mhz crystal]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=698&amp;p=2427#p2427"><![CDATA[
Thanks, Christian! As soon as I can find the time, I'll check it out. Unfortunately, work dictates otherwise at present...<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=375">mvdoornik</a> — Tue Sep 18, 2007 3:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-09-08T20:30:08+02:00</updated>

		<published>2007-09-08T20:30:08+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=698&amp;p=2300#p2300</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=698&amp;p=2300#p2300"/>
		<title type="html"><![CDATA[AVR-Doper with 16Mhz crystal]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=698&amp;p=2300#p2300"><![CDATA[
Yes, the relative branch range is exceeded by one instruction if all endpoints are enabled (as it is required for AVR-Doper).<br /><br />You can fix this by moving the code block around handleIn3:<br /><br /><div class="codebox"><p>Code: </p><pre><code>#if USB_CFG_HAVE_INTRIN_ENDPOINT &amp;&amp; USB_CFG_HAVE_INTRIN_ENDPOINT3<br />handleIn3:<br />    lds     cnt, usbTxLen3      ;&#91;43&#93;<br />    sbrc    cnt, 4              ;&#91;45&#93;<br />    rjmp    sendCntAndReti      ;&#91;46&#93; 48 + 16 = 64 until SOP<br />    sts     usbTxLen3, x1       ;&#91;47&#93; x1 == USBPID_NAK from above<br />    ldi     YL, lo8&#40;usbTxBuf3&#41;  ;&#91;49&#93;<br />    ldi     YH, hi8&#40;usbTxBuf3&#41;  ;&#91;50&#93;<br />    rjmp    usbSendAndReti      ;&#91;51&#93; 53 + 12 = 65 until SOP<br />#endif<br /></code></pre></div><br /><br />just before the bitstuffN label:<br /><br /><div class="codebox"><p>Code: </p><pre><code>#if USB_CFG_HAVE_INTRIN_ENDPOINT    /* placed here due to relative jump range */<br />handleIn1:                      ;&#91;38&#93;<br />#if USB_CFG_HAVE_INTRIN_ENDPOINT3<br />; 2006-06-10 as suggested by O.Tamura: support second INTR IN / BULK IN endpoint<br />    ldd     x2, y+2             ;&#91;38&#93;<br />    sbrc    x2, 0               ;&#91;40&#93;<br />    rjmp    handleIn3           ;&#91;41&#93;<br />#endif<br />    lds     cnt, usbTxLen1      ;&#91;42&#93;<br />    sbrc    cnt, 4              ;&#91;44&#93; all handshake tokens have bit 4 set<br />    rjmp    sendCntAndReti      ;&#91;45&#93; 47 + 16 = 63 until SOP<br />    sts     usbTxLen1, x1       ;&#91;46&#93; x1 == USBPID_NAK from above<br />    ldi     YL, lo8&#40;usbTxBuf1&#41;  ;&#91;48&#93;<br />    ldi     YH, hi8&#40;usbTxBuf1&#41;  ;&#91;49&#93;<br />    rjmp    usbSendAndReti      ;&#91;50&#93; 52 + 12 + 64 until SOP<br />#endif<br /><br />#if USB_CFG_HAVE_INTRIN_ENDPOINT &amp;&amp; USB_CFG_HAVE_INTRIN_ENDPOINT3<br />handleIn3:<br />    lds     cnt, usbTxLen3      ;&#91;43&#93;<br />    sbrc    cnt, 4              ;&#91;45&#93;<br />    rjmp    sendCntAndReti      ;&#91;46&#93; 48 + 16 = 64 until SOP<br />    sts     usbTxLen3, x1       ;&#91;47&#93; x1 == USBPID_NAK from above<br />    ldi     YL, lo8&#40;usbTxBuf3&#41;  ;&#91;49&#93;<br />    ldi     YH, hi8&#40;usbTxBuf3&#41;  ;&#91;50&#93;<br />    rjmp    usbSendAndReti      ;&#91;51&#93; 53 + 12 = 65 until SOP<br />#endif<br /><br />; USB spec says:<br />; idle = J<br />; J = &#40;D+ = 0&#41;, &#40;D- = 1&#41;<br />; K = &#40;D+ = 1&#41;, &#40;D- = 0&#41;<br />; Spec allows 7.5 bit times from EOP to SOP for replies<br /><br />bitstuffN:<br />    eor     x1, x4          ;&#91;5&#93;<br />    ldi     x2, 0           ;&#91;6&#93;<br />    nop2                    ;&#91;7&#93;<br />    nop                     ;&#91;9&#93;<br />    out     USBOUT, x1      ;&#91;10&#93; &lt;-- out<br />    rjmp    didStuffN       ;&#91;0&#93;<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sat Sep 08, 2007 8:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2007-08-31T23:24:16+02:00</updated>

		<published>2007-08-31T23:24:16+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=698&amp;p=2178#p2178</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=698&amp;p=2178#p2178"/>
		<title type="html"><![CDATA[AVR-Doper with 16Mhz crystal]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=698&amp;p=2178#p2178"><![CDATA[
You also have to change F_CPU in hardware.h BTW.<br /><br />Just tried it w/ the doper version currently up for grabs -- after switching to 16MHz, latest WinAVR (avr-gcc 4.1.2, avr-libc 1.4.6) errors when linking:<br /><br /><div class="codebox"><p>Code: </p><pre><code>avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=atmega8 -DDEBUG_LEVEL=0 -o main.bin usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o hvprog.o isp.o serial.o stk500protocol.o timer.o utils.o vreg.o main.o<br />usbdrv/usbdrvasm.o: In function `overflow':<br />usbdrv/usbdrvasm.s: &#40;.text+0x14e&#41;: relocation truncated to fit: R_AVR_7_PCREL against `no symbol'<br />make: *** &#91;main.bin&#93; Error 1</code></pre></div><br />Branch out of range ?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Fri Aug 31, 2007 11:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mvdoornik]]></name></author>
		<updated>2007-08-31T14:42:06+02:00</updated>

		<published>2007-08-31T14:42:06+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=698&amp;p=2165#p2165</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=698&amp;p=2165#p2165"/>
		<title type="html"><![CDATA[AVR-Doper with 16Mhz crystal]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=698&amp;p=2165#p2165"><![CDATA[
Hi,<br /><br />Previously, I have programmed an ATMega8535 @ 16Mhz with the HID Bootloader code, which works fabulously. With avr-gcc, I can now program the entire thing in C from Vim with a single press of &lt;F5&gt; using nothing more than just a USB connection. Sweet! What more could I possibly want? <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=";-)" title="Wink" /><br /><br />Well... <br /><br />Just to get a feel for the possibilities, I've downloaded the AVR-Doper package. As the USB pinout matches what I have (Port D pins 2 and 3), I figured it would be easy. First try at compiling the original code worked a treat, no problems at all. After adding <br /><div class="codebox"><p>Code: </p><pre><code>#define USB_CFG_CLOCK_KHZ 16000</code></pre></div><br />to usbconfig.h, compiling fails:<br /><br /><div class="codebox"><p>Code: </p><pre><code>$ make<br />avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=atmega8535 -DDEBUG_LEVEL=0 -x assembler-with-cpp -c usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o<br />usbdrv/usbdrvasm16.S: Assembler messages:<br />usbdrv/usbdrvasm16.S:226: Error: operand out of range: 64<br />make: *** &#91;usbdrv/usbdrvasm.o&#93; Error 1<br /></code></pre></div><br /><br />So, what am I missing here? I'm using avr-gcc 4.1.0 on Ubuntu Feisty 7.04.<br /><br />Any help is appreciated, as I really want to get this USB stuff (especially serial communication and HID devices, think 'Arduino') going!<br /><br />Marc.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=375">mvdoornik</a> — Fri Aug 31, 2007 2:42 pm</p><hr />
]]></content>
	</entry>
	</feed>
