<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Yet Another Hacker&#039;s Blog</title>
	<atom:link href="http://yetanotherhackersblog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://yetanotherhackersblog.wordpress.com</link>
	<description>Just another WordPress.com site</description>
	<lastBuildDate>Wed, 22 Feb 2012 23:03:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='yetanotherhackersblog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Yet Another Hacker&#039;s Blog</title>
		<link>http://yetanotherhackersblog.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://yetanotherhackersblog.wordpress.com/osd.xml" title="Yet Another Hacker&#039;s Blog" />
	<atom:link rel='hub' href='http://yetanotherhackersblog.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Beaglebot &#8211; A BeagleBoard based robot</title>
		<link>http://yetanotherhackersblog.wordpress.com/2012/01/03/beaglebot-a-beagleboard-based-robot/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2012/01/03/beaglebot-a-beagleboard-based-robot/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 10:57:38 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[beagleboard]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[imu]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=205</guid>
		<description><![CDATA[Over the last 6 months or so I&#8217;ve been working on a BeagleBoard based robot. The motivation for this was to build a general robotics platform to try out some ideas I have on Simultaneous Localization and Mapping (SLAM) and robust sensor &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2012/01/03/beaglebot-a-beagleboard-based-robot/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=205&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Over the last 6 months or so I&#8217;ve been working on a <a href="http://beagleboard.org/">BeagleBoard</a> based robot. The motivation for this was to build a general robotics platform to try out some ideas I have on <a href="http://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping">Simultaneous Localization and Mapping</a> (SLAM) and robust <a href="http://en.wikipedia.org/wiki/Sensor_fusion">sensor fusion</a>. Here&#8217;s the result so far:</p>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1228.jpg"><img class="aligncenter size-full wp-image-211" title="Beaglebot" src="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1228.jpg?w=640&#038;h=534" alt="" width="640" height="534" /></a></p>
<p>As you can probably tell from the photo, I&#8217;m a computer programmer, not a mechanical engineer <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The main features are:</p>
<ul>
<li>2 Channel DC motor controller, based on the <a href="http://www.learn-c.com/l298.pdf">L298</a>.</li>
<li>2 <a href="http://www.pololu.com/catalog/product/1217">Pololu Quadrature encoders</a>.</li>
<li>2 Channel servo controller, based on the <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2543.pdf">ATTiny2313</a>.</li>
<li>An <a href="http://www.robot-electronics.co.uk/htm/srf08tech.shtml">SRF08 ultrasonic range finder</a>.</li>
<li>Logitech C600 webcam, streaming raw YUYV frames to a PC.</li>
<li>3 Axis digital compass, based on the <a href="http://seeedstudio.com/wiki/images/4/42/HMC5883.pdf">HMC5883</a>.</li>
<li>3 axis accelerometer, based on the <a href="http://www.analog.com/static/imported-files/data_sheets/ADXL345.pdf">ADXL345</a>.</li>
<li>3 axis gyroscope, based on the <a href="http://www.sparkfun.com/datasheets/Sensors/Gyro/PS-ITG-3200-00-01.4.pdf">ITG-3200</a>.</li>
<li>Asus N10 802.11n wireless network adapter.</li>
<li>Dual 5V <a title="Switched Mode Power Supply for the BeagleBoard" href="http://yetanotherhackersblog.wordpress.com/2011/07/24/switched-mode-power-supply-for-the-beagleboard/">switched mode voltage regulators</a>, based on the <a href="http://www.ti.com/lit/ds/symlink/tps5430.pdf">TPS5430</a>. Each supply is powered by two <a href="http://www.sparkfun.com/products/8483">2000mAh LiPo batteries</a>.</li>
<li>Dual Li-Po Battery Chargers (allowing the robot to charge its batteries and power itself simultaneously), based on the <a href="http://www.ti.com/lit/ds/symlink/bq24123.pdf">BQ24123</a>.</li>
<li>Dual Coulomb counters (for monitoring battery usage), based on the <a href="http://pdfserv.maxim-ic.com/en/ds/DS2782.pdf">DS2782</a>.</li>
</ul>
<h2>Software</h2>
<p>Here&#8217;s the overall architecture of the system:</p>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/12/software-overview.png"><img title="BeagleBot Software Overview" src="http://yetanotherhackersblog.files.wordpress.com/2011/12/software-overview.png?w=825&#038;h=378" alt="" width="825" height="378" /></a></p>
<p>The robot is controlled from a WPF application running on a laptop, which communicates with the robot over an 802.11n wireless network.  Here&#8217;s a screenshot of the app:</p>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/12/screenshot.png"><img class="aligncenter size-full wp-image-219" title="BeagleBot control software" src="http://yetanotherhackersblog.files.wordpress.com/2011/12/screenshot.png?w=640&#038;h=381" alt="" width="640" height="381" /></a></p>
<p>Most of the peripherals on the robot are accessed over the I2C bus, via a C program called i2cproxy. i2cproxy runs on the BeagleBoard and listens on a given port. It responds to simple text commands, for example, &#8216;get 30 10&#8242; (get the value at i2c address 30, register 10), or &#8216;set 30 10 2&#8242; (set address 30, register 10 to the value 2). It also supports burst reads (reading from multiple registers in a single I2C transaction), and automatic polling of I2C registers. The source code for i2cproxy is available <a href="https://github.com/beaglebot/BeagleBot/tree/master/beagleboard/i2cproxy">here</a>.</p>
<p>The WPF application on the laptop communicates with i2cproxy on the BeagleBoard via the <a href="https://github.com/beaglebot/BeagleBot/blob/master/pc/RobotLib/I2C/I2CBus.cs">I2CBus </a>class. Here&#8217;s some sample code using this class (this code runs on the laptop, and accesses the I2C bus on the BeagleBoard):</p>
<pre>// Open the channel.
var bus = new I2CBus();
bus.CommandPort = 2000;
bus.PollPort = 2001;
bus.Connect();

// Get the value at address 30, register 10.
var value = bus.Get(30, 10);

// Set the value of address 30, register 10, to value 2.
bus.Set(30, 10, 2);

// Poll address 30, registers 10-15, every 1000ms.
bus.AddPoll(1000, 30, 10, 6, MyPollCallback, null);</pre>
<p>The BeagleBoard itself runs Ubuntu 11 with a patched 3.1.0 kernel. The root file system was generated with <a href="http://yetanotherhackersblog.wordpress.com/2011/11/06/installing-ubuntu-natty-on-the-beagleboard-with-rootstock/">rootstock</a>. I had previously been using <a href="http://www.angstrom-distribution.org/">Angstrom</a>, however I ran into driver and network issues which were mostly resolved when I switched to Ubuntu.</p>
<h2>Video Streaming</h2>
<p>There are plenty of ways to get a webcam video stream off the BeagleBoard. Two good examples are <a href="http://mjpg-streamer.svn.sourceforge.net/">mjpeg-streamer</a> and <a href="http://gstreamer.freedesktop.org/">gstreamer</a>:</p>
<p><a href="http://mjpg-streamer.svn.sourceforge.net/">mjpeg-streamer</a> lets you stream video from a UVC webcam as an MJPEG sequence over HTTP (MJPEG is essentially a sequence of JPEG images with the JPEG DHT segment omitted). Its relatively small so you can build it on the BeagleBoard itself and avoid the hassles of cross-compilation (though you will need your kernel headers and the libjpeg8 package). Here&#8217;s an example command-line:</p>
<pre>./mjpg_streamer -i plugins/input_uvc/input_uvc.so -o "plugins/output_http/output_http.so -p 5000"</pre>
<p>You can view the resulting video stream in Chrome or Firefox by typing:</p>
<pre> http://192.168.0.70:5000/?action=stream</pre>
<p>into your address bar (obviously change the IP).</p>
<p><a href="http://gstreamer.freedesktop.org/">gstreamer</a> is incredibly flexible, and lets you do almost anything, provided you can work out the appropriate command-line incantation. Here&#8217;s a command line which transmits JPEG encoded frames over TCP/IP:</p>
<pre>gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)5/1 ! ffmpegcolorspace ! jpegenc ! multipartmux ! tcpserversink port=5000</pre>
<p>This requires the &#8216;gstreamer0.10-plugins-good&#8217; package. You can view the video stream on another machine using <a href="http://www.videolan.org/vlc/">VLC media player</a>. Open VLC, got to Media-&gt;Open Network Stream, and type in &#8216;tcp://192.168.0.70&#8242;, and you should be up and running.</p>
<h2>Lossless Video Streaming</h2>
<p>I&#8217;m planning to run the video stream through a set of image processing algorithms on the laptop. To do this effectively the transmitted image frames can&#8217;t have <a href="http://en.wikipedia.org/wiki/JPEG#Compression_ratio_and_artifacts">compression artifacts</a> introduced by lossy compression codecs, like MJPEG or MPEG, as they&#8217;re likely to cause issues with the image processing. I need either a lossless codec, or to transmit the raw frames.</p>
<p>I tried a few lossless codecs without much success:</p>
<ul>
<li>I tried <a href="http://en.wikipedia.org/wiki/Portable_Network_Graphics">PNG</a> encoding frames in gstreamer, however I couldn&#8217;t get this to transmit a stream of images (it seems to stall the gstreamer pipeline after encoding a single image).</li>
<li>The ffmpeg gstreamer package has a lossless video codec, ffenc_ffv1. Unfortunately this completely saturated the BeagleBoard&#8217;s CPU (see <a href="http://compression.ru/video/codec_comparison/lossless_codecs_2007_en.html">here</a> for a review of other lossless video codecs).</li>
<li>I also tried JPEG encoding the frames with maximum quality, which doesn&#8217;t produce any human visible artifacts (though they still may be visible to the image processing algorithms). This results in CPU usage of around 55% with a 320&#215;200 image at 15fps, which is still too high.</li>
</ul>
<p>Lossless video compression tends not to compress particularly well anyway (perhaps a ratio of 2:1) so I ended up writing a small C application, uvcstreamer, which just transmits the raw image frames over TCP/IP. My webcam (a Logitech C600) outputs frames natively in <a href="http://v4l2spec.bytesex.org/spec/r4339.htm">YUYV</a> pixel format which has a down-sampled chroma channel, which reduces the frame size by 25% anyway.  Here&#8217;s the <a href="https://github.com/beaglebot/BeagleBot/tree/master/beagleboard/uvcstreamer">source code for uvcstreamer</a>.</p>
<p>The image stream is received on the laptop and converted to a <a href="http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx">System.Drawing.Bitmap</a> suitable for display in the WPF application by the <a href="https://github.com/beaglebot/BeagleBot/blob/master/pc/RobotLib/Components/Camera.cs">Camera class</a>.</p>
<h2>Mainboard</h2>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1222.jpg"><img class="aligncenter size-full wp-image-207" title="Beaglebot Mainboard" src="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1222.jpg?w=640&#038;h=426" alt="" width="640" height="426" /></a></p>
<p>The mainboard is responsible for supplying regulated power to the BeagleBoard, motors and expansion boards, <a href="http://yetanotherhackersblog.wordpress.com/2011/04/07/interfacing-the-beagleboard-with-an-srf08-ultrasonic-ranger-over-i2c/#LevelTranslation">level converting</a> the BeagleBoard&#8217;s 1.8V I2C bus to 3.3V and 5V, and managing battery charging. The board is home-made using the <a href="http://yetanotherhackersblog.wordpress.com/2011/04/05/going-surface-mount/">photo-resist method</a>.</p>
<p>Initially I used a single power supply for the BeagleBoard and DC motors, however the DC motors drew to much current on start up, occasionally dropping the system voltage to the point where the BeagleBoard would reset, hence the dual power supply setup.</p>
<p>As described <a href="http://yetanotherhackersblog.wordpress.com/2011/07/24/switched-mode-power-supply-for-the-beagleboard/">here</a>, I&#8217;ve used switched mode regulators, rather than simple linear regulators. Switched mode regulators have a lot more external components, but can function at 95% efficiency, which makes a huge difference to battery life and heat output (a linear regulator would get 60% efficiency in the same situation).</p>
<p>The mainboard also includes two <a href="http://www.ti.com/lit/ds/symlink/bq24123.pdf">BQ24123</a> charger ICs (one for each channel). These can supply up to 2A, so they&#8217;re able to supply enough current to simultaneously charge the batteries and run the robot. Unfortunately these ICs come in a QFN package which is a <a href="http://yetanotherhackersblog.wordpress.com/2011/08/19/hot-air-soldering-qfn-packages/">bastard to solder</a>.</p>
<p>The microcontroller in the center of the board is used to manage the charging, and expose the current charge state over the I2C bus. A couple of <a href="http://pdfserv.maxim-ic.com/en/ds/DS2782.pdf">DS2782</a> coulomb counter ICs are also used to keep track of the voltage, current and charge remaining. The eventual plan is to have the robot autonomously find a charging station and charge itself when the battery is running low (note the &#8216;eventual&#8217;).</p>
<h2>Motor Controller</h2>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1223.jpg"><img class="aligncenter size-full wp-image-208" title="Beaglebot Motor Controller" src="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1223.jpg?w=640&#038;h=325" alt="" width="640" height="325" /></a></p>
<p>The motor controller is pretty simple: it uses an <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2543.pdf">ATTiny2313</a> microcontroller to generate a PWM signal which is used to drive the <a href="http://www.learn-c.com/l298.pdf">L298</a> IC. The L298 contains two H-Bridges which drive the motors. The microcontroller exposes the motor state and speed through a set of I2C registers.</p>
<p>The microcontroller uses a modified version of Donald Blake&#8217;s TWI/I2C code (I&#8217;ve modified the original code to be register-based, and to support burst-reading). The modified I2C slave code is <a href="https://github.com/beaglebot/BeagleBot/tree/master/microcontrollers/common">here</a>.</p>
<p>One motor on each side of the robot is also equipped with a <a href="http://www.pololu.com/catalog/product/1217">Pololu quadrature encoder</a> for keeping track of wheel rotations. The output from the quadrature encoders is fed into the microcontroller and exposed over I2C (though I haven&#8217;t got the code for this running yet).</p>
<p>Electrical noise from the motors was initially a big problem, causing the microcontrollers to occasionally spontaneously reset. This was fixed by adding some capacitors across the motor terminals, as described <a href="http://www.superdroidrobots.com/product_info/motor_wiring.aspx">here</a>.</p>
<p><a href="https://github.com/beaglebot/BeagleBot/tree/master/microcontrollers/motorcontroller">Motor Controller Source Code</a> (An AVR Studio/GCC project)</p>
<h2>Servo Controller</h2>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1227.jpg"><img class="aligncenter size-full wp-image-210" title="Beaglebot Servo Controller" src="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1227.jpg?w=640&#038;h=351" alt="" width="640" height="351" /></a></p>
<p>Servos are easy to control with a microcontroller &#8211; have a look at <a href="http://servocity.com/html/how_do_servos_work_.html">this page</a> for a quick description of the type of control signals a servo is expecting. The ATTiny2313 has a 16 bit timer with 2 output compare units (one for each servo) which makes generating the appropriate signals pretty easy (it can be done completely in hardware). The servos are controlled by a set of I2C registers.</p>
<p><a href="https://github.com/beaglebot/BeagleBot/tree/master/microcontrollers/servocontroller">Servo Controller Source Code</a> (An AVR Studio/GCC project)</p>
<h2>IMU Expansion Board</h2>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1224.jpg"><img class="aligncenter size-full wp-image-209" title="Beaglebot IMU Expansion Board" src="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1224.jpg?w=640&#038;h=361" alt="" width="640" height="361" /></a></p>
<p>This expansion board contains an <a href="http://seeedstudio.com/wiki/images/4/42/HMC5883.pdf">HMC5882</a> digital compass, and <a href="http://www.analog.com/static/imported-files/data_sheets/ADXL345.pdf">ADXL345 </a>accelerometer, and an <a href="http://www.sparkfun.com/datasheets/Sensors/Gyro/PS-ITG-3200-00-01.4.pdf">ITG-3200</a> gyroscope (all 3 axis). All 3 ICs use the I2C bus.</p>
<p>I&#8217;m still working on the code to sample, filter, and integrate the various values. I&#8217;ve got a prototype up and running which uses a dedicated interrupt line for each IC which is used to notify the BeagleBoard when a new sample is ready to be read (this should result in more efficient and accurate sampling than polling). The interrupt is passed through to userspace on the BeagleBoard via the <a href="http://bec-systems.com/site/281/how-to-implement-an-interrupt-driven-gpio-input-in-linux">gpio_keys</a> driver. Using expansion header pins as interrupts also requires <a href="http://elinux.org/BeagleBoardPinMux">changing the mux settings</a>. I&#8217;ll post this code when its up and running.</p>
<p>Thanks for reading!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=205&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2012/01/03/beaglebot-a-beagleboard-based-robot/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1228.jpg" medium="image">
			<media:title type="html">Beaglebot</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/12/software-overview.png" medium="image">
			<media:title type="html">BeagleBot Software Overview</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/12/screenshot.png" medium="image">
			<media:title type="html">BeagleBot control software</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1222.jpg" medium="image">
			<media:title type="html">Beaglebot Mainboard</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1223.jpg" medium="image">
			<media:title type="html">Beaglebot Motor Controller</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1227.jpg" medium="image">
			<media:title type="html">Beaglebot Servo Controller</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/12/img_1224.jpg" medium="image">
			<media:title type="html">Beaglebot IMU Expansion Board</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing the BeagleBoard I2C Bus Frequency</title>
		<link>http://yetanotherhackersblog.wordpress.com/2011/11/06/changing-the-beagleboard-i2c-bus-frequency/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2011/11/06/changing-the-beagleboard-i2c-bus-frequency/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 02:34:09 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[beagleboard]]></category>
		<category><![CDATA[frequency]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=182</guid>
		<description><![CDATA[The stock kernel runs the I2C bus exposed on the BeagleBoard&#8217;s expansion header (bus 2) at 400KHz  (&#8216;Fast&#8217; mode). This is fine for most I2C slaves, however it seems to be too fast for slaves running on ATTiny and ATMega &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2011/11/06/changing-the-beagleboard-i2c-bus-frequency/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=182&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The stock kernel runs the I2C bus exposed on the BeagleBoard&#8217;s expansion header (bus 2) at 400KHz  (&#8216;Fast&#8217; mode). This is fine for most I2C slaves, however it seems to be too fast for slaves running on ATTiny and ATMega microcontrollers, even when running with an 8MHz clock. For me this was resulting in intermittent bus lock-ups when attempting to access the slave.</p>
<p>The I2C bus speed is set in the kernel in /arch/arm/mach-omap2/board-omap3beagle.c on this line:</p>
<pre>omap_register_i2c_bus(2, <strong>400</strong>, beagle_i2c2_boardinfo, ARRAY_SIZE(beagle_i2c2_boardinfo));</pre>
<p>A bus speed of 100KHz seems to work reliably with the ATTiny2313. If you&#8217;re using Ubuntu you can use the instructions at the end of <a title="Installing Ubuntu (Natty) on the BeagleBoard with RootStock" href="http://yetanotherhackersblog.wordpress.com/2011/11/06/installing-ubuntu-natty-on-the-beagleboard-with-rootstock/">this article</a> to rebuild a BeagleBoard-specific kernel.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/182/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=182&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2011/11/06/changing-the-beagleboard-i2c-bus-frequency/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Ubuntu (Natty) on the BeagleBoard with RootStock</title>
		<link>http://yetanotherhackersblog.wordpress.com/2011/11/06/installing-ubuntu-natty-on-the-beagleboard-with-rootstock/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2011/11/06/installing-ubuntu-natty-on-the-beagleboard-with-rootstock/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 02:31:22 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[beagleboard]]></category>
		<category><![CDATA[rootstock]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=179</guid>
		<description><![CDATA[There are prebuilt Ubuntu images suitable for the BeagleBoard, however if you want more control over what&#8217;s included in your filesystem, and your kernel, RootStock is a good option. RootStock will assemble a complete Ubuntu file system, a kernel image and &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2011/11/06/installing-ubuntu-natty-on-the-beagleboard-with-rootstock/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=179&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are <a href="https://wiki.ubuntu.com/ARM/OMAP">prebuilt Ubuntu images</a> suitable for the BeagleBoard, however if you want more control over what&#8217;s included in your filesystem, and your kernel, <a href="https://wiki.ubuntu.com/ARM/RootStock">RootStock</a> is a good option. RootStock will assemble a complete Ubuntu file system, a kernel image and initial ramdisk based on the set of packages you provide on the command line.</p>
<h2>Running Rootstock</h2>
<p>There seems to be a bug in rootstock under Ubuntu 11 in that if you install it using the usual &#8216;apt-get install rootstock&#8217;, rootstock fails later on with a lot of:</p>
<pre>...
bin/chown: changing ownership of `/proc/923/task/965': Operation not permitted
...</pre>
<p>However if you just install the source code it seems to run correctly:</p>
<pre>apt-get <strong>source</strong> rootstock
apt-get install qemu-kvm-extras
apt-get install debootstrap
cd rootstock*</pre>
<p>Before running rootstock you need to choose which kernel version you want to run. A helpful guy over at <a href="http://rcn-ee.net/deb/natty/">http://rcn-ee.net</a> has precompiled a lot of different kernel versions with the appropriate config and patches for the BeagleBoard. I&#8217;ve been using the <a href="http://rcn-ee.net/deb/natty/v3.1.0-x1/linux-image-3.1.0-x1_1.0natty_armel.deb">3.1.0 kernel</a>. If you want to build your own kernel there are instructions at the end of this article.</p>
<p>Once you&#8217;ve chosen a kernel, find the URL of the corresponding image under <a href="http://rcn-ee.net/deb/natty/">http://rcn-ee.net/deb/natty/</a>. Run rootstock, customizing the seed packages and kernel image URL arguments as necessary:</p>
<pre>./rootstock --fqdn beagle --login someusername --password somepassword \
--imagesize 4G \
--seed linux-firmware,build-essential,apt,usbutils,wireless-tools,i2c-tools,wpasupplicant \
--dist natty \
--serial ttyO2 \
--kernel-image http://rcn-ee.net/deb/natty/v3.1.0-x1/linux-image-3.1.0-x1_1.0natty_armel.deb</pre>
<p>This will (eventually) generate a couple of files: armel-rootfs-&lt;date&gt;.tgz which contains the root file system, and vmlinuz-&lt;date&gt; which is the compressed kernel.</p>
<h2>Preparing the SD Card</h2>
<p>Before we can boot the beagle from this we need to generate the uImage and uInitrd files for the boot partition:</p>
<pre>sudo apt-get install u-boot-tools
mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux" -d ./vmlinuz* ./uImage
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ./initrd.img-* ./uInitrd</pre>
<p>Copy <a href="http://www.angstrom-distribution.org/demo/beagleboard/">MLO</a>, and the generated uImage and uInitrd files to the boot partition of your SD card. If you haven&#8217;t partitioned your SD card yet, you can find instructions <a href="http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat">here</a>. Once this is done, delete everything in the main partition, and extract the tarball produced by rootstock into it:</p>
<pre>tar xfp armel-rootfs-*.tgz -C /media/main</pre>
<h2>Booting the BeagleBoard</h2>
<p>Insert the SD card into your beagle and turn it on. If you&#8217;re lucky this may boot straight away. If not, you may need to change the config in U-Boot. I use the following bootcmd and bootargs (make sure you grab a copy of your settings with &#8216;printenv&#8217; before running these below, as they will override your settings):</p>
<pre>setenv bootcmd 'mmc rescan;fatload mmc 0 0x80000000 uImage;fatload mmc 0 0x81600000 uInitrd;bootm 0x80000000 0x81600000'
setenv bootargs 'console=ttyO2,115200n8 root=/dev/mmcblk0p2 rootwait ro vram=${vram} omapfb.mode=dvi:${dvimode} fixrtc buddy=${buddy} mpurate=${mpurate}'
boot</pre>
<p>I&#8217;m using U-Boot 2011.06, so you may need a slightly different syntax if you have a different version.</p>
<h2>Compiling your own Kernel</h2>
<p>If you want to build your own kernel (eg to <a title="Changing the BeagleBoard I2C Bus Frequency" href="http://yetanotherhackersblog.wordpress.com/2011/11/06/changing-the-beagleboard-i2c-bus-frequency/">lower the I2C bus frequency</a>), you can make the job a bit easier with a set of scripts made by the same guy who provided the precompiled kernel images earlier:</p>
<pre>git clone git://github.com/RobertCNelson/stable-kernel.git</pre>
<p>Edit the file system.sh.sample. If you&#8217;re going to cross-compile the kernel (recommended &#8211; compiling the kernel on the BeagleBoard will take an awfully long time), uncomment the following lines and save the file as system.sh:<strong></strong></p>
<pre>...
<span style="color:#ff0000;"><strong><strong>#</strong></strong></span>sudo apt-get install gcc-arm-linux-gnueabi
...
<span style="color:#ff0000;"><strong>#</strong></span>CC=arm-linux-gnueabi-
...
<span style="color:#ff0000;"><strong>#</strong></span>ZRELADDR=0x80008000
...</pre>
<p>When you&#8217;re done, run:</p>
<pre>./build_deb.sh</pre>
<p>This will take a while, and when done will produce a file called deploy/linux-image-&lt;version&gt;cross_armel.deb. Put this up on a web server and you can reference it in the &#8211;kernel-image argument to rootstock above.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=179&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2011/11/06/installing-ubuntu-natty-on-the-beagleboard-with-rootstock/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>
	</item>
		<item>
		<title>Hot-Air Soldering QFN packages</title>
		<link>http://yetanotherhackersblog.wordpress.com/2011/08/19/hot-air-soldering-qfn-packages/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2011/08/19/hot-air-soldering-qfn-packages/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 07:59:30 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[BQ24123]]></category>
		<category><![CDATA[hot air gun]]></category>
		<category><![CDATA[QFN]]></category>
		<category><![CDATA[soldering]]></category>
		<category><![CDATA[surface mount]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=152</guid>
		<description><![CDATA[QFN (Quad Flat No leads) packages are the devil&#8217;s work. As the name implies there are no leads, just tiny pads on the bottom of the chip where it&#8217;s almost impossible to get a soldering iron or test probe to.  &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2011/08/19/hot-air-soldering-qfn-packages/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=152&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/08/img_07592.jpg"><br />
</a><a href="http://en.wikipedia.org/wiki/Quad_Flat_No_leads_package">QFN </a>(Quad Flat No leads) packages are the devil&#8217;s work. As the name implies there are no leads, just tiny pads on the bottom of the chip where it&#8217;s almost impossible to get a soldering iron or test probe to. <a href="http://yetanotherhackersblog.files.wordpress.com/2011/08/texas-instruments-bq24123rhlt.jpg"><img class="size-medium wp-image-153 alignright" title="Texas-Instruments-BQ24123RHLT" src="http://yetanotherhackersblog.files.wordpress.com/2011/08/texas-instruments-bq24123rhlt.jpg?w=180&#038;h=180" alt="" width="180" height="180" /></a></p>
<p>I found a couple of posts which suggest you can solder these bad boys with a soldering iron by positioning the chip, then &#8216;floating&#8217; solder along the PCB trace to make the connection under the chip (with help from a lot of flux). I was able to use this technique to fix a broken connection, but not for the entire chip. This also doesn&#8217;t work if you need solder on the center pad.</p>
<p>A relatively easy way to solder these at home is with a hot air station. I&#8217;m using an Aoyue 909:<br />
<a href="http://yetanotherhackersblog.files.wordpress.com/2011/08/phpthumb_generated_thumbnailjpg.jpg"><img class="aligncenter size-full wp-image-175" title="Aoyue 909" src="http://yetanotherhackersblog.files.wordpress.com/2011/08/phpthumb_generated_thumbnailjpg.jpg?w=640" alt=""   /></a><br />
Here&#8217;s the process I use:</p>
<ol>
<li style="margin-bottom:20px;">On a scrap piece of circuit board work out what distance you need to hold the hot air gun from the circuit board and for how long before the solder melts. For my setup (an Aoyue Int 909) with air temperature and flow speed set at 50%, this was holding the gun 1 inch from the PCB  for 30 seconds.</li>
<li style="margin-bottom:20px;">Apply flux to the PCB and tin each PCB pad, including the center. Its difficult to know how much solder to apply: too much and you&#8217;ll get shorts between pads, not enough and you&#8217;ll get bad connections. I aim for a very slight dome of solder. Make sure you have a particularly small amount on the center pad, as that is prone to shorting. If you&#8217;re etching your own board its also worth decreasing the size of the center pad on the PCB to reduce the probability of center pad bridges.<code><br />
</code></li>
<li style="margin-bottom:20px;">Apply flux to the chip and tin the chip&#8217;s pads. Make sure every pad has small amount of solder on it &#8211; this makes it much more likely that you&#8217;ll get a good connection later. Be careful not to get too much on the center.</li>
<li style="margin-bottom:20px;">Apply plenty of flux to the PCB, and position the chip.</li>
<li style="margin-bottom:20px;">Apply heat with the air gun using the parameters you worked out earlier (1 inch and 30 seconds for me). Move the air gun in small circles to make sure the heat is applied evenly. The chip may move around with the air flow, so tap it back into position with the tweezers as necessary (or reduce the airflow). Note that you&#8217;re supposed to follow the manufacturer&#8217;s soldering thermal profile (usually 2 minutes at a low temperature to allow the internal parts of the chip to expand with the heat, followed by 30 seconds at a high temperature to melt the solder). This is worth doing if you have a thermocouple to measure the temperature near the chip (otherwise you risk frying the chip or the PCB, as I&#8217;ve done a couple of times).</li>
<li style="margin-bottom:20px;">When the solder melts, tap the chip into position. Its important to tap down on the top of the chip a few times &#8211; this should cause the chip to snap into position because of the solder surface tension.</li>
<li style="margin-bottom:20px;">When its cooled, check for shorts with a multimeter. If you&#8217;ve got a short, use the air gun to remove the chip, use desoldering braid to remove the solder, and try again. The first time I tried this it took me 4 attempts to get it working without shorts (amazingly the chip still worked).</li>
<li style="margin-bottom:20px;">Check the connections visually. If you see a suspicious looking connection you can use your soldering iron and some flux to &#8216;float&#8217; solder along the PCB trace into the join.</li>
</ol>
<p>Here&#8217;s the finished product, a <a href="http://www.farnell.com/datasheets/1310367.pdf">BQ24123</a> Lithium Battery Charger:</p>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/08/img_07592.jpg"><img title="Hand soldered QFN (a BQ24123)" src="http://yetanotherhackersblog.files.wordpress.com/2011/08/img_07592.jpg?w=640&#038;h=457" alt="" width="640" height="457" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=152&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2011/08/19/hot-air-soldering-qfn-packages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/08/texas-instruments-bq24123rhlt.jpg?w=300" medium="image">
			<media:title type="html">Texas-Instruments-BQ24123RHLT</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/08/phpthumb_generated_thumbnailjpg.jpg" medium="image">
			<media:title type="html">Aoyue 909</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/08/img_07592.jpg" medium="image">
			<media:title type="html">Hand soldered QFN (a BQ24123)</media:title>
		</media:content>
	</item>
		<item>
		<title>Switched Mode Power Supply for the BeagleBoard</title>
		<link>http://yetanotherhackersblog.wordpress.com/2011/07/24/switched-mode-power-supply-for-the-beagleboard/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2011/07/24/switched-mode-power-supply-for-the-beagleboard/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 06:22:40 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[beagleboard]]></category>
		<category><![CDATA[LM7805]]></category>
		<category><![CDATA[Switched Mode Power Supply]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=131</guid>
		<description><![CDATA[I had a couple of options to consider when creating a power supply for my BeagleBoard based robot: a simple linear voltage regulator (eg the LM7805) or a fancy switched mode power supply. Normally I&#8217;d go straight for the linear &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2011/07/24/switched-mode-power-supply-for-the-beagleboard/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=131&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had a couple of options to consider when creating a power supply for my BeagleBoard based robot: a simple linear voltage regulator (eg the <a href="http://www.fairchildsemi.com/ds/LM%2FLM7805.pdf">LM7805</a>) or a fancy switched mode power supply.</p>
<p>Normally I&#8217;d go straight for the linear voltage regulator (I&#8217;m lazy), however this wasn&#8217;t necessarily the right choice for a couple of reasons:</p>
<ul>
<li>The power consumption of my robot is relatively high (around 1 amp &#8211; see below), which can cause difficulties for a linear power regulator, and</li>
<li>I&#8217;m operating on batteries so making efficient use of the limited power I have is important.</li>
</ul>
<p>Some requirements: the robot is powered by two <a href="http://www.sparkfun.com/products/8483">LiPo cells</a> in series which output 8.4V fully charged, and this needs to be stepped down to 5V. The power supply will need to supply at least 1 Amp, preferably more. This breaks down as:</p>
<ul>
<li>350mA for the BeagleBoard,</li>
<li>200mA for a webcam,</li>
<li>200mA for an ASUS N10 802.11n wireless dongle,</li>
<li>50mA for a couple of quadrature encoders,</li>
<li>200mA for some other sensors and microcontrollers.</li>
</ul>
<p>Motors and servos run on a seperate power supply.</p>
<p><strong>The Linear Voltage Regulator Option<br />
</strong></p>
<div id="attachment_140" class="wp-caption alignright" style="width: 210px"><a href="http://yetanotherhackersblog.files.wordpress.com/2011/07/lm7805.jpg"><img class="size-full wp-image-140 " title="An LM7805 Linear Voltage Regulator" src="http://yetanotherhackersblog.files.wordpress.com/2011/07/lm7805.jpg?w=640" alt=""   /></a><p class="wp-caption-text">An LM7805 linear voltage regulator</p></div>
<p><a href="http://en.wikipedia.org/wiki/Linear_regulator">Linear voltage regulators</a> are extremely easy to use but can be quite inefficient, particularly at high currents, as they work by converting the excess voltage into heat.</p>
<p>The amount of heat produced is equal to (V<sub>OUT</sub> &#8211; V<sub>IN</sub>) * I. With the requirements above, the heat output is (8.4V &#8211; 5.0V) * 1.0A = 3.4 Watts. According to the <a href="http://www.fairchildsemi.com/ds/LM%2FLM7805.pdf">LM7805&#8242;s data sheet</a>, the device&#8217;s operating temperature will increase by 65°C per Watt, which gives us an operating temperature of 3.4W * 64°C/W + 20°C = 241°C (assuming 20°C room temperature) which puts us way over the maximum operating temperature of 125°C.</p>
<p>This could be overcome with a suitable heatsink, however all of that heat is chewing up a lot of battery power. The efficiency of the regulator is approximately V<sub>OUT</sub>/V<sub>IN</sub> * 100 = (5V / 8.4V) * 100 = 60%. Since the battery life of the robot is already quite limited (I&#8217;m using <a href="http://www.sparkfun.com/products/8483">2000mAH cells</a>), 60% efficiency isn&#8217;t exactly ideal.</p>
<p><strong>The Switched Mode Regulator Option<br />
</strong></p>
<div id="attachment_143" class="wp-caption alignright" style="width: 230px"><a href="http://yetanotherhackersblog.files.wordpress.com/2011/07/980.jpg"><img class="size-full wp-image-143 " title="TPS5430" src="http://yetanotherhackersblog.files.wordpress.com/2011/07/980.jpg?w=640" alt=""   /></a><p class="wp-caption-text">A TPS5430 switched mode regulator</p></div>
<p>Switched Mode Regulators have an efficiency in the range of 85% to 95%, potentially increasing the battery life of the robot by (95-60) / 60 = 58%. They work by generating a high frequency <a href="http://en.wikipedia.org/wiki/Pulse-width_modulation">Pulse Width Modulation</a> signal (between 100kHz and 1.2MHz, depending on the device) and running it through a filter to generate a constant DC output voltage. The regulator IC monitors the output voltage and modifies the duty cycle of the PWM signal to achieve the desired output voltage. All this comes at a price:</p>
<ul>
<li>They require quite a few external components compared to a linear voltage regulator.</li>
<li>The circuit takes up quite a bit of PCB real estate.</li>
<li>Some of the external components mentioned in the datasheets can be quite hard to get hold of (in Australia, anyway). The output filter requires a high current inductor, and a high capacity, low <a href="http://en.wikipedia.org/wiki/Equivalent_series_resistance">ESR</a> capacitor.</li>
<li>Because of the high currents and frequencies generated, you have to be quite careful with your PCB layout, minimizing some of the trace lengths.</li>
</ul>
<p>Still, it&#8217;s hard to argue with a 58% improvement in battery life. Luckily you can cheat &#8211; <a href="http://www.dimensionengineering.com/DE-SW050.htm">Dimension Engineering</a> offer a switched mode regulator which is a drop in replacement for an LM7805. I&#8217;ve tried one of these and they work well, however I wanted to see if I could make one myself. Here&#8217;s a photo of my prototype:</p>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/07/img_0733.jpg"><img class="aligncenter size-full wp-image-142" title="IMG_0733" src="http://yetanotherhackersblog.files.wordpress.com/2011/07/img_0733.jpg?w=640" alt=""   /></a></p>
<p>I&#8217;ve used a <a href="http://focus.ti.com/docs/prod/folders/print/tps5430.html">TPS5430</a> which will support up to 3 amps. It&#8217;s surface mount, but has a 0.1&#8243; pin pitch which is very easy to solder. Texas Instruments have an online tool, <a href="https://analogtools.ti.com/SwitcherPro/Main/MainPage.aspx">SwitcherPro</a> (free registration required) which will generate a circuit for you given a desired input and output voltage range and maximum current. Here&#8217;s the circuit generated by SwitcherPro corresponding to the prototype above:</p>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/07/circuit-diagram.png"><img class="aligncenter size-full wp-image-139" title="Switched mode power supply circuit diagram using a TPS5430" src="http://yetanotherhackersblog.files.wordpress.com/2011/07/circuit-diagram.png?w=640&#038;h=235" alt="" width="640" height="235" /></a>(I have no idea what they mean by &#8216;open&#8217; as the value for some of the capacitors &#8211; I&#8217;ve assumed it means they&#8217;re not necessary, and my prototype seems to work fine).</p>
<p>The circuit will step down 6.5V &#8211; 20V down to 5V with 92% efficiency at 1 amp, and support up to 3 amps.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=131&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2011/07/24/switched-mode-power-supply-for-the-beagleboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/07/lm7805.jpg" medium="image">
			<media:title type="html">An LM7805 Linear Voltage Regulator</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/07/980.jpg" medium="image">
			<media:title type="html">TPS5430</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/07/img_0733.jpg" medium="image">
			<media:title type="html">IMG_0733</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/07/circuit-diagram.png" medium="image">
			<media:title type="html">Switched mode power supply circuit diagram using a TPS5430</media:title>
		</media:content>
	</item>
		<item>
		<title>Interfacing the BeagleBoard with an ATtiny85 Microcontroller over I2C</title>
		<link>http://yetanotherhackersblog.wordpress.com/2011/04/12/interfacing-the-beagleboard-with-an-attiny85-microcontroller-over-i2c/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2011/04/12/interfacing-the-beagleboard-with-an-attiny85-microcontroller-over-i2c/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 11:35:09 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[attiny85]]></category>
		<category><![CDATA[beagleboard]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[srf08]]></category>
		<category><![CDATA[TWI]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=102</guid>
		<description><![CDATA[The next part of my project involves connecting a dozen or so sensors and actuators to the BeagleBoard, ideally in a modular, extensible way. The obvious way to do this is use some  microcontrollers, and interface them with the BeagleBoard &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2011/04/12/interfacing-the-beagleboard-with-an-attiny85-microcontroller-over-i2c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=102&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The next part of my project involves connecting a dozen or so sensors and actuators to the BeagleBoard, ideally in a modular, extensible way. The obvious way to do this is use some  microcontrollers, and interface them with the BeagleBoard over I2C.</p>
<p>In the obligatory breadboard photo below I&#8217;ve got an <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2586.pdf">ATtiny85</a> microcontroller with an LED hooked up to pin 2 (to test writing to an I2C register), a variable voltage divider hooked up to pin 3 (to test reading an ADC value from an I2C register), and a second I2C slave, the <a href="http://www.robot-electronics.co.uk/htm/srf08tech.shtml">SRF08</a>, just to make sure there were no issues with multiple slaves on the same bus.</p>
<p>Behold the breadboard:</p>
<p style="text-align:center;"><a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/attiny85-small.png"><img class="size-full wp-image-103 aligncenter" style="margin-top:30px;margin-bottom:30px;" title="BeagleBoard connected to an ATtiny85 over I2C" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/attiny85-small.png?w=640&#038;h=434" alt="" width="640" height="434" /></a></p>
<p>There&#8217;s two complications:</p>
<ul>
<li>The I2C bus exposed on the BeagleBoard runs at 1.8V not the usual 3-5V a microcontroller can cope with.</li>
<li>The I2C protocol isn&#8217;t trivial to implement in a microcontroller, particularly if you want to make it interrupt driven.</li>
</ul>
<p>I&#8217;ve discussed the level translation issue previously in <a title="Interfacing the BeagleBoard with an SRF08 Ultrasonic Ranger over I2C" href="http://yetanotherhackersblog.wordpress.com/2011/04/07/interfacing-the-beagleboard-with-an-srf08-ultrasonic-ranger-over-i2c/">this post</a>. Unfortunately I couldn&#8217;t find an easy way of doing it without using surface mount ICs. Luckily <a title="Working with Surface Mount Components" href="http://yetanotherhackersblog.wordpress.com/2011/04/05/going-surface-mount/">surface mount isn&#8217;t as hard as I&#8217;d expected</a> (you can see my first surface mount PCB in the photo above, labeled TXS0102). I&#8217;m about as clumsy as it gets, so if I can solder a 0.5mm pitch IC, anyone can.</p>
<p>Implementing the I2C protocol on an Atmel micrcontroller is made a lot easier by some code written by Donald Blake from <a href="http://avrfreaks.net">avrfreaks.net</a> (based on Atmel application note <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2560.pdf">AVR312</a>). Note that this code will only work on microcontrollers with Universal Serial Interface (USI) hardware.</p>
<p>While Donald&#8217;s code is fantastic, it uses a byte-stream abstraction which hides some of the features of I2C I wanted to use (essentially it exposes the I2C bus as two way byte stream, much like a serial bus).  Rather than thinking of I2C as a stream of bytes, it makes more sense to me to think of it as a sequence of read and write operations on a set of registers &#8211; this is the way most sensors and actuators actually use I2C.</p>
<p>While it is possible to build this abstraction on top of the byte stream abstraction, this approach seemed a bit fragile for a couple of reasons:</p>
<ul>
<li>The byte stream abstraction hides the I2C start and stop sequences, so client code can&#8217;t tell which bytes belong to which I2C transaction &#8211; its all just a stream of bytes. This seems a bit dangerous: if things got slightly out of step, bytes would queue up in the internal buffer, and be sent back in response to the wrong requests, and it may never get back into step.</li>
<li>There didn&#8217;t seem to be a clean way of handling reading and writing to the same register (a register would have to be exclusively read or exclusively write).</li>
</ul>
<p>The upshot of all of this was that I modified the code slightly to make it register based. Here&#8217;s some demo client code which illustrates how to use the library:</p>
<pre>// Callback function triggered when the slave receives a read request from the master.
uint8_t i2cReadFromRegister(uint8_t reg){
  switch (reg) {
    case 0:  return VERSION;
    case 1:  return adcRead();
    default: return 0xff;
  }
}

// Callback function triggered when the slave receives a write request from the master.
void i2cWriteToRegister(uint8_t reg, uint8_t value){
  switch (reg)  {
    case 0: i2cReg0 = value; break;
    case 1: i2cReg1 = value; break;
  }
}
int main() {
  ...
  usiTwiSlaveInit(I2C_SLAVE_ADDR, i2cReadFromRegister, i2cWriteToRegister);
  ...
}</pre>
<p>When the library detects a read or write request from the i2c master, it calls the appropriate callback function.  The callback code then determines what to return to the master, or how to store the value just written by the master.</p>
<p>One thing to be aware of is that the i2cReadFromRegister and i2cWriteToRegister callback functions are both called in interrupt context, so you&#8217;ll want to keep those functions fast if you care about keeping your I2C bus and the rest of the microcontroller code running smoothly (my example above of calling adcRead() is a perfect example of what not to do). You can download the code from <a href="http://code.google.com/p/usi-i2c-slave/source/browse/trunk/">here</a> (its an AVR Studio project for AVR GCC).</p>
<p>As described in the <a title="Interfacing the BeagleBoard with an SRF08 Ultrasonic Ranger over I2C" href="http://yetanotherhackersblog.wordpress.com/2011/04/07/interfacing-the-beagleboard-with-an-srf08-ultrasonic-ranger-over-i2c/">SRF08 I2C post</a>, the easiest way to manipulate the I2C bus on the BeagleBoard is using the i2ctools package. Here&#8217;s the result of running i2cdetect on the above setup:</p>
<pre>root@beagleboard:~# i2cdetect -r 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- 26 -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --</pre>
<p>The 70 in the bottom left is the SRF08, and the 26 is the microcontroller. The UU indicates that i2cdetect believes the address is in use by a system driver, so it didn&#8217;t poll the address (no idea what driver it is yet).</p>
<p>To get the values from I2C registers use i2cget. With the demo code I2C register 0 contains a constant (0x0A), and register 1 contains the ADC value, as determined by the position of the variable resistor. Here&#8217;s the i2cget output:</p>
<pre>root@beagleboard:~# i2cget -y 2 0x26 0
0x0a
root@beagleboard:~# i2cget -y 2 0x26 1
0xc0</pre>
<p>We can write values to the I2C registers using i2cset. The demo code is a bit daft: it lights the LED on pin 2 if the values stored in register 2 and 3 are the same. Initially the LED is lit, because both registers default to 0.</p>
<pre>root@beagleboard:~# i2cset -y 2 0x26 2 10
[LED pin goes low, because the registers are now different]
root@beagleboard:~# i2cset -y 2 0x26 3 10
[LED pin goes high again]</pre>
<p>One last thing to look out for is that you will need to have a clock rate greater than 1MHz to support 100KHz I2C. On the ATtiny85, the easiest way to do this is to set the internal oscilator at 8MHz (the factory default, I think), and turn off the 8x clock prescaler (the CKDIV8 fuse):</p>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/ckdiv8.png"><img class="aligncenter size-full wp-image-116" title="ckdiv8" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/ckdiv8.png?w=640" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=102&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2011/04/12/interfacing-the-beagleboard-with-an-attiny85-microcontroller-over-i2c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/attiny85-small.png" medium="image">
			<media:title type="html">BeagleBoard connected to an ATtiny85 over I2C</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/ckdiv8.png" medium="image">
			<media:title type="html">ckdiv8</media:title>
		</media:content>
	</item>
		<item>
		<title>Programming an ATtiny85 Microcontroller with the AVRISP mkII</title>
		<link>http://yetanotherhackersblog.wordpress.com/2011/04/08/programming-an-attiny85-with-the-avrisp-mkii/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2011/04/08/programming-an-attiny85-with-the-avrisp-mkii/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 07:48:31 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[atmel]]></category>
		<category><![CDATA[attiny85]]></category>
		<category><![CDATA[avrisp]]></category>
		<category><![CDATA[Microcontroller]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=86</guid>
		<description><![CDATA[The ATtiny85 is an 8 pin microcontroller, complete with 8KB of flash, and 512 bytes of EEPROM and SRAM. It also has some hardware support for I2C (otherwise known as TWI), which makes it ideal for my current project. Here &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2011/04/08/programming-an-attiny85-with-the-avrisp-mkii/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=86&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2586.pdf">ATtiny85</a> is an 8 pin microcontroller, complete with 8KB of flash, and 512 bytes of EEPROM and SRAM. It also has some hardware support for I2C (otherwise known as TWI), which makes it ideal for my current project. Here it is hooked up to Atmel&#8217;s <a href="http://www.atmel.com/dyn/resources/prod_documents/AVRISPmkII_UG.pdf">AVRISP mkII programmer</a> (the blue box on the top left):</p>
<p style="text-align:center;"><a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-overview.jpg"><img class="aligncenter size-full wp-image-88" style="margin-top:30px;margin-bottom:30px;" title="avrisp overview" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-overview.jpg?w=640&#038;h=434" alt="" width="640" height="434" /></a></p>
<p>The rest of the post details the steps required to get it up and running with a simple program (mostly for my benefit, as no doubt I&#8217;ll forget in a few months). Here&#8217;s what I did:</p>
<ol>
<li><strong>Install AVR Studio 4</strong><br />
Download AVR Studio 4, the latest service pack, and the AVR Toolchain Installer from Atmel: <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725">http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725</a>. Make sure that you don&#8217;t install it under c:\Program Files (x86)\ (or any path with a bracket in the name) as you&#8217;ll get this obscure error when you attempt to build:&nbsp;</p>
<pre>make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4217b3<span style="color:#000000;">)</span></pre>
</li>
<li><strong> </strong><strong>Identify the pins in the AVRISP cable<br />
</strong>The cable pinout for the AVRISP mkII is:<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-programmer-pinout.png"><img class="aligncenter" style="margin-top:30px;margin-bottom:30px;" title="AVRISP mkII pinout" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-programmer-pinout.png?w=169&#038;h=132" alt="" width="169" height="132" /></a>Pin1 is on the same side of the connector as the red stripe, and opposite where the cable enters the connector body (ie in the diagram above, the cable would be entering from the right).</li>
<li><strong>Wire up the microcontroller</strong><a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-programmer-pinout.png"><br />
</a>Wiring up the microcontroller to the programmer is pretty straightforward. Here&#8217;s the pinout for the ATtiny 85/45/25:<br />
<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/attiny85.png"><img class="aligncenter size-full wp-image-90" style="margin-top:30px;margin-bottom:30px;" title="ATtiny85" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/attiny85.png?w=640" alt=""   /></a>Some gotchas:&nbsp;</p>
<ul>
<li>You will need to power the circuit with an external power supply, as  the programmer doesn&#8217;t supply power to the microcontroller.</li>
<li>You should set the microcontroller&#8217;s reset pin high. Make sure you don&#8217;t use anything less than a 4.7K resistor or the programmer may not be able to set it low to put the microcontroller into programming mode.</li>
<li>Make sure you connect VTG to your VCC. Without this, the programmer assumes the circuit isn&#8217;t powered.</li>
</ul>
<p>Here&#8217;s a closeup of the breadboard:<br />
<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-close-up.jpg"><img class="aligncenter size-full wp-image-91" style="margin-top:30px;margin-bottom:30px;" title="avrisp close up" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-close-up.jpg?w=640" alt=""   /></a></li>
<li><strong>Create a project in AVR Studio 4</strong><br />
Creating a new project is easy:&nbsp;</p>
<ul>
<li>Hit the New Project button (or choose Project Wizard from the Project menu).</li>
<li>Choose &#8216;AVR GCC&#8217; and give the project a name.</li>
<li>Choose &#8216;AVR Simulator 2&#8242; and your microcontroller type.</li>
<li>Write your program.</li>
</ul>
<p>Here&#8217;s the program I used (it flashes an LED on pin 2):</p>
<pre>#define F_CPU 1000000UL
#include &lt;avr/io.h&gt;
#include &lt;util/delay_basic.h&gt;
#define LED PB3
void delay_ms(uint16_t ms){
  while (ms &gt; 0) {
    _delay_loop_2(F_CPU/4000);
    ms--;
  }
}
int main(void) {
  // Set Pin 2 (PB3) as an output pin.
  DDRB |= 1 &lt;&lt; LED;
  while(1) {

    // Set pin 2 high.
    PORTB |= 1 &lt;&lt; LED;
    delay_ms(1000);
    // Set pin 2 low.
    PORTB &amp;= ~(1 &lt;&lt; LED);
    delay_ms(1000);
  }
  return 0;
}</pre>
</li>
<li><strong>Flash the Program to the Microcontroller</strong><br />
The last step. Plug in your programmer, hit the <a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/con-button.png"><img class="alignnone size-full wp-image-92" title="con button" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/con-button.png?w=640" alt=""   /></a> button on the toolbar, chose AVRISP mkII and all going well you&#8217;ll have two green LEDs lit in your programmer. If not, have a look at the <a href="http://www.atmel.com/dyn/resources/prod_documents/AVRISPmkII_UG.pdf">AVRISP mkII programmer</a>, page 25 for some troubleshooting hints.To flash the program to your micrcontroller, ensure you&#8217;ve built the program, switch to the Program tab in the dialog box, hit the &#8216;Program&#8217; button in the &#8216;Flash&#8217; panel, select your .hex file (it should be in the &#8216;default&#8217; directory inside the directory which contains your .c file), and you should be done!&nbsp;</p>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/program-dialog.png"><img class="alignnone size-full wp-image-93" style="margin-top:30px;margin-bottom:30px;" title="program dialog" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/program-dialog.png?w=640" alt=""   /></a></li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=86&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2011/04/08/programming-an-attiny85-with-the-avrisp-mkii/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-overview.jpg" medium="image">
			<media:title type="html">avrisp overview</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-programmer-pinout.png" medium="image">
			<media:title type="html">AVRISP mkII pinout</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/attiny85.png" medium="image">
			<media:title type="html">ATtiny85</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/avrisp-close-up.jpg" medium="image">
			<media:title type="html">avrisp close up</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/con-button.png" medium="image">
			<media:title type="html">con button</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/program-dialog.png" medium="image">
			<media:title type="html">program dialog</media:title>
		</media:content>
	</item>
		<item>
		<title>Interfacing the BeagleBoard with an SRF08 Ultrasonic Ranger over I2C</title>
		<link>http://yetanotherhackersblog.wordpress.com/2011/04/07/interfacing-the-beagleboard-with-an-srf08-ultrasonic-ranger-over-i2c/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2011/04/07/interfacing-the-beagleboard-with-an-srf08-ultrasonic-ranger-over-i2c/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 08:29:03 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[beagleboard]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[srf08]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=72</guid>
		<description><![CDATA[The SRF08 is an ultrasonic ranger with a 3cm-6m range, and an I2C interface. It&#8217;s fairly straightforward to hook it up to a BeagleBoard using the I2C bus exposed on pins 23 and 24 of the expansion header (see page &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2011/04/07/interfacing-the-beagleboard-with-an-srf08-ultrasonic-ranger-over-i2c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=72&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.robot-electronics.co.uk/htm/srf08tech.shtml">SRF08 </a>is an ultrasonic ranger with a 3cm-6m range, and an I2C interface. It&#8217;s fairly straightforward to hook it up to a <a href="http://beagleboard.org/">BeagleBoard</a> using the I2C bus exposed on pins 23 and 24 of the expansion header (see page 96 of the <a href="http://www.beagleboard.org/static/BBSRM_latest.pdf">BeagleBoard manual</a> for the expansion header pin-out).</p>
<p>Here it is on the breadboard:</p>
<p style="text-align:center;"><a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/srf08.jpg"><img class="aligncenter size-full wp-image-73" style="margin-top:30px;margin-bottom:30px;" title="SRF08, TXS0102, BeagleBoard" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/srf08.jpg?w=640" alt=""   /></a></p>
<p><a name="LevelTranslation"></a></p>
<h2>Level Translation</h2>
<p>The one complication with this is that the BeagleBoard&#8217;s I2C interface runs at 1.8V, and the SRF08&#8242;s runs at 5V. If the I2C lines were uni-directional, this wouldn&#8217;t be too much of a problem as you could just use a voltage divider or transistor to handle the voltage step, but unfortunately the I2C lines are bi-directional (meaning both the master and slave are allowed to change the voltage level on the line).</p>
<p>A clever chap from Philips wrote an <a href="http://www.kip.uni-heidelberg.de/lhcb/Publications/external/AN97055.pdf">application note</a> on how to achieve bi-directional level translation with a single MOSFET. I was able to get this to work with one of the BSN20 MOSFETs recommended in the application note, but I couldn&#8217;t get it to translate from 1.8V to 5V. The best I could do was around 2.5V to 5V which makes sense if you look at the I<sub>D</sub> to V<sub>GS</sub> chart in the <a href="http://www.nxp.com/documents/data_sheet/BSN20.pdf">BSN20&#8242;s data sheet</a> (Figure 6).</p>
<p>There&#8217;s quite a few ICs which handle 2 channel, open-collector, bi-directional level translation. Some examples I found were:</p>
<div>
<ul>
<li><a href="http://datasheets.maxim-ic.com/en/ds/MAX3372E-MAX3393E.pdf">MAX3372</a></li>
<li><a href="http://focus.ti.com/lit/ds/symlink/txs0102.pdf">TXS0102</a></li>
<li><a href="http://www.nxp.com/documents/data_sheet/PCA9509.pdf">PCA9509</a></li>
<li><a href="http://focus.ti.com/lit/ds/symlink/pca9306.pdf">PCA9306</a></li>
</ul>
</div>
<p style="font-family:Georgia, 'Bitstream Charter', serif;font-size:16px;line-height:24px;">Unfortunately all of them appear to be surface mount, so unless you&#8217;re able to work with surface mount components, you&#8217;re options may be limited. Luckily <a title="Surface Mount Made Easy(ish)" href="http://yetanotherhackersblog.wordpress.com/2011/04/05/going-surface-mount/">surface mount wasn&#8217;t as hard as I thought</a>. I chose the TXS0102, as the BeagleBoard uses this itself, and also it was the only one I could get in Australia that didn&#8217;t require me to get a second mortgage to pay for the shipping.</p>
<p style="font-family:Georgia, 'Bitstream Charter', serif;font-size:16px;line-height:24px;">The circuit itself is easy to setup, so I won&#8217;t include the schematic here. If you&#8217;re using the TXS0102 make sure you set the OE pin to high, or you&#8217;ll get some obscure error messages when you attempt to read or write to the bus. The TXS0102 also includes a 10K pull-up resistor for each channel, so no need to add your own.</p>
<h2>Accessing the I2C Bus on the BeagleBoard</h2>
<p>The i2ctools package contains a number of utilities which give you access to the I2C bus from the command line. On a BeagleBoard running <a href="http://www.angstrom-distribution.org/">Angstrom</a> (and with a network connection) you can install this package with:</p>
<pre>opkg install i2c-tools</pre>
<p>Once you&#8217;re all wired up, you can scan the I2C bus with i2cdetect:</p>
<pre>root@beagleboard:~# i2cdetect -r 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2 using read byte commands.
I will probe address range 0x03-0x77.Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          [ 4275.681945] i2c_omap i2c_omap.2: controller timed out
-- [ 4275.725128] i2c_omap i2c_omap.2: Arbitration lost
-- [ 4276.744659] i2c_omap i2c_omap.2: controller timed out
-- [ 4276.788116] i2c_omap i2c_omap.2: Arbitration lost
-- [ 4276.828186] i2c_omap i2c_omap.2: Arbitration lost
-- [ 4276.868103] i2c_omap i2c_omap.2: Arbitration lost
-- [ 4277.885101] i2c_omap i2c_omap.2: controller timed out</pre>
<p>These errors are what I got the first time, and indicates that something is wrong with your circuit &#8211; most likely that your missing the pull-up resistors (or you&#8217;re not connected properly to the IC if it has built-in pull-up resistors). I&#8217;m guessing that the i2c driver is waiting for SCL to go high, which isn&#8217;t happening because of the lack of a pull-up resistor, so it just times out. Once you have this sorted you should get a result like:</p>
<pre>root@beagleboard:~# i2cdetect -r 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n]    
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: <strong>70</strong> -- -- -- -- -- -- --</pre>
<p>The 70 in the bottom left is the SRF08. Slightly confusingly, the <a href="http://www.robot-electronics.co.uk/htm/srf08tech.shtml">SRF08 datasheet</a> reports the I2C address as 0xE0. This is because the least significant bit in an I2C address is used to indicate whether it is a read (1) or write (0) address, so sometimes this bit is left off when reporting addreses. 0&#215;70 &lt;&lt; 1 == 0xe0.</p>
<p>Once we&#8217;ve got the device showing up in i2cdetect, the rest is easy. To initiate a ping use:</p>
<pre>root@beagleboard:~# i2cset 2 112 0 81
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will write to device file /dev/i2c-2, chip address 0x70, data address 0x00, data 0x51, mode byte.
Continue?</pre>
<p>This will trigger an ultrasonic ping, and cause the LED on the back of the module to flash briefly. You can retrieve the distance by querying the values in registers 2 and 3 (the high and low order bytes of the result, respectively):</p>
<pre>root@beagleboard:~# i2cget 2 112 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-2, chip address 0x70, data address 0x02, using read byte data.
Continue? [Y/n]
<strong>0x00</strong>
root@beagleboard:~# i2cget 2 112 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-2, chip address 0x70, data address 0x03, using read byte data.
Continue? [Y/n]
<strong>0x3b</strong></pre>
<p>So here the result is 0x003b=59 centimeters. All pretty easy if you can get the level translation issue sorted.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/72/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=72&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2011/04/07/interfacing-the-beagleboard-with-an-srf08-ultrasonic-ranger-over-i2c/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/srf08.jpg" medium="image">
			<media:title type="html">SRF08, TXS0102, BeagleBoard</media:title>
		</media:content>
	</item>
		<item>
		<title>Surface Mount Soldering Made Easy(ish)</title>
		<link>http://yetanotherhackersblog.wordpress.com/2011/04/05/going-surface-mount/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2011/04/05/going-surface-mount/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 12:38:23 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[etching]]></category>
		<category><![CDATA[pcb]]></category>
		<category><![CDATA[soldering]]></category>
		<category><![CDATA[surface mount]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=34</guid>
		<description><![CDATA[I&#8217;ve been playing around with electronics for a while, making do with my trusty breadboard for prototypes, and occasionally some veroboard if I wanted something more permanent. Unfortunately times are changing, and fewer and fewer interesting components are being made &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2011/04/05/going-surface-mount/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=34&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with electronics for a while, making do with my trusty breadboard for prototypes, and occasionally some <a href="http://en.wikipedia.org/wiki/Stripboard">veroboard</a> if I wanted something more permanent. Unfortunately times are changing, and fewer and fewer interesting components are being made available in breadboard-friendly DIP packages (I blame Apple for convincing everyone that all electronic gadgets should be the size of a credit card).</p>
<p>This had been frustrating me for a while, but came to a head on my latest project where I needed an I2C level converter. Despite many wasted afternoons scouring <a href="http://octopart.com/">octopart</a>, <a href="http://www.digikey.com/">digikey</a> and <a href="http://www.mouser.com/">mouser</a> I came up empty handed, so decided it was about time I figured out this surface mount thing.</p>
<p>As it turned out, it was all pretty straightforward, though I did have to buy quite a lot of new equipment. Here&#8217;s my first surface mount PCB (a 0.5mm pitch DCU to DIP adapter for a <a href="http://focus.ti.com/docs/prod/folders/print/txs0102.html">TXS0102</a>):</p>
<p style="text-align:center;"><a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/img_02792.jpg"><img class="aligncenter size-full wp-image-42" title="DCU to DIP adapter" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/img_02792.jpg?w=640" alt=""   /></a></p>
<p>It&#8217;s worth pointing out that you don&#8217;t have to go the full PCB etching route like I did. <a href="http://www.sparkfun.com/">Sparkfun </a>have a number of <a href="http://www.sparkfun.com/products/494">adapter boards</a> which break out surface mount packages to DIP. These look great for a quick prototype, but I&#8217;d been meaning to try PCB manufacturing for a while, so I thought I&#8217;d give it a go.</p>
<p>There&#8217;s a couple of popular ways to go about making your own PCBs. The first, and cheapest is the <a href="http://www.dr-lex.be/hardware/tonertransfer.html">toner transfer method</a>. This involves printing your circuit onto photo paper with a laser printer, then transferring the toner directly to your PCB using heat and pressure. The toner can then be used as a normal acid resist. The method sounds good however there are a lot of reports of people having mixed success, and it looks like it requires a lot of experimentation to find the right combination of laser printer, paper, and transfer method.</p>
<p>The second method is the standard photo sensitive resist technique. This is more expensive, but potentially more reliable, which sounded good to me. Here&#8217;s the steps I went through to create my first surface mount PCB:</p>
<ol>
<li><strong>Create the PCB image.</strong><br />
<a href="http://www.cadsoftusa.com/">Eagle</a> is a schematic editor which is free for non-commercial use (though it does feel a bit like 1997). Sparkfun have a good <a href="http://www.sparkfun.com/tutorials/108">tutorial</a> on using it which is worth checking out. To create the final image, just use File -&gt; Export&#8230;-&gt; Image, rather than generating the gerber files as described in the tutorial. Here&#8217;s my image:<br />
<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/printed-circuit-board-1200-dpi.png"><img class="aligncenter size-full wp-image-43" title="PCB Mask" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/printed-circuit-board-1200-dpi.png?w=640&#038;h=187" alt="" width="640" height="187" /></a>I created four copies of the board layout so I could experiment with different exposure times in a later step.<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png"><img class="aligncenter size-full wp-image-64" title="shim14" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png?w=640" alt=""   /></a>Getting hold of land patterns can be difficult for some components. The &#8216;smd-ipc.lbr&#8217; library which comes with Eagle has many standard patterns. Sparkfun also have their own Eagle library which you can download from <a href="https://github.com/sparkfun/SparkFun-Eagle-Library">here</a>. Failing those options, you can manually create the land pattern if you can find a datasheet which describes it (which is what I ended up doing for the TXS0102).<br />
<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png"><img class="aligncenter size-full wp-image-64" title="shim14" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png?w=640" alt=""   /></a></li>
<li><strong>Print it onto acetate or polyester</strong><br />
The <a href="http://kinsten.com.au/">Kinsten</a> website claims that a sheet of translucent polyester gives better contrast than transparent acetate because the polyester absorbs more of the ink than the acetate. I used the polyester sheets and got good results with tracks 0.2mm wide, and I suspect it would probably go even smaller. I had the misfortune to only own an ink jet printer (Canon MP600) and despite trying a bunch of different printer settings I couldn&#8217;t get a high contrast image (basically the ink wouldn&#8217;t dry), so I ended up trekking down to the local print shop and using their fancy laser printer.<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png"><img class="aligncenter size-full wp-image-64" title="shim14" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png?w=640" alt=""   /></a></li>
<li><strong>Expose the photo-sensitive PCB</strong><br />
UV exposure boxes are pretty expensive, however I found a relatively cheap one at <a href="http://kinsten.com.au/">Kinsten</a> (product code ALT-UV). Oddly enough, the packaging indicated it was actually a UV finger nail drying machine. It also came with 3 x 15 watt UV tubes which are supposed to have a wavelength which matches the photo sensitive resist. Here it is in action:<br />
<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/uv-unit.jpg"><img class="aligncenter size-full wp-image-44" style="margin-top:30px;margin-bottom:30px;" title="Kinsten ALT-UV" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/uv-unit.jpg?w=640&#038;h=426" alt="" width="640" height="426" /></a> The exposure process is pretty simple: peel off the plastic backing from the photo sensitive PCB, lay the printed polyester face down on top, place a layer of glass on top (to keep it flat), then slide it into the UV exposure box. I used 4 copies of my circuit, and exposed each for a different time to find the optimum exposure time. The 4 copies were exposed for 75, 100, 150, and 200 seconds respectively. The optimum looks to be about 100 seconds.<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png"><img class="aligncenter size-full wp-image-64" title="shim14" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png?w=640" alt=""   /></a></li>
<li><strong>Develop the photo resist</strong><br />
After exposing the PCB to the UV the next step is to immerse the board in developer solution. After about 30 seconds the green photo resist that was exposed to the UV starts coming off into the solution (it looks a bit like blue smoke), eventually leaving just the photo resist that was masked by the polyester. Once it has developed sufficiently you have to rinse it off with water to stop the reaction. Here&#8217;s the board:<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/post-developer1.jpg"><img class="aligncenter size-full wp-image-47" style="margin-top:20px;margin-bottom:20px;" title="post developer" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/post-developer1.jpg?w=640" alt=""   /></a> You can see the traces get thinner from left to right (reflecting greater exposure times).<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png"><img class="aligncenter size-full wp-image-64" title="shim14" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png?w=640" alt=""   /></a></li>
<li><strong>Acid Bath!</strong><br />
The fun part. To work well the etchant needs to be heated to 50-60<strong>°</strong>C and be continuously agitated. Without these conditions, the reaction will take a lot longer and may undercut the copper around the resist. Kinsten sell a kit with a heater, thermometer and air pump (I promise I don&#8217;t get kickbacks from Kinsten), though you could probably get a way a plastic tub, kettle, and a plastic spoon. As the reaction progressed the solution turned a faint blue color. After about 6 minutes the copper not protected by the resist vanished, leaving the traces still covered in green acid resist. Once this looks finished, rinsing the board off in water stops the reaction.<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/photo-resist.jpg"><img class="aligncenter size-full wp-image-48" style="margin-top:30px;margin-bottom:30px;" title="photo resist" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/photo-resist.jpg?w=640" alt=""   /></a></li>
<li><strong>Remove the resist</strong><br />
The last step is to remove the resist from our copper traces. An easy way to do this is to expose the board to UV for a couple of minutes and then dip it into the developer solution we used earlier. Other people just scrub it off, but I hate the idea of damaging the traces after this much work. Here&#8217;s the final result:<br />
<a href="http://yetanotherhackersblog.files.wordpress.com/2011/04/pcb2.jpg"><img class="aligncenter size-full wp-image-51" style="margin-top:30px;margin-bottom:30px;" title="Finished PCB" src="http://yetanotherhackersblog.files.wordpress.com/2011/04/pcb2.jpg?w=640" alt=""   /></a></li>
<li><strong>Neutralizing the developer and etchant</strong><br />
To prevent dissolving my landlord&#8217;s plumbing I bought some neutralizing kits from, you guessed it, Kinsten. Unfortunately they didn&#8217;t come with directions, however I can recommend not dumping the powder directly into the solution or it will heat up, do nasty things to your brand new plastic tank, and scare your wife. So I hear, anyway. &lt;Shuffles feet&gt;</li>
</ol>
<p>The last step is to solder the surface mount components to the fancy new PCB. In a clever attempt to make this look more like a blog post, and less like a random brain dump, I&#8217;ll post my surface mount soldering experiences in a second post. Stay tuned!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=34&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2011/04/05/going-surface-mount/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/img_02792.jpg" medium="image">
			<media:title type="html">DCU to DIP adapter</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/printed-circuit-board-1200-dpi.png" medium="image">
			<media:title type="html">PCB Mask</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png" medium="image">
			<media:title type="html">shim14</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png" medium="image">
			<media:title type="html">shim14</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png" medium="image">
			<media:title type="html">shim14</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/uv-unit.jpg" medium="image">
			<media:title type="html">Kinsten ALT-UV</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png" medium="image">
			<media:title type="html">shim14</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/post-developer1.jpg" medium="image">
			<media:title type="html">post developer</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/shim14.png" medium="image">
			<media:title type="html">shim14</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/photo-resist.jpg" medium="image">
			<media:title type="html">photo resist</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2011/04/pcb2.jpg" medium="image">
			<media:title type="html">Finished PCB</media:title>
		</media:content>
	</item>
		<item>
		<title>Playing with the SUP500F GPS module</title>
		<link>http://yetanotherhackersblog.wordpress.com/2010/11/25/playing-with-the-sup500f-gps-module/</link>
		<comments>http://yetanotherhackersblog.wordpress.com/2010/11/25/playing-with-the-sup500f-gps-module/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 06:29:58 +0000</pubDate>
		<dc:creator>bengalvin</dc:creator>
				<category><![CDATA[GPS]]></category>
		<category><![CDATA[gps sup500f max232 serial rs232 nmea]]></category>

		<guid isPermaLink="false">http://yetanotherhackersblog.wordpress.com/?p=16</guid>
		<description><![CDATA[The SUP500F is a pretty nice unit: small, low power consumption (33mA), 10Hz update, and quick start up time (29 second cold start with an open sky). Here it is on the breadboard: I&#8217;m using a MAX232 to convert the &#8230; <a href="http://yetanotherhackersblog.wordpress.com/2010/11/25/playing-with-the-sup500f-gps-module/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=16&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.sparkfun.com/products/9758">SUP500F</a> is a pretty nice unit: small, low power consumption (33mA), 10Hz update, and quick start up time (29 second cold start with an open sky).</p>
<p>Here it is on the breadboard:</p>
<p><a href="http://yetanotherhackersblog.files.wordpress.com/2010/11/gps.jpg"><img class="aligncenter size-full wp-image-17" title="gps" src="http://yetanotherhackersblog.files.wordpress.com/2010/11/gps.jpg?w=640&#038;h=362" alt="" width="640" height="362" /></a></p>
<p>I&#8217;m using a <a href="http://focus.ti.com/lit/ds/symlink/max232.pdf">MAX232 </a>to convert the <a href="http://en.wikipedia.org/wiki/RS-232">RS-232</a> voltages from the PCs serial port to TTL (5V), and a simple voltage divider to reduce the 5V TTL signal to the 3V required by the SRF500F&#8217;s UART.<span id="more-16"></span></p>
<p>Initially there was no signal on the TX pin, and a square wave with a 4 second period on pin 6 (the documentation states this pin should have a frequency of 1Hz). This behaviour was reported by a couple of other people on the sparkfun forum. After a bit of trial and error I got the expected behaviour by setting VBAT to +5V, and PSE_SEL to GND.</p>
<p>If you view the serial port output with something like <a href="http://www.ayera.com/teraterm/">TeraTerm</a> (9600 baud 8N1) you can see the <a href="http://home.mira.net/~gnb/gps/nmea.html#gpgsv">NMEA messages</a> streaming out of the GPS unit:</p>
<p><code>...<br />
$GPGSV,3,2,12,10,31,120,,29,27,214,,10,15,336,,04,11,132,*7B<br />
$GPGSV,3,3,12,31,09,212,,21,03,320,,27,04,355,,31,00,217,*76<br />
$GPVTG,000.0,T,,M,000.0,N,000.0,K,N*02<br />
$GPRMC,130122.000,V,0000.0000,N,00000.0000,E,000.0,000.0,220302,,,N*79<br />
$GPGGA,130122.000,0000.0000,N,00000.0000,E,0,00,0.0,0.0,M,0.0,M,,0000*68<br />
$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30<br />
$GPGSV,3,1,12,14,82,367,,05,56,055,,22,51,246,,02,32,144,*71<br />
$GPGSV,3,2,12,10,34,171,,25,22,233,,06,12,316,,04,12,182,*72<br />
$GPGSV,3,3,12,30,09,239,,24,08,300,,27,04,355,,31,00,217,*77<br />
$GPVTG,000.0,T,,M,000.0,N,000.0,K,N*02<br />
$GPRMC,130122.000,V,0000.0000,N,00000.0000,E,000.0,000.0,220302,,,N*78<br />
$GPGGA,130122.000,0000.0000,N,00000.0000,E,0,00,0.0,0.0,M,0.0,M,,0000*69<br />
... </code></p>
<p>If you like your GPS data to look a bit prettier, you can use the SkyTraq GPS Viewer software <a href="http://www.sparkfun.com/datasheets/GPS/GPS%20Viewer_1124.zip">available on the SparkFun website</a>:</p>
<p style="text-align:center;"><a href="http://yetanotherhackersblog.files.wordpress.com/2010/11/skytraq1.png"><img class="aligncenter size-full wp-image-20" title="skytraq" src="http://yetanotherhackersblog.files.wordpress.com/2010/11/skytraq1.png?w=640&#038;h=485" alt="" width="640" height="485" /></a></p>
<p style="text-align:left;">It took about 5 minutes under an open sky for it to get a fix the first time, but since then its been very fast: 30 seconds if its been off for more than 30 minutes or so, and under 5 seconds otherwise. The initial delay is because the GPS unit has to download the <a href="http://en.wikipedia.org/wiki/GPS_signals#Almanac">almanac</a> (a coarse description of all satellite orbital information, valid for a few months), and the <a href="http://en.wikipedia.org/wiki/Ephemeris">ephemeris </a>for each visible satellite (a precise description of the satellite&#8217;s orbital and clock correction information, valid for 30 minutes).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yetanotherhackersblog.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yetanotherhackersblog.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yetanotherhackersblog.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yetanotherhackersblog.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/yetanotherhackersblog.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/yetanotherhackersblog.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/yetanotherhackersblog.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/yetanotherhackersblog.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yetanotherhackersblog.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yetanotherhackersblog.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yetanotherhackersblog.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yetanotherhackersblog.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yetanotherhackersblog.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yetanotherhackersblog.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yetanotherhackersblog.wordpress.com&amp;blog=17841839&amp;post=16&amp;subd=yetanotherhackersblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yetanotherhackersblog.wordpress.com/2010/11/25/playing-with-the-sup500f-gps-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/87bb86592ff7268cd98acc8555b90fcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bengalvin</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2010/11/gps.jpg" medium="image">
			<media:title type="html">gps</media:title>
		</media:content>

		<media:content url="http://yetanotherhackersblog.files.wordpress.com/2010/11/skytraq1.png" medium="image">
			<media:title type="html">skytraq</media:title>
		</media:content>
	</item>
	</channel>
</rss>
