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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2011-08-02T21:49:47+02:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2011-08-02T21:49:47+02:00</updated>

		<published>2011-08-02T21:49:47+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5587&amp;p=19226#p19226</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=19226#p19226"/>
		<title type="html"><![CDATA[Re: Size optimization for 2k flash (attiny2313)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=19226#p19226"><![CDATA[
Hi Ploravi,<br /><br />now that you fixed it a patch would be great <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=";-)" title="Wink" /><br /><br />Cheers<p>Statistics: Posted by Guest — Tue Aug 02, 2011 9:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ploravi]]></name></author>
		<updated>2011-08-01T18:40:07+02:00</updated>

		<published>2011-08-01T18:40:07+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5587&amp;p=19211#p19211</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=19211#p19211"/>
		<title type="html"><![CDATA[Re: Size optimization for 2k flash (attiny2313)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=19211#p19211"><![CDATA[
Daid, i checkd your code, as you mentioned it is not working. but i did few modificaions and used with my app. seems it doing wel. thanks a lot.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5559">ploravi</a> — Mon Aug 01, 2011 6:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Daid]]></name></author>
		<updated>2011-05-23T13:30:38+02:00</updated>

		<published>2011-05-23T13:30:38+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18539#p18539</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18539#p18539"/>
		<title type="html"><![CDATA[Re: Size optimization for 2k flash (attiny2313)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18539#p18539"><![CDATA[
Your are right, the HEX file is larger then 2k, because the HEX file is in plain text HEX with extra data (<a href="http://en.wikipedia.org/wiki/Intel_HEX" class="postlink">Intel HEX format</a>) So this uses about 2bytes in the hex file for each final byte in the AVR flash.<br />The correct way to get the size of the final flash is by using the &quot;avr-size&quot; tool on the hex file.<br /><br />Note, if you are new to V-USB I recommend you use a larger chip then the ATTiny2313, this chip is very limited and you are better off with a larger ATMega.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5154">Daid</a> — Mon May 23, 2011 1:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[klalle]]></name></author>
		<updated>2011-05-17T21:57:01+02:00</updated>

		<published>2011-05-17T21:57:01+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18498#p18498</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18498#p18498"/>
		<title type="html"><![CDATA[Re: Size optimization for 2k flash (attiny2313)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18498#p18498"><![CDATA[
Hi!<br />I am a new to the v-usb thing, and i probably have a really stupid question about the filesize: <br />when i download the powerswitch files (or your reduzed version above) and unzips it, it tells me that the filesize of the .hex is 5,11kB, ( 3,34kB on your reduced version...). Am i trying to upload the wrong .hex file to my attiny2313? (main.hex)?<br />same size when i recompile the makefile my selves with WinAVR... (not sure i am actually getting the avr-gcc to work!?, but it makes an hex-file anyway)<br />Of course the files are not even close to fit on my chip! <br />would be very happy if someone could help me out and send me a working .hex file to upload to my chip!<br />I just want to be able to use the on and off functions, so i am not really keen on learning all the functions available on the v-usb (yet <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=";)" title="Wink" /><br />Thanks allot for your help!<br />//Kalle (kalle.lofgren (at) gmail.com)<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5261">klalle</a> — Tue May 17, 2011 9:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Daid]]></name></author>
		<updated>2011-04-21T23:04:57+02:00</updated>

		<published>2011-04-21T23:04:57+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18270#p18270</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18270#p18270"/>
		<title type="html"><![CDATA[Re: Size optimization for 2k flash (attiny2313)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18270#p18270"><![CDATA[
My lastest code can be found at:<br /><!-- m --><a class="postlink" href="http://daid2.mine.nu/~daid/tiny2313_vusb.tgz">http://daid2.mine.nu/~daid/tiny2313_vusb.tgz</a><!-- m --><br /><br />It stands at 1206 bytes. You could save a few more bytes by moving more variables to GPIOR (GPIOR0 is used as usbMsgFlags, which saves a 8 bytes, the ATTiny2313 has 3 GPIO registors)<br /><br />Note, I haven't actually tested this version, so it might not work!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5154">Daid</a> — Thu Apr 21, 2011 11:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dzairo]]></name></author>
		<updated>2011-04-20T17:07:22+02:00</updated>

		<published>2011-04-20T17:07:22+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18262#p18262</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18262#p18262"/>
		<title type="html"><![CDATA[Re: Size optimization for 2k flash (attiny2313)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18262#p18262"><![CDATA[
Hi.<br />I read your post and it's very interesting.<br />Is possible to make low size byte project and post in this web???<br />if you can then optimize to minimum code size , there are more people who want it.<br /><br />regards<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4367">dzairo</a> — Wed Apr 20, 2011 5:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Daid]]></name></author>
		<updated>2011-04-19T17:03:38+02:00</updated>

		<published>2011-04-19T17:03:38+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18251#p18251</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18251#p18251"/>
		<title type="html"><![CDATA[Re: Size optimization for 2k flash (attiny2313)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18251#p18251"><![CDATA[
Just reporting back that I got down to 1200 bytes. Which seems to be the 1.2k you where asking for. You can get down to 1400~1300 bytes by removing the mouse code, and not using usbFunctionRead/usbFunctionWrite.<br />The last 100~200 bytes where gained by a lot of tiny optimizations.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5154">Daid</a> — Tue Apr 19, 2011 5:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2011-04-15T15:01:53+02:00</updated>

		<published>2011-04-15T15:01:53+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18192#p18192</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18192#p18192"/>
		<title type="html"><![CDATA[Re: Size optimization for 2k flash (attiny2313)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18192#p18192"><![CDATA[
I don't think V-USB can get much smaller, but can experiment a bit to get the code a bit smaller.<br /><br />First, 20Mhz seems to generate the smallest code.<br />Next, including &quot;usbdrv.c&quot; seems to generate larger code in my case, even with the &quot;#define USB_PUBLIC static&quot; define.<br /><br />With the HID-Mouse example then I'm down to 1782 bytes.<br /><br />Now, you can remove the Vendor and Device name, which is not allowed when you use the free PID/VID supplied. After removing the default example of &quot;obdev.at&quot; and &quot;Mouse&quot; it saves 68 bytes. Bringing the size down to 1714 bytes.<br /><br />Removing all the watchdog code from the main.c (just make sure it's never enabled), saves 22 bytes. Down to 1692.<br /><br />This is a mouse, so the HidReportDescriptor is 52 bytes. But if you want just a single report you can get down to 24 bytes. Saving another 28 bytes.<br /><br />If you don't use other interrupts then INT0 then you can provide a custom crt0 to put code in the interrupt vector table, after the INT0 vector. And get rid of the __bad_interrupt. Saving another 36 bytes.<br />As we are hacking crt0 then already, we can get rid of the _exit routine, as we  know our main never returns. Removing the jump to _exit, and removing _exit itself saves 6 bytes.<br /><br />With still a working mouse example, I'm down to 1650 bytes. One of the hid-mouse functions is 122 bytes (advanceCircleByFixedAngle)<br />So if I get rid of that one, I have about 450~500 bytes to work with in the ATTiny2313.<p>Statistics: Posted by Guest — Fri Apr 15, 2011 3:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jokkebk]]></name></author>
		<updated>2011-04-12T22:42:50+02:00</updated>

		<published>2011-04-12T22:42:50+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18133#p18133</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18133#p18133"/>
		<title type="html"><![CDATA[Size optimization for 2k flash (attiny2313)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5587&amp;p=18133#p18133"><![CDATA[
Just downloaded the PowerSwitch demo and compiled it for attiny2313 (I think). The program seems to take 1856 bytes for the V-USB library and the &quot;most basic example program&quot; alone. I think it's a great library but it seems unlikely I will be able to fit much additional logic into the remaining 150 bytes or so - are there any size optimization tips or efforts underway to make it the firmware codebase even smaller (something like 1.2k would be great, although probably not possible : ) in the future?<br /><br />Thanks and keep up the good work!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5127">jokkebk</a> — Tue Apr 12, 2011 10:42 pm</p><hr />
]]></content>
	</entry>
	</feed>
