<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Qball's Weblog &#187; atmel</title>
	<atom:link href="http://blog.sarine.nl/category/atmel/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sarine.nl</link>
	<description>Beati pauperes spiritu</description>
	<lastBuildDate>Sun, 04 Jul 2010 19:34:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Atmel coding, Getting some space to play with.</title>
		<link>http://blog.sarine.nl/2007/01/25/atmel-coding-getting-some-space-to-play-with/</link>
		<comments>http://blog.sarine.nl/2007/01/25/atmel-coding-getting-some-space-to-play-with/#comments</comments>
		<pubDate>Thu, 25 Jan 2007 22:04:56 +0000</pubDate>
		<dc:creator>Qball</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[atmel]]></category>

		<guid isPermaLink="false">http://wordpress.qballcow.nl/2007/01/25/atmel-coding-getting-some-space-to-play-with/</guid>
		<description><![CDATA[I had an atmel mega 16 lying around that didn&#8217;t react to the programmer anymore. This was caused because some wrong fuse bits where set (It expected an external clock). I never took the time to find a way to fix it, but being in need of more space. I&#8217;ve looked around my to see [...]]]></description>
			<content:encoded><![CDATA[<p>I had an atmel mega 16 lying around that didn&#8217;t react to the programmer anymore. This was caused because some wrong fuse bits where set (It expected an external clock). I never took the time to find a way to fix it, but being in need of more space. I&#8217;ve looked around my to see if there was something I could steal a decent clock from. After some looking around I found a device that had a PIC on it, with a decent clock signal, borrowing this clock I was able to correct this error.</p>
<p>The atmel mega16 has alot more space as the atmel tiny2313 (the name kind of suggest this). It has twice the amount of pins, which is nice. The best improvement is flash and sram. The mega 16 comes with 16kbyte program space (vs 2kb) and 1k of sram (vs 128b).</p>
<p>This is a huge improvement.Â  So now I had the space to get my ds1820 temperature sensor(s) to work.Â  Grabbing some code found via google modifying it a bit to be more correct it worked<br />
after a fashion.</p>
<p>There is one nice thing on the tiny that I kind of miss on the atmega16, that is beside the 2 external interrupts it has a bus-wide interrupt. So if any of the lines of the bus changed state, I would get a interrupt, this is very nice for efficient keypads.Â  On the atmega16, I have just 2 interrupts.Â  What I did now (and it works pretty good, but it&#8217;s ugly), I just constantly poll (when the atmel is doing nothing anyway) the inputs for changes.Â Â  I need to find a nice solution for this.<br />
Having all the space I need, in less then 2 hours I had most of the code done, and I am now going to play around making a pcb.Â  (suggestions for software is welcome.)</p>
<p>More in-depth stuff coming later&#8230;..</p>
<p>Qball</p>
<p>p.s. I am looking for some open source software that can take visual diff&#8217;s from images. anybody knows if this exists?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sarine.nl/2007/01/25/atmel-coding-getting-some-space-to-play-with/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Atmel Coding, Optimalisation</title>
		<link>http://blog.sarine.nl/2007/01/20/atmel-coding-optimalisation/</link>
		<comments>http://blog.sarine.nl/2007/01/20/atmel-coding-optimalisation/#comments</comments>
		<pubDate>Sat, 20 Jan 2007 22:16:59 +0000</pubDate>
		<dc:creator>Qball</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[atmel]]></category>

		<guid isPermaLink="false">http://wordpress.qballcow.nl/2007/01/20/atmel-coding-optimalisation/</guid>
		<description><![CDATA[Hitting the 2k program space, I looked to improve the code size. Realizing that using a 16bit value for bit-masks is quiet inefficient on a 8bit avr. Because I don&#8217;t store a value larger then 8bit in there, I split the 16bit variable into 2x8bitÂ  variables. This saves allot of cyclesÂ  moving stuff unneededÂ  around. [...]]]></description>
			<content:encoded><![CDATA[<p>Hitting the 2k program space, I looked to improve the code size.</p>
<p>Realizing that using a 16bit value for bit-masks is quiet inefficient on a 8bit avr. Because I don&#8217;t store a value larger then 8bit in there, I split the 16bit variable into 2x8bitÂ  variables.</p>
<p>This saves allot of cyclesÂ  moving stuff unneededÂ  around. It will also run faster, but this wasn&#8217;t bottleneck.</p>
<p>The actual gain was around 15%,Â  it now <em>only</em> uses 1792 bytes. So now I can add features again.</p>
<p>There is one optimalisation left todo, I store &#8220;Mon&#8221;,Â  &#8220;Tue&#8221;, etc in an array, this is constantly kept in sram. It would be nice if I could do this smarter, so it won&#8217;t use the sram.</p>
<p>Qball</p>
<p>p.s. still looking for features to add.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sarine.nl/2007/01/20/atmel-coding-optimalisation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Atmel Coding, unexpected errors</title>
		<link>http://blog.sarine.nl/2007/01/19/atmel-coding-unexpected-errors/</link>
		<comments>http://blog.sarine.nl/2007/01/19/atmel-coding-unexpected-errors/#comments</comments>
		<pubDate>Fri, 19 Jan 2007 21:20:06 +0000</pubDate>
		<dc:creator>Qball</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[atmel]]></category>

		<guid isPermaLink="false">http://wordpress.qballcow.nl/2007/01/19/atmel-coding-unexpected-errors/</guid>
		<description><![CDATA[An atmel uses one clock, in my case I use an external crystal (if you run a clock on it, you don&#8217;t want an RC oscilator). Something you should keep in mind is, that (unless specified otherwise) the atmel uses this clock for everything. You timers, interfaces, etc. This can lead to some unexpected problems, [...]]]></description>
			<content:encoded><![CDATA[<p>An atmel uses one clock, in my case I use an external crystal (if you run a clock on it, you don&#8217;t want an RC oscilator). Something you should keep in mind is, that (unless specified otherwise) the atmel uses this clock for everything. You timers, interfaces, etc.</p>
<p>This can lead to some unexpected problems, for example the uart. The uart (serial port) needs to transmit/recieve the data at a certain speed, for example 57k6 bit/sec. The whole crux is that it has to generate this from the mainÂ  clock, and this isn&#8217;t always a nice match.</p>
<p>So if you f.e. run your atmel with a 8mhz crystal the atmel produces an error of -3.5%, and for 115k2 even worse: 8.5%. This can lead to a problem with certain serial ports. So when it works fine on your desktop pc, it can fail on your laptop, or when using a serial->usb dongle (this happened to me, on more then one occasion)<br />
Because this are those little bugs that can be hard to figure out, so I thought lets blog about it.</p>
<p>More atmel related blogs to come, I don&#8217;t know at what level you people will still read it. Should I go into much details?</p>
<p>Qball</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sarine.nl/2007/01/19/atmel-coding-unexpected-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Atmel coding, commen errors</title>
		<link>http://blog.sarine.nl/2007/01/17/atmel-coding-commen-errors/</link>
		<comments>http://blog.sarine.nl/2007/01/17/atmel-coding-commen-errors/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 22:43:33 +0000</pubDate>
		<dc:creator>Qball</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[atmel]]></category>

		<guid isPermaLink="false">http://wordpress.qballcow.nl/2007/01/17/atmel-coding-commen-errors/</guid>
		<description><![CDATA[I&#8217;ve posted in a previous post that I implemented a clock in the atmel, and that there is an offset because of the time it takes between the calling of the signal, and me setting the counter back to 0. This wasn&#8217;t true,Â  I run the counter with a prescaler of 1/256. So the value [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve posted in a <a href="http://wordpress.qballcow.nl/2007/01/16/turning-it-a-notch-down-from-1024mbyte-to-only-128byte-of-memory/">previous post</a> that I implemented a clock in the atmel, and that there is an offset because of the time it takes between the calling of the signal, and me setting the counter back to 0.</p>
<p>This wasn&#8217;t true,Â  I run the counter with a prescaler of 1/256. So the value of the clock is incremented every 256 cycles. So between calling the signal, and setting it to 0, I have more then sufficient clock cycles. I just have todo it within 256 cycles. One problem solved or not?</p>
<p>In the documentation it&#8217;s not 100% clear if the signal is directly called when the counter matches, or one counter cycle (so 256 clock cycle later).Â  I have to look into this, but solving this misunderstanding did give me a way to correctly backtrace what it does.</p>
<p>Q</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sarine.nl/2007/01/17/atmel-coding-commen-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
