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

<channel>
	<title>MightyOhm &#187; lcd</title>
	<atom:link href="http://mightyohm.com/blog/tag/lcd/feed/" rel="self" type="application/rss+xml" />
	<link>http://mightyohm.com/blog</link>
	<description>Join the resistance.</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:07:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Building a Wifi Radio &#8211; Part 10, Building the Box</title>
		<link>http://mightyohm.com/blog/2009/05/building-a-wifi-radio-part-10-building-the-box/</link>
		<comments>http://mightyohm.com/blog/2009/05/building-a-wifi-radio-part-10-building-the-box/#comments</comments>
		<pubDate>Fri, 29 May 2009 14:30:22 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[amplifier]]></category>
		<category><![CDATA[antenna]]></category>
		<category><![CDATA[case]]></category>
		<category><![CDATA[kc6qhp]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[wifiradio]]></category>
		<category><![CDATA[Wireless]]></category>
		<category><![CDATA[WL-520GU]]></category>
		<category><![CDATA[woodworking]]></category>

		<guid isPermaLink="false">http://mightyohm.com/blog/?p=1887</guid>
		<description><![CDATA[This is the tenth and final part of a series about building a low cost, open source streaming internet radio based on the ASUS WL-520gU Wireless Router.  If you haven’t already, check out the previous parts (see the links below) for some background about the project. Wow, we&#8217;ve come a long way since part one!  [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is the tenth and final part of a series about building a low cost, open source streaming internet radio based on the <a onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.dpbolvw.net/click-3238164-10440897?url=http%3A%2F%2Fwww.newegg.com%2FProduct%2FProduct.aspx%3FItem%3DN82E16833320023%26nm_mc%3DAFC-C8Junction%26cm_mmc%3DAFC-C8Junction-_-Network%2B-%2BWireless%2BRouters-_-ASUS-_-33320023&amp;cjsku=N82E16833320023');" href="http://www.dpbolvw.net/click-3238164-10440897?url=http%3A%2F%2Fwww.newegg.com%2FProduct%2FProduct.aspx%3FItem%3DN82E16833320023%26nm_mc%3DAFC-C8Junction%26cm_mmc%3DAFC-C8Junction-_-Network%2B-%2BWireless%2BRouters-_-ASUS-_-33320023&amp;cjsku=N82E16833320023" target="_top">ASUS WL-520gU Wireless Router</a><img src="http://www.ftjcfx.com/image-3238164-10440897" border="0" alt="" width="1" height="1" />.  If you haven’t already, check out the previous parts (see the links below) for some background about the project.</em></p>
<p>Wow, we&#8217;ve come a long way since part one!  To date, there have been nine parts in this series, each covering a different aspect of building the radio:</p>
<ol>
<li><a href="http://mightyohm.com/blog/2008/10/building-a-wifi-radio-part-1-introduction/">Building a Wifi Radio &#8211; Part 1, Introduction</a></li>
<li><a href="http://mightyohm.com/blog/2008/10/building-a-wifi-radio-part-2-choosing-an-embedded-platform/">Building a Wifi Radio &#8211; Part 2, Choosing an Embedded Platform</a></li>
<li><a href="http://mightyohm.com/blog/2008/10/building-a-wifi-radio-part-3-hacking-the-asus-wl-520gu/">Building a Wifi Radio &#8211; Part 3, Hacking the Asus WL-520GU</a></li>
<li><a href="http://mightyohm.com/blog/2008/11/building-a-wifi-radio-part-4-installing-openwrt/">Building a Wifi Radio &#8211; Part 4, Installing OpenWrt</a></li>
<li><a href="http://mightyohm.com/blog/2008/11/building-a-wifi-radio-part-5-lets-make-some-noise/">Building a Wifi Radio &#8211; Part 5, Let’s Make Some Noise!</a></li>
<li><a href="http://mightyohm.com/blog/2008/12/building-a-wifi-radio-part-6-a-conversation-with-mpd/">Building a Wifi Radio &#8211; Part 6, A Conversation with Mpd</a></li>
<li><a href="http://mightyohm.com/blog/2008/12/building-a-wifi-radio-part-7-building-an-lcd-display/">Building a Wifi Radio &#8211; Part 7, Building an LCD Display</a></li>
<li><a href="http://mightyohm.com/blog/2009/02/building-a-wifi-radio-part-8-adding-a-tuning-control/">Building a Wifi Radio &#8211; Part 8, Adding a Tuning Control</a></li>
<li><a href="http://mightyohm.com/blog/2009/05/building-a-wifi-radio-part-9-a-few-odds-and-ends/">Building a Wifi Radio &#8211; Part 9, A Few Odds and Ends</a></li>
<li>You are here.</li>
</ol>
<h3>Preface to Part 10:</h3>
<p>In this part, I&#8217;m going to show you a few steps in the process I used to turn <a href="http://mightyohm.com/blog/2008/10/detailed-specs-for-the-asus-wl-520gu-uber-hacking-platform/">a wireless router</a>, a breadboard, and a pile of loose parts into a finished standalone internet streaming radio receiver.  Unlike the previous parts in the series, I&#8217;m not going to provide detailed step by step instructions.  This is primarily because I don&#8217;t think it&#8217;s realistic to expect everyone to have access to the same tools and materials as I do.  Think of it this way &#8211; this is your opportunity to customize your radio.  Maybe you don&#8217;t like wood veneer, but prefer brushed aluminum or carbon fiber?  Maybe you have a <a href="http://www.epiloglaser.com/">laser cutter</a> at your disposal and can turn a flat sheet of clear acrylic into a snap-together radio in less than 5 minutes?  This is your chance to express your creativity!  Go ahead and <a href="http://creativecommons.org/licenses/by-sa/3.0/us/">copy my design</a>, but don&#8217;t be afraid to go off into left field either&#8230;</p>
<h3>The Box:</h3>
<p>Some time ago, I posted a <a href="http://sketchup.google.com/">Google Sketchup</a> model of the radio enclosure that I created with the help of Tony, a good friend of mine who lives in Southern California.  The idea was to build a box out of wood to mimic the style of a <a href="http://images.google.com/images?hl=en&amp;client=firefox-a&amp;rls=org.mozilla:en-US:official&amp;hs=Qii&amp;q=vintage%20wood%20table%20radio&amp;um=1&amp;ie=UTF-8&amp;sa=N&amp;tab=wi">vintage table radio</a>.  All the components of the radio would be mounted inside the box, with the exception of the antenna (not shown).  We also wanted to add some custom touches to make the design look modern and unique, like black controls and flush mounted contoured speaker grilles and a minimalist front panel layout.</p>
<p>Here&#8217;s the model we came up with:</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio Enclosure - Google Sketchup Model" href="http://www.flickr.com/photos/mightyohm/3306019406/"><img class="alignnone" src="http://farm4.static.flickr.com/3623/3306019406_7879de7ace.jpg" alt="Wifi Radio Enclosure - Google Sketchup Model" width="500" height="335" /></a></p>
<p>Tony and I spent a weekend in his garage near Los Angeles finalizing the design, cutting and bending sheets of plywood, making forms, and fitting various pieces of the box together.  Tony, who is far superior to me in the ways of woodworking and fabrication, did most of the work while I looked at stain colors and other details.</p>
<p>A few weeks later, Tony sent me this masterpiece.  Here&#8217;s the box, freshly stained and covered with many carefully sanded coats of polyurethane:</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio Case Build" href="http://www.flickr.com/photos/mightyohm/3508538787/"><img class="alignnone" src="http://farm4.static.flickr.com/3324/3508538787_0e6721f96a.jpg" alt="Wifi Radio Case Build" width="500" height="375" /></a></p>
<p>Hopefully Tony will write a post about the process of fabricating the box &#8211; he can provide a lot more details than I can.  For now, check out <a href="http://www.flickr.com/photos/mightyohm/sets/72157607903511625/">my photostream</a> for some in-progress photos of the box.  Tony has <a href="http://www.flickr.com/photos/kc6qhp/3560876194/">some photos</a> as well.</p>
<p>Once it arrived in the mail, it was up to me to combine the empty box with the pile of parts on my workbench to finish the project.</p>
<h3>Finding an Audio Amplifier:</h3>
<p>I wanted a small, inexpensive, stereo <a href="http://en.wikipedia.org/wiki/Audio_amplifier">audio amplifier</a> to mount inside the radio.  Originally, my goal was to find a kit with a few watts of power per channel, single supply operation (preferably with a common supply voltage, like 12V), volume and tone controls, and a compact PCB.  I never found any kits that I really liked (although I may look at <a href="http://www.41hz.com/">41hz</a> for some future higher powered projects).  Eventually I gave up and bought a pair of used <a href="http://support.dell.com/support/edocs/acc/61408/Specs.htm">Altec Lansing ACS90 computer speakers </a>for $5 from <a href="http://weirdstuff.com/">Weird Stuff</a> in Sunnyvale, CA.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Altec Lansing PC Speakers" href="http://www.flickr.com/photos/mightyohm/3559664307/"><img class="alignnone" src="http://farm4.static.flickr.com/3600/3559664307_7c6a674fa3.jpg" alt="Altec Lansing PC Speakers" width="500" height="375" /></a></p>
<p>I took the speakers apart and threw away the plastic speaker boxes.  Inside one is a small stereo audio amplifier that runs on 12V @ &lt; 2A and delivers 4W per channel.  I couldn&#8217;t ask for a better amp for this project, especially for the price!  I also salvaged the hefty speakers for reuse in the radio.</p>
<h3>Building the LCD / Interface Circuit:</h3>
<p>I carefully transferred my AVR microcontroller-based LCD driver / tuner control circuit from my breadboard to a piece of electronics protoboard.  Here&#8217;s the &#8220;component side&#8221; of the perfboard, showing the AVR ATmega168 microcontroller (socketed), 16MHz crystal, contrast trimpot, <a href="http://en.wikipedia.org/wiki/In_Circuit_Serial_Programming_(ICSP)">ICSP</a> pins, and header socket for the LCD:</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio - Final Assembly" href="http://www.flickr.com/photos/mightyohm/3554113123/"><img class="alignnone" src="http://farm4.static.flickr.com/3305/3554113123_cac79cc8cd.jpg" alt="Wifi Radio - Final Assembly" width="500" height="375" /></a></p>
<p>The &#8220;solder side&#8221; is mostly just interconnect wiring.  The RESET button is in the lower left corner.  I had to notch the PCB to clear one of the control pots inside the radio box.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio - Final Assembly" href="http://www.flickr.com/photos/mightyohm/3554920076/"><img class="alignnone" src="http://farm4.static.flickr.com/3580/3554920076_2ca4a8136e.jpg" alt="Wifi Radio - Final Assembly" width="500" height="375" /></a></p>
<p>Here&#8217;s the protoboard with the LCD installed and being tested.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio - Final Assembly" href="http://www.flickr.com/photos/mightyohm/3554918518/"><img class="alignnone" src="http://farm3.static.flickr.com/2462/3554918518_a319b00f04.jpg" alt="Wifi Radio - Final Assembly" width="500" height="375" /></a></p>
<h3>Modifying the router:</h3>
<p>I removed the USB and DC power jacks from the WL-520gU PCB.  I&#8217;m planning to use the USB port solely to talk to my <a href="http://mightyohm.com/blog/2008/10/inside-the-syba-sd-cm-uaud-usb-stereo-audio-adapter/">SYBA USB-Audio adapter</a>, so I removed the USB connector from the SYBA as well and wired the USB lines directly to the router.  Some people may disagree with this, but wiring directly to the router simplified the wiring inside the radio and saved space by eliminating unnecessary USB connectors.  I can always put the USB jack back later if I want to connect other USB peripherals.  A pair of wires connects the DC power pins on the router to the radio&#8217;s 5V power supply.  Don&#8217;t attempt this unless you have a decent soldering iron &#8211; it&#8217;s easy to ruin the printed circuit board by overheating the traces.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio - Final Assembly" href="http://www.flickr.com/photos/mightyohm/3554918950/"><img class="alignnone" src="http://farm4.static.flickr.com/3655/3554918950_65096001a8.jpg" alt="Wifi Radio - Final Assembly" width="500" height="375" /></a></p>
<h3>The power supply:</h3>
<p>To supply power to the radio, AVR microcontroller, and amplifier, I needed a power supply that could provide both 5V and 12VDC.  I found a used &#8220;brick&#8221; style power supply (also at Weird Stuff) rated at 5V and 12V @ 1.5A.  I believe this type of supply is very commonly used with external hard drive enclosures and shouldn&#8217;t be too hard to find.  Initially I was concerned that a <a href="http://en.wikipedia.org/wiki/Switched-mode_power_supply">switching supply</a> would be too noisy to use with an audio amplifier, but a quick test showed no unexpected noise from the amp.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio Power Supply" href="http://www.flickr.com/photos/mightyohm/3570652013/"><img class="alignnone" src="http://farm3.static.flickr.com/2460/3570652013_b31e23036a.jpg" alt="Wifi Radio Power Supply" width="375" height="500" /></a></p>
<h3>Final assembly:</h3>
<p>Mounting all of the components inside the radio box took a lot of time, epoxy, velcro, and hot glue.  Eventually I was able to get everything except the power supply to fit.  Although originally I had wanted to mount the supply inside the radio, keeping it external ensures that there is no 110V running around inside the box.  This is a nice safety feature, and I think it was a worthwhile compromise.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio - Final Assembly" href="http://www.flickr.com/photos/mightyohm/3554925954/"><img class="alignnone" src="http://farm4.static.flickr.com/3405/3554925954_e6b941ff62.jpg" alt="Wifi Radio - Final Assembly" width="500" height="375" /></a></p>
<p>The router is mounted on the left side of the box.  I positioned it close to the back panel so that the antenna connector can pass through and the antenna can be attached.  The amplifier is on the right side.</p>
<p>Here&#8217;s a shot inside the box, showing the microcontroller circuit and LCD display.  The LCD is simply hot glued to the inside of the box.  You can also see the speakers mounted on either side of the display.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio - Final Assembly" href="http://www.flickr.com/photos/mightyohm/3554930936/"><img class="alignnone" src="http://farm4.static.flickr.com/3309/3554930936_b51388e53c.jpg" alt="Wifi Radio - Final Assembly" width="500" height="375" /></a></p>
<h3>The finished result:</h3>
<p>Here&#8217;s the front of the radio.  The LCD display is behind a thin sheet of smoked plexiglass that is press fit into the rectangular opening in the front panel.  The two smaller knobs are connected to potentiometers that I wired to the amplifier in place of the original controls.  The left knob controls volume, the right is for tone.  I originally wanted the volume knob to also be the power switch, but I couldn&#8217;t find a dual audio taper pot that included a switch as well.   The small knobs are from <a href="http://halted.com">HSC</a> in Sunnyvale.  The large knob in the center is the tuning control.  I spotted it at <a href="http://mouser.com">Mouser Electronics</a> (#<a href="http://mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMuiwDVLTMm01UmQJIldByZu8xNgsVCH7DA%3d">450-1755</a> / <a href="http://www.mouser.com/catalog/specsheets/EPD-200217.pdf">datasheet</a>) and couldn&#8217;t resist using it on the radio.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Finished Wifi Radio" href="http://www.flickr.com/photos/mightyohm/3567599841/"><img class="alignnone" src="http://farm4.static.flickr.com/3593/3567599841_c6666d770c.jpg" alt="Finished Wifi Radio" width="500" height="375" /></a></p>
<p>Here&#8217;s a closeup of the front panel with the LCD display powered on:</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Finished Wifi Radio" href="http://www.flickr.com/photos/mightyohm/3567609195/"><img class="alignnone" src="http://farm3.static.flickr.com/2455/3567609195_79760d88fe.jpg" alt="Finished Wifi Radio" width="500" height="375" /></a></p>
<p>The back panel is made of fiberboard from Home Depot.  The Wi-Fi antenna is shown on the left.  The LAN ports and buttons of the router are accessible through cutouts in the back panel.  A 6-pin <a href="http://en.wikipedia.org/wiki/Mini-DIN">mini-DIN</a> power jack that matches the power supply I&#8217;m using and the power switch are shown on the right.  Four screws hold the back panel onto the box, so it&#8217;s easy to remove.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Finished Wifi Radio" href="http://www.flickr.com/photos/mightyohm/3568415386/"><img class="alignnone" src="http://farm4.static.flickr.com/3304/3568415386_c4b8b4506e.jpg" alt="Finished Wifi Radio" width="500" height="375" /></a></p>
<p>Here&#8217;s a side view showing the radio&#8217;s rounded corners and matching curved speaker grilles:</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Finished Wifi Radio" href="http://www.flickr.com/photos/mightyohm/3568413842/"><img class="alignnone" src="http://farm4.static.flickr.com/3351/3568413842_ca6a2bc59d.jpg" alt="Finished Wifi Radio" width="500" height="375" /></a></p>
<p>Here&#8217;s a video of the radio in action, tuning between a few different preset stations, including <a href="http://www.slayradio.org/home.php">Slay Radio</a>, <a href="http://di.fm">di.fm</a>, and San Francisco&#8217;s <a href="http://somafm.com/">somafm</a> with <a href="http://somafm.com/play/groovesalad">Groove Salad</a>.</p>
<p><object width="500" height="375" data="http://vimeo.com/moogaloop.swf?clip_id=4855103&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=4855103&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p>There are <a href="http://www.flickr.com/photos/mightyohm/sets/72157607903511625/">a lot more pictures</a> on Flickr.  Check them out and keep watching the <a href="http://www.flickr.com/groups/asushacks/">Asus Wireless Router Hacks</a> group for other people&#8217;s creations as well!</p>
<h3>Conclusion:</h3>
<p>This has been an epic journey.  Back in October, when I <a href="http://mightyohm.com/blog/2008/10/building-a-wifi-radio-part-1-introduction/">first posted about this project</a>, I never anticipated how much interest there would be in creating a low-cost DIY wireless streaming radio.  I am really thankful for all of the encouragement I have received, both on this site and elsewhere.  Thanks to everyone who has visited from <a href="http://blog.makezine.com">Make</a> and <a href="http://hackaday.com/">Hack a Day</a>, as well as everyone who complimented me on <a href="http://vimeo.com/4714898">my talk</a> at <a href="http://notacon.org">NOTACON</a>.  You guys make it all worthwhile!</p>
<p>By the way, if you have questions or comments, join the <a href="http://mightyohm.com/forum/viewforum.php?f=2">forums</a>!</p>
<p>Thanks for reading, and until next time, happy hacking!</p>
<p>- Jeff Keyzer aka <em>mightyohm</em></p>
]]></content:encoded>
			<wfw:commentRss>http://mightyohm.com/blog/2009/05/building-a-wifi-radio-part-10-building-the-box/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Sneak peek at my finished Wifi Radio project!</title>
		<link>http://mightyohm.com/blog/2009/05/sneak-peak-at-my-finished-wifi-radio-project/</link>
		<comments>http://mightyohm.com/blog/2009/05/sneak-peak-at-my-finished-wifi-radio-project/#comments</comments>
		<pubDate>Thu, 28 May 2009 15:29:31 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[maker faire]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[wifiradio]]></category>
		<category><![CDATA[WL-520GU]]></category>

		<guid isPermaLink="false">http://mightyohm.com/blog/?p=1902</guid>
		<description><![CDATA[While I&#8217;m busy working on part ten of my series on building a wireless router-based DIY streaming internet radio, I couldn&#8217;t resist sharing a few photos of the finished project. If you want to see the radio in person, stop by Expo Hall Booth 166 at the Maker Faire in San Mateo, CA this weekend.  [...]]]></description>
			<content:encoded><![CDATA[<p>While I&#8217;m busy working on <strong>part ten</strong> of my series on building a <a href="http://mightyohm.com/wifiradio">wireless router-based DIY streaming internet radio</a>, I couldn&#8217;t resist sharing a few photos of the finished project.</p>
<p>If you want to see the radio in person, stop by <a href="http://makerfaire.com/pub/e/2315">Expo Hall Booth 166</a> at the <a href="http://makerfaire.com">Maker Faire</a> in San Mateo, CA this weekend.  I&#8217;ll be there to demonstrate the radio and answer questions!</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Finished Wifi Radio" href="http://www.flickr.com/photos/mightyohm/3567609195/"><img class="alignnone" src="http://farm3.static.flickr.com/2455/3567609195_79760d88fe.jpg" alt="Finished Wifi Radio" width="500" height="375" /></a></p>
<p><a class="tt-flickr tt-flickr-Medium" title="Finished Wifi Radio" href="http://www.flickr.com/photos/mightyohm/3567599841/"><img class="alignnone" src="http://farm4.static.flickr.com/3593/3567599841_c6666d770c.jpg" alt="Finished Wifi Radio" width="500" height="375" /></a></p>
<p><a class="tt-flickr tt-flickr-Medium" title="Finished Wifi Radio" href="http://www.flickr.com/photos/mightyohm/3568413842/"><img class="alignnone" src="http://farm4.static.flickr.com/3351/3568413842_ca6a2bc59d.jpg" alt="Finished Wifi Radio" width="500" height="375" /></a></p>
<p><a class="tt-flickr tt-flickr-Medium" title="Finished Wifi Radio" href="http://www.flickr.com/photos/mightyohm/3568415386/"><img class="alignnone" src="http://farm4.static.flickr.com/3304/3568415386_c4b8b4506e.jpg" alt="Finished Wifi Radio" width="500" height="375" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mightyohm.com/blog/2009/05/sneak-peak-at-my-finished-wifi-radio-project/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>kuangeleven&#8217;s WL-520gU based Wi-Fi Radio &amp; LCD Display</title>
		<link>http://mightyohm.com/blog/2009/04/kuangelevens-wi-fi-radio-lcd-display/</link>
		<comments>http://mightyohm.com/blog/2009/04/kuangelevens-wi-fi-radio-lcd-display/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 18:23:09 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Books and Resources]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[wifiradio]]></category>
		<category><![CDATA[WL-520GU]]></category>

		<guid isPermaLink="false">http://mightyohm.com/blog/2009/03/kuangelevens-wi-fi-radio-lcd-display/</guid>
		<description><![CDATA[kuangeleven is working on a WL-520gU based Wi-Fi Radio based on my original project.  Unlike my version, he&#8217;s using an Arduino Mini instead of an ATmega to control the user interface. Asus wl-520gu Wi-Fi Radio &#38; LCD Display Originally uploaded by kuangeleven]]></description>
			<content:encoded><![CDATA[<p>kuangeleven is working on a <a href="http://mightyohm.com/blog/2008/10/detailed-specs-for-the-asus-wl-520gu-uber-hacking-platform/">WL-520gU</a> based Wi-Fi Radio based on <a href="http://mightyohm.com/wifiradio/">my original project</a>.  Unlike my version, he&#8217;s using an <a href="http://www.arduino.cc/en/Main/ArduinoBoardMini">Arduino Mini</a> instead of an ATmega to control the user interface.</p>
<p><a title="photo sharing" href="http://www.flickr.com/photos/kuangeleven/3304743065/"><img style="border: solid 2px #000000;" src="http://farm4.static.flickr.com/3314/3304743065_edb2e40f71_m.jpg" alt="" /></a></p>
<p><span style="font-size: 0.9em; margin-top: 0px;"><a href="http://www.flickr.com/photos/kuangeleven/3304743065/">Asus wl-520gu Wi-Fi Radio &amp; LCD Display</a></span></p>
<p>Originally uploaded by <a href="http://www.flickr.com/people/kuangeleven/">kuangeleven</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mightyohm.com/blog/2009/04/kuangelevens-wi-fi-radio-lcd-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Wifi Radio &#8211; Part 8, Adding a Tuning Control</title>
		<link>http://mightyohm.com/blog/2009/02/building-a-wifi-radio-part-8-adding-a-tuning-control/</link>
		<comments>http://mightyohm.com/blog/2009/02/building-a-wifi-radio-part-8-adding-a-tuning-control/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 15:27:46 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[noisebridge]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[Streaming Radio]]></category>
		<category><![CDATA[wifiradio]]></category>

		<guid isPermaLink="false">http://mightyohm.com/blog/?p=1148</guid>
		<description><![CDATA[This is the eighth part of an ongoing series about building a low cost, open source streaming internet radio based on the ASUS WL-520gU Wireless Router.  If you haven’t already, check out the previous parts (see the links at the end of this article) for some background about the project. In part seven, we added [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is the eighth part of an ongoing series about building a low cost, open source streaming internet radio based on the <a href="http://www.dpbolvw.net/click-3238164-10440897?url=http%3A%2F%2Fwww.newegg.com%2FProduct%2FProduct.aspx%3FItem%3DN82E16833320023%26nm_mc%3DAFC-C8Junction%26cm_mmc%3DAFC-C8Junction-_-Network%2B-%2BWireless%2BRouters-_-ASUS-_-33320023&amp;cjsku=N82E16833320023" target="_top">ASUS WL-520gU Wireless Router</a><img src="http://www.ftjcfx.com/image-3238164-10440897" border="0" alt="" width="1" height="1" />.  If you haven’t already, check out the previous parts (see the links at the end of this article) for some background about the project.</em></p>
<p>In <a href="http://mightyohm.com/blog/2008/12/building-a-wifi-radio-part-7-building-an-lcd-display/">part seven</a>, we added an LCD status display for the radio that shows the stream name as well as the artist and title of the current track.  In this part, we&#8217;ll add a tuning knob that lets us change stations without using a computer.</p>
<p>It turns out that this is mostly a software exercise, made simple by taking advantage of the analog to digital converter function of the Atmel ATmega168 AVR that is controlling the LCD display.  The addition of the tuner control turns the display circuit into a very simple user interface.  Turn the knob and the station changes.  The position of the knob determines what station the radio is &#8220;tuned&#8221; to, and when combined with a calibrated scale it will make it easy to change to any one of the several streaming radio stations stored as presets (favorites?) in the router.</p>
<p>To give you an idea of how this works, here is a demo of the tuner control changing between ten preset stations I have set on the router.  The tuner control is in the upper right hand corner of the breadboard.  As I adjust the control, the music changes and LCD display updates to show the name of each new station.</p>
<p><object width="500" height="375" data="http://www.flickr.com/apps/video/stewart.swf?v=67090" type="application/x-shockwave-flash"><param name="flashvars" value="intl_lang=en-us&amp;photo_secret=4181c97c88&amp;photo_id=3238566442" /><param name="bgcolor" value="#000000" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.flickr.com/apps/video/stewart.swf?v=67090" /><param name="allowfullscreen" value="true" /></object></p>
<p>Is that cool or what?</p>
<p>If you are interested in adding this functionality to the radio, keep reading and I&#8217;ll show you how.</p>
<h3>Changes to the hardware:</h3>
<h4>You will need:</h4>
<ul>
<li>The completed AVR-based LCD display from part seven</li>
<li>A 1k-10k trimmer or potentiometer, linear taper</li>
<li>Some hookup wire</li>
</ul>
<h4>Schematic:</h4>
<p>Here is an updated schematic of the AVR circuit showing the potentiometer connected to ADC4 (pin 27).</p>
<div id="attachment_1154" class="wp-caption alignnone" style="width: 509px"><a href="http://mightyohm.com/blog/wp-content/uploads/2009/02/interface.png"><img class="size-medium wp-image-1154" title="Wifi Radio User Interface Schematic" src="http://mightyohm.com/blog/wp-content/uploads/2009/02/interface-499x314.png" alt="Wifi Radio User Interface Schematic" width="499" height="314" /></a><p class="wp-caption-text">click to enlarge</p></div>
<h4>Firmware:</h4>
<p>The AVR firmware has been significantly expanded, slightly reworked and cleaned up in some areas.</p>
<p>The most important changes are:</p>
<ul>
<li>The addition of a serial transmit function so the AVR can talk to the router (based on the uart_putchar function)</li>
<li>New code supporting the analog to digital converter (ADC) which reads the value of a potentiometer connected to ADC4.</li>
<li>A new Timer1 overflow interrupt has been added, which occurs roughly every 0.5 seconds.  The interrupt service routine (ISR) checks the position of the tuner control, and if it has changed, sends the value to the router.  The ISR is towards the top of the file, see the SIGNAL (TIMER1_OVF_vect) section.</li>
</ul>
<p>The ADC range of the ATmega is 0 &#8211; 1024 for an input voltage from 0 to 5V.  The AVR sends serial data in the format &#8220;Tuner: Value&#8221; back to the router when the tuner position changes by more than ADC_SENS counts (default is 5).  The AVR waits for an &#8220;AVR Start!&#8221; command from the router before sending any data, this avoids filling up the serial receive buffer on the router before it&#8217;s ready to start processing data.  An important consequence of this is that the AVR must be reset before running the control script on the router.</p>
<p>You can download the source code and compiled .hex file <a href="http://mightyohm.com/files/wifiradio/AVR_wifiradio_interface.zip">here</a>.  Flash it to the AVR using any compatible ISP programmer and you should be good to go.  The source is commented fairly well so if you&#8217;re interested in learning how the interface works, take a look.  You will need a copy of the <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf">ATmega168 datasheet</a> to understand the register names and other architecture-specific parts of the code.  Feel free to post in the comments with any questions.</p>
<h4>Modifying the circuit:</h4>
<p>This part is pretty simple &#8211; just wire the potentiometer as shown in the schematic.  Most potentiometers have three terminals.  The left terminal goes to ground, the right one to +5V, and the middle terminal to ADC4 on the AVR (pin 27).</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Tuner control on breadboard" href="http://www.flickr.com/photos/mightyohm/3238589400/"><img class="alignnone" src="http://farm4.static.flickr.com/3108/3238589400_3134e598cc.jpg" alt="Tuner control on breadboard" width="500" height="375" /></a></p>
<h3>Tweaks to the OpenWrt configuration:</h3>
<p>To make bidirectional communication with the AVR work, we have to change a couple config files on the router and disable some services that would otherwise get in the way.</p>
<h4>/etc/config/network</h4>
<p>The first change is to modify the /etc/config/network file so that we can always telnet or ssh into the router on a LAN port using the IP 192.168.1.1.  The ability to access the router via ethernet is helpful in case we screw something up and lose the wireless connection or the router loses it&#8217;s IP address, etc.</p>
<p>Modify the LAN section of /etc/config/network to look like this (changes in bold):</p>
<blockquote>
<pre>#### LAN configuration
config interface lan
<strong>#option type     bridge</strong>
option ifname    "eth0.0"
option proto    static
<strong>option ipaddr    192.168.1.1
option netmask    255.255.255.0</strong></pre>
</blockquote>
<p>Save changes, restart the router, and connect an ethernet <a href="http://en.wikipedia.org/wiki/Ethernet_crossover_cable">crossover cable</a> (straight cable might work on some computers) to the router.  Configure your desktop/laptop computer with a static IP, like 192.168.1.185.  Try to open a telnet connection (or ssh if you have set a password on the router) and see if you can log in.  If not, don&#8217;t continue with the next steps until you can get this working.</p>
<h4>/etc/inittab</h4>
<p>We previously used the router&#8217;s serial port to get a login shell.  Now that we&#8217;re trying to receive data from the AVR on the same serial port, we need to disable the login shell or it will capture the data before we can get to it.</p>
<p>Edit /etc/inittab to look like this (changes in bold):</p>
<blockquote>
<pre>::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
<strong>#tts/0::askfirst:/bin/ash --login
#ttyS0::askfirst:/bin/ash --login</strong>
tty1::askfirst:/bin/ash --login</pre>
</blockquote>
<h4>/etc/sysctl.conf</h4>
<p><a href="http://en.wikipedia.org/wiki/System_request">Sysrq</a> is a fascinating and very low level debugging feature of the Linux kernel.  It can be used to perform troubleshooting operations and reboot the system.  Usually it is invoked with a <a href="http://en.wikipedia.org/wiki/Magic_SysRq_key">magic key combination</a> on a desktop computer, but in this case I found that it is easy to accidentally trip over the serial port when using an AVR.  (The &#8220;break&#8221; RS-232 code triggers Sysrq, this probably has something to do with it.)</p>
<p>Fortunately, it&#8217;s easy to disable by editing the /etc/sysctl.conf file and adding these lines:</p>
<blockquote>
<pre><strong># Disables the magic SysRq key
kernel.sysrq = 0</strong></pre>
</blockquote>
<p>Reboot the router to apply the changes.  Now we can get on with the good stuff!</p>
<h3>Shell scripting magic:</h3>
<p>The real action happens on the router, where a shell script waits for input from the router and changes the station accordingly.</p>
<p>This script is called <a href="http://mightyohm.com/files/wifiradio/interface.sh">interface.sh</a> and can be downloaded to the router using wget as shown:</p>
<blockquote>
<pre>root@OpenWrt:~# <strong>cd ~</strong>
root@OpenWrt:~# <strong>wget http://mightyohm.com/files/wifiradio/interface.sh</strong>
...
root@OpenWrt:~# <strong>chmod ugo+x interface.sh</strong></pre>
</blockquote>
<p>The interface script calls an updated version of the display script from part 7, called <a href="http://mightyohm.com/files/wifiradio/display2.sh">display2.sh</a>:</p>
<blockquote>
<pre>root@OpenWrt:~# <strong>wget http://mightyohm.com/files/wifiradio/display2.sh</strong>
...
root@OpenWrt:~# <strong>chmod ugo+x display2.sh</strong></pre>
</blockquote>
<p>Once both scripts are downloaded, executable and located in /root you can launch interface.sh as follows:</p>
<blockquote>
<pre>root@OpenWrt:~# <strong>./interface.sh</strong>
volume: 60%   repeat: on    random: off
volume: 60%   repeat: on    random: off
adding: http://relay3.slayradio.org:8000/
adding: http://scfire-dtc-aa01.stream.aol.com:80/stream/1046
adding: http://208.101.28.234:8004</pre>
<p>&#8230; more stations here &#8230;</p>
<pre>Tuner Position:  0
New station...

http://relay3.slayradio.org:8000/

[playing] #1/10   0:00/0:00 (100%)
volume: 60%   repeat: on    random: off</pre>
</blockquote>
<p>The interface script adds ten presets to the router, shows the playlist, and then waits for valid tuner data from the AVR.  Once it receives a &#8220;Tuner: value&#8221; line (which should occur shortly after the AVR receives a go signal from the script), the script prints the received tuner positon and changes to the requested station.  It will then wait for new tuner data from the AVR and change the station when necessary.</p>
<p>As you can see in the video, this works very well.  Over a fast Wi-Fi connection, the time to change stations is almost instantaneous &#8211; very satisfying!</p>
<p>That&#8217;s it for part eight.  In part nine, I&#8217;ll add some finishing touches to the router configuration and start talking about enclosures.  Stay tuned!</p>
<p><strong>Update:</strong> There is a new <a href="http://mightyohm.com/forum/viewforum.php?f=2">Wifi Radio Discussion Forum</a>, hop over there to ask questions about the project or see what other people are working on!  (<em>4/12/09)</em></p>
<p><strong>Update 2: </strong><a href="http://mightyohm.com/blog/2009/05/building-a-wifi-radio-part-9-a-few-odds-and-ends/">Part nine is now available.</a><em><br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://mightyohm.com/blog/2009/02/building-a-wifi-radio-part-8-adding-a-tuning-control/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>Building a Wifi Radio &#8211; Part 7, Building an LCD Display</title>
		<link>http://mightyohm.com/blog/2008/12/building-a-wifi-radio-part-7-building-an-lcd-display/</link>
		<comments>http://mightyohm.com/blog/2008/12/building-a-wifi-radio-part-7-building-an-lcd-display/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 23:20:42 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[avr-gcc]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[Streaming Radio]]></category>
		<category><![CDATA[wifiradio]]></category>

		<guid isPermaLink="false">http://mightyohm.com/blog/?p=822</guid>
		<description><![CDATA[This is the seventh part of an ongoing series about building a low cost, open source streaming internet radio.  If you haven’t already, check out the previous parts (see the links at the end of this article) for some background about the project. In part six, we used OpenWrt&#8217;s UNIX-style shell commands to interface with [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is the seventh part of an ongoing series about building a low cost, open source streaming internet radio.  If you haven’t already, check out the previous parts (see the links at the end of this article) for some background about the project.</em></p>
<p>In <a href="http://mightyohm.com/blog/2008/12/building-a-wifi-radio-part-6-a-conversation-with-mpd/">part six</a>, we used <a href="http://www.busybox.net/downloads/BusyBox.html">OpenWrt&#8217;s UNIX-style shell commands</a> to interface with mpd, the music player daemon, and redirect song and stream information to our <a href="http://www.anrdoezrs.net/click-3238164-10440897?url=http%3A%2F%2Fwww.newegg.com%2FProduct%2FProduct.aspx%3FItem%3DN82E16833320023%26nm_mc%3DAFC-C8Junction%26cm_mmc%3DAFC-C8Junction-_-Network%2B-%2BWireless%2BRouters-_-ASUS-_-33320023&amp;cjsku=N82E16833320023" target="_top">ASUS WL-520gU</a><img src="http://www.lduhtrp.net/image-3238164-10440897" border="0" alt="" width="1" height="1" /> wireless router&#8217;s serial port.  In this part, we&#8217;ll use a Sparkfun 16&#215;2 LCD display and a handful of other components to build an LCD status display for the radio.</p>
<h3>The Atmel AVR Microcontroller:</h3>
<p>After much thought, I decided to use an <a href="http://www.atmel.com/dyn/products/Product_card.asp?part_id=3303">Atmel ATmega168 AVR microcontroller</a> to drive the display.  I realize that this raises the technical level of this project significantly, but I have been wanting to feature an <a href="http://en.wikipedia.org/wiki/Atmel_AVR">AVR</a> project on the site and this is a great opportunity.  The truth is that an <a href="http://www.arduino.cc">Arduino</a> would work just as well and it shouldn&#8217;t be too difficult to port this program to an <a href="http://www.arduino.cc/en/Tutorial/Sketch">Arduino sketch</a>.  (The Arduino is built with the same ATmega168 microcontroller, after all.)  If anyone does this, let me know and I&#8217;ll post a link to your version of the display.</p>
<p>If you&#8217;re an AVR veteran, you can skip over this part and straight to the bill of materials below.</p>
<p>If you are new to the AVR, don&#8217;t be intimidated.  There are a number of tutorials online to help you learn how to use this inexpensive and powerful microcontroller.  I recommend starting with <a href="http://www.ladyada.net/learn/avr/">this one</a> or maybe <a href="http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=93">this one</a>, but see my note about AVR MacPack below if you&#8217;re using a Mac.  If you&#8217;ve never programmed in C before, you&#8217;ll have an additional hurdle to get over, although for this project you won&#8217;t need any actual knowledge of programming or C to burn the code to the AVR and get things working.</p>
<p>You will need to install some software to work with the AVR, I recommend:</p>
<ul>
<li><a href="http://www.obdev.at/products/avrmacpack/index.html">AVR MacPack</a> for OS X (the Adafruit tutorial recommends OSX-AVR, use this instead)</li>
<li><a href="http://winavr.sourceforge.net/">WinAVR</a> for Windows</li>
</ul>
<p>I recommend following a tutorial or two and getting a simple blinking LED example working on your AVR before building the LCD display.  That way you can be sure your programmer, development environment, breadboard, etc are working first.</p>
<h3>Building the display:</h3>
<h4>Bill of Materials:</h4>
<p>You will need:</p>
<ul>
<li>one A-B USB cable (the kind with one flat and one square end)</li>
<li>an AVR programmer, such as the <a href="http://www.adafruit.com/index.php?main_page=product_info&amp;products_id=46&amp;sessid=5f4b1ada86e5cbba0de9c9fb6cf45f10">Adafruit USBTinyISP</a></li>
<li>an <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=7957">Atmel ATmega168 AVR microcontroller</a></li>
<li>a working AVR development suite or at least a way to get a .hex file onto an AVR (see above)</li>
<li>an LCD display like this fancy LED backlit <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=255">Sparkfun 16&#215;2 Character STN</a></li>
<li>a <a href="http://en.wikipedia.org/wiki/Solderless_breadboard">solderless breadboard</a>, like <a href="http://www.amazon.com/gp/product/B0002H4W1E?ie=UTF8&amp;tag=mightyohm-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0002H4W1E">this one</a> (comes with precut wires!)<img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=mightyohm-20&amp;l=as2&amp;o=1&amp;a=B0002H4W1E" border="0" alt="" width="1" height="1" /> or <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=112">this one</a>.</li>
<li>a 4-pin female 0.1&#8243; header, this <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=115">breakaway header</a> is handy.</li>
<li>two 22pF ceramic capacitors, rated &gt;6V (mine are 25V)</li>
<li>a 0.1uF capacitor, rated &gt;6V</li>
<li>a 10 Ohm resistor</li>
<li>for contrast adjustment, a small 1k or 10k potentiometer</li>
<li>a few feet of 20 to 24 gauge solid hookup wire</li>
</ul>
<p>also nice, but not required:</p>
<ul>
<li>a <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8508">Sparkfun ISP breakout board</a> to simplify connecting the programmer to the breadboard<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8508"><br />
</a></li>
<li>a normally-open pushbutton switch to reset the circuit</li>
</ul>
<h4>Schematic:</h4>
<p>Here is the schematic of the LCD display (click to enlarge):</p>
<p><a href="http://mightyohm.com/blog/wp-content/uploads/2008/12/avr_wifiradio_display.png"><img class="alignnone size-full wp-image-879" title="Wifi Radio LCD Display Schematic" src="http://mightyohm.com/blog/wp-content/uploads/2008/12/avr_wifiradio_display.png" alt="Wifi Radio LCD Display Schematic" width="500" height="315" /></a></p>
<h4>Firmware:</h4>
<p>You can download the source code and compiled .hex file <a href="http://mightyohm.com/files/wifiradio/AVR_wifiradio_display.zip">here</a>.</p>
<p>Special thanks to <a href="http://jump.to/fleury">Peter Fleury</a> for his excellent <a href="http://homepage.hispeed.ch/peterfleury/group__pfleury__lcd.html">LCD library</a>, which saved me from reinventing the wheel!  He also has another page about <a href="http://homepage.hispeed.ch/peterfleury/avr-lcd44780.html">interfacing LCD displays to an AVR</a>.</p>
<h3>Assembling the circuit:</h3>
<p>Assembling the circuit on the breadboard is pretty straightforward.  Here&#8217;s a photo showing all components of the setup.  The router is shown above with the serial port wired to the breadboard (the RX line is floating as we&#8217;re not using it yet).  The USB AVR programmer is on the right, where it is also functioning as a 5V power supply for the circuit. Make sure the 2-pin jumper on the USBTinyISP is installed, this enables the +5V supply.  The LCD is shown displaying the current stream name (<a href="http://di.fm">DI.fm</a>).</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio LCD Display" href="http://www.flickr.com/photos/mightyohm/3113532375/"><img class="alignnone" src="http://farm4.static.flickr.com/3201/3113532375_f429580226.jpg" alt="Wifi Radio LCD Display" width="500" height="375" /></a></p>
<p>Here is a closeup of the components installed on the breadboard to show how I did things, feel free to experiment with the placement of components.  As long as you follow the schematic the circuit should still work.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio LCD Display" href="http://www.flickr.com/photos/mightyohm/3114364124/"><img class="alignnone" src="http://farm4.static.flickr.com/3017/3114364124_d4ab638540.jpg" alt="Wifi Radio LCD Display" width="500" height="375" /></a></p>
<p>Here is a closeup of the serial port connection to the router, including the 4-pin female 0.1&#8243; header.  I soldered wires to the pins of the female header (not the pins on the board).</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio LCD Display" href="http://www.flickr.com/photos/mightyohm/3114364910/"><img class="alignnone" src="http://farm4.static.flickr.com/3037/3114364910_c1e27c1bfa.jpg" alt="Wifi Radio LCD Display" width="500" height="375" /></a></p>
<p>Here is a closeup of the AVR, crystal, and the <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8508">Sparkfun ISP breakout board</a> showing the pinout:</p>
<p><a class="tt-flickr tt-flickr-Medium" title="Wifi Radio LCD Display" href="http://www.flickr.com/photos/mightyohm/3114364680/"><img class="alignnone" src="http://farm4.static.flickr.com/3293/3114364680_972485237a.jpg" alt="Wifi Radio LCD Display" width="500" height="375" /></a></p>
<h3>Flashing the AVR:</h3>
<p>Once the circuit is assembled on the breadboard, we need to flash the AVR microcontroller with the main.hex file included with the firmware above.</p>
<p>If you&#8217;re using AVR MacPack and OS X, this should be easy (since that&#8217;s what I&#8217;m using).  PC guys will need to figure this out for themselves but hopefully the process is similar (please let me know if the Makefile works).</p>
<p>Connect the USBTinyISP to your computer with the USB cable and to the breadboard with the ISP cable.  The green light on the programmer should be on, indicating it is ready, and the backlight of the LCD should be lit, indicating that the breadboard is getting power.</p>
<p>Open a terminal window and create a new directory, I used ~/temp.  Unzip the firmware into a directory somewhere, and execute &#8216;make flash&#8217;, as shown:</p>
<blockquote>
<pre>macbook:temp jkeyzer$ unzip ./AVR_wifiradio_display.zip
Archive:  ./AVR_wifiradio_display.zip
  inflating: lcd.c
  inflating: lcd.h
  inflating: main.c
  inflating: main.hex
  inflating: Makefile
macbook:temp jkeyzer$ make flash
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega168  -c main.c -o main.o</pre>
<p>a few warnings later &#8230;</p>
<pre>avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega168  -c lcd.c -o lcd.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega168  -o main.elf main.o lcd.o
rm -f main.hex
avr-objcopy -j .text -j .data -O ihex main.elf main.hex
avrdude -c usbtiny -p atmega168 -U flash:w:main.hex:i</pre>
<pre>avrdude: AVR device initialized and ready to accept instructions</pre>
<pre>Reading | ################################################## | 100% 0.01s</pre>
<pre>avrdude: Device signature = 0x1e9406
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: writing flash (1326 bytes):</pre>
<pre>Writing | ################################################## | 100% 3.32s</pre>
<pre>avrdude: 1326 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex contains 1326 bytes
avrdude: reading on-chip flash data:</pre>
<pre>Reading | ################################################## | 100% 0.68s</pre>
<pre>avrdude: verifying ...
avrdude: 1326 bytes of flash verified</pre>
<pre>avrdude: safemode: Fuses OK</pre>
<pre>avrdude done.  Thank you.</pre>
</blockquote>
<p>If everything went well, the LCD display firmware is now loaded into the ATmega168 and the circuit is ready to go.  If not, double check your connections and take a look at the <a href="http://www.ladyada.net/make/usbtinyisp/help.html">help! page for the USBTinyISP</a>.</p>
<h3>Testing the display:</h3>
<p>Telnet or ssh into the router.  Start mpd and connect to a stream using mpc (we covered this in <a href="http://mightyohm.com/blog/2008/11/building-a-wifi-radio-part-5-lets-make-some-noise/">part five</a>).</p>
<p>Once the stream starts playing, execute the display.sh script we created in <a href="http://mightyohm.com/blog/2008/12/building-a-wifi-radio-part-6-a-conversation-with-mpd/">part six</a>.  Within a few seconds, if everything is working, you should see the stream name on the display, followed by the artist and name of the current song.  Congratulations!</p>
<p>Here is a video of the LCD display in action, including the horizontal scrolling feature to show information that is too wide to fit within the visible area of the display:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="375" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="http://www.flickr.com/apps/video/stewart.swf?v=63881" /><param name="flashvars" value="intl_lang=en-us&amp;photo_secret=88e8f450f5&amp;photo_id=3113563145" /><param name="bgcolor" value="#000000" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.flickr.com/apps/video/stewart.swf?v=63881" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="500" height="375" src="http://www.flickr.com/apps/video/stewart.swf?v=63881" allowfullscreen="true" bgcolor="#000000" flashvars="intl_lang=en-us&amp;photo_secret=88e8f450f5&amp;photo_id=3113563145" data="http://www.flickr.com/apps/video/stewart.swf?v=63881"></embed></object></p>
<p>That&#8217;s it for part seven!  In part eight, we&#8217;ll start working on the input side of the user interface.</p>
<p>Like what you&#8217;re seeing?  Have suggestions about what could be improved?  Leave a comment or <a href="http://mightyohm.com/blog/contact/">contact me directly</a>.</p>
<p><strong>Update:</strong> <a href="http://mightyohm.com/blog/2009/02/building-a-wifi-radio-part-8-adding-a-tuning-control/">Part eight</a>, in which I add a tuning control to the radio, is now available.</p>
<p><strong>Update 2:</strong> There is a new <a href="http://mightyohm.com/forum/viewforum.php?f=2">Wifi Radio Discussion Forum</a>, hop over there to ask questions about the project or see what other people are working on!  (<em>4/12/09)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://mightyohm.com/blog/2008/12/building-a-wifi-radio-part-7-building-an-lcd-display/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>PIC RGB Video &#8211; Technical Details</title>
		<link>http://mightyohm.com/blog/2008/09/pic-rgb-video-technical-details/</link>
		<comments>http://mightyohm.com/blog/2008/09/pic-rgb-video-technical-details/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 20:41:27 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[NTSC]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[rgb]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mightyohm.com/blog/?p=235</guid>
		<description><![CDATA[This page summarizes the technical details behind my PIC LCD video project.  This is a basic tutorial on how to generate analog RGB video using a PIC16F628 microcontroller. Previous posts on this project: PIC Microcontroller RGB Video &#8211; Animations! Space Invaders! Generating Analog RGB Video with a PIC Microcontroller Materials needed: An LCD screen like [...]]]></description>
			<content:encoded><![CDATA[<p>This page summarizes the technical details behind my <a href="http://mightyohm.com/blog/2008/09/pic-microcontroller-rgb-video-animations/">PIC LCD video project</a>.  This is a basic tutorial on how to generate analog RGB video using a PIC16F628 microcontroller.</p>
<p><strong>Previous posts on this project:</strong></p>
<ul>
<li><a title="Permanent Link to PIC Microcontroller RGB Video - Animations!" rel="bookmark" href="../2008/09/pic-microcontroller-rgb-video-animations/?phpMyAdmin=pfRTB12SN5iI6CmsWzU3sxfiZw0">PIC Microcontroller RGB Video &#8211; Animations!</a></li>
<li><a title="Permanent Link to Space Invaders!" rel="bookmark" href="http://mightyohm.com/blog/2008/09/space-invaders/">Space Invaders!</a></li>
<li><a title="Permanent Link to Generating Analog RGB Video with a PIC Microcontroller" rel="bookmark" href="../2008/09/generating-analog-rgb-video-with-a-pic-microcontroller/?phpMyAdmin=pfRTB12SN5iI6CmsWzU3sxfiZw0">Generating Analog RGB Video with a PIC Microcontroller</a></li>
</ul>
<p><strong>Materials needed:</strong></p>
<ul>
<li>An LCD screen like the <a href="http://store.earthlcd.com/Sharp-4LU4EB-4-B-W-Video-LCD">Sharp 4L-U4EB</a> that accepts a noninterlaced NTSC analog RGB video signal (red/green/blue and composite sync all as separate signals).  <a href="http://mightyohm.com/blog/wp-content/uploads/2008/09/sharp_bw_lcd_manual.pdf">Poor quality datasheet here.</a></li>
<li>(1) <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010209">PIC16F628</a> (the <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010210">PIC16F628A</a> should be a drop-in replacement.  Sorry, I have old PICs lying around.)</li>
<li>A PIC programmer &#8211; I am using a <a href="http://kitsrus.com/pic.html">K128</a>, but support for it has been discontinued.  <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en023805">Microchip&#8217;s PICkit2 </a>is probably your best bet, but I haven&#8217;t used one (yet).</li>
<li><a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en019469&amp;part=SW007002">MPLAB </a>- the free Microchip IDE, or a compatible PIC assembler</li>
<li>(1) 20MHz crystal (HC-18 or whatever fits your breadboard)</li>
<li>(2) 22pF ceramic capacitors</li>
<li>(3) 470 Ohm 1/8W resistors</li>
<li>(5) 10K 1/8W resistors</li>
<li>A 1K potentiometer for brightness control (if needed, my LCD needs one to display anything)</li>
<li>A regulated 5V supply for the PIC, and my LCD needed an 8V supply of its own</li>
<li>Anything else specific to your LCD &#8211; hopefully not much.</li>
</ul>
<p><strong>Firmware:</strong></p>
<ul>
<li>Source code (for use with <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en019469&amp;part=SW007002">MPLAB</a>) &#8211; <a href="http://mightyohm.com/blog/wp-content/uploads/2008/09/lcd_video7.asm">lcd_video7.asm</a></li>
<li>Hex file &#8211; <a href="http://mightyohm.com/blog/wp-content/uploads/2008/09/lcd_video7.hex">lcd_video7.hex</a></li>
<li>Listing file (<a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en019469&amp;part=SW007002">MPLAB</a> output) &#8211; <a href="http://mightyohm.com/blog/wp-content/uploads/2008/09/lcd_video7.lst">lcd_video7.lst</a></li>
</ul>
<p><strong>Schematic:</strong><em></em></p>
<p><em>(click to enlarge)</em></p>
<p><a href="http://mightyohm.com/blog/wp-content/uploads/2008/09/lcd_video.png"><img class="size-medium wp-image-253 alignnone" title="lcd_video schematic" src="http://mightyohm.com/blog/wp-content/uploads/2008/09/lcd_video-300x244.png" alt="Schematic" width="300" height="244" /></a></p>
<p><strong>Theory of Operation:</strong></p>
<p>The LCD I chose for this project needs four main electrical signals to display video.  Three of them carry color information &#8211; red, green, and blue.  These three signals can vary from 0V (black) to 0.7V (full brightness).  To achieve this, I placed 470 ohm resistors in series with each, as shown in the schematic.  The LCD terminates each color signal with a 75 ohm resistor, so the 470 ohm series resistors serve to convert the 5V output of the PIC to a 0.7V max signal for the LCD (using a resistive divider).</p>
<p>The other signal the LCD needs is CSYNC &#8211; an inverse TTL composite sync signal.  This signal provides both the horizontal and vertical sync for the LCD.  Without these sync signals the image rolls across the display because the LCD doesn&#8217;t know where the image starts or ends.  Composite sync seems to be a little bit unusual &#8211; most RGB video signals have separate horizontal and vertical sync signals on separate wires.</p>
<p>A horizontal line of NTSC video is roughly 64μs long. (μs = microseconds)  At the beginning of each line, CSYNC is held low for 4us, then set high again.  The RGB lines are held low during sync and stay low for 8μs after sync, then set to the desired levels display the desired image on that line.  2μs before the end of the line, RGB are set low again to signal the end of the visible image.  At 64μs, the program loops back to start another line.</p>
<p>You can generate video like this but there would be no vertical hold &#8211; the image would be stable in the horizontal direction because we are generating a horizontal sync but not in the vertical direction.</p>
<p>To create a stable image with vertical sync, you have to create a valid &#8220;<a href="http://en.wikipedia.org/wiki/Video_field">field</a>&#8221; of video.  We&#8217;re creating non-interlaced video, so every field is the same (in contrast with <a href="http://en.wikipedia.org/wiki/Ntsc">ordinary interlaced video used in television</a>.)  A field is composed of 262 horizontal lines.  The first line is blank, with CSYNC set low for the entire line.  This is the vertical sync.  The next 17 lines are called the &#8220;<a href="http://en.wikipedia.org/wiki/Vertical_blanking_interval">blanking interval</a>&#8221; and occur above the visible image, during these lines horizontal sync is applied but no RGB signals.  The next line is the first visible line and consists of both a horizontal sync and RGB signals as discussed earlier.  243 lines later, we write one blank line, then loop back and repeat the process all over again.  Now we have a valid non-interlaced analog RGB video signal.</p>
<p>The blank lines are mostly due to compatibility with old television sets that needed time to reset the electron gun for the next field.  The nice thing is that they give us time to do housekeeping before displaying the next field.  For example, during the blanking interval I load the image to display into memory so it can be easily read back later.</p>
<p>The critical thing with regards to timing is that the PIC needs to execute the same number of instructions each time it loops, such that the sync signals always occur at the right time.  This is why there are a lot of &#8216;nop&#8217; instructions in my code &#8211; to pad the program execution in the right spots and maintain sync.  I started by counting instructions to figure out where to put the &#8216;nop&#8217;s, but by the end of writing the program I was using <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en019469&amp;part=SW007002">MPLAB&#8217;s builtin &#8220;Stopwatch&#8221; feature</a> instead.</p>
<p>That&#8217;s it for now!  If you have any questions, make use of these routines in your own projects, or just find this interesting, please leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://mightyohm.com/blog/2008/09/pic-rgb-video-technical-details/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PIC Microcontroller RGB Video &#8211; Animations!</title>
		<link>http://mightyohm.com/blog/2008/09/pic-microcontroller-rgb-video-animations/</link>
		<comments>http://mightyohm.com/blog/2008/09/pic-microcontroller-rgb-video-animations/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 18:06:10 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[invaders]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[rgb]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mightyohm.com/blog/?p=216</guid>
		<description><![CDATA[Update: For those who are interested in seeing how this is done, I have posted schematics and source along with some technical details about this project.  Click here to learn more. After two days of straight coding, this is the result &#8211; two more aliens and an animation routine that toggles between 2 images for [...]]]></description>
			<content:encoded><![CDATA[<object type="application/x-shockwave-flash" width="400" height="300" data="http://www.flickr.com/apps/video/stewart.swf?v=1.161" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param name="flashvars" value="photo_id=2846423028&amp;photo_secret=0&amp;flickr_show_info_box=true"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=1.161"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><param name="wmode" value="opaque"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=1.161" bgcolor="#000000" allowfullscreen="true" flashvars="photo_id=2846423028&amp;photo_secret=0&amp;flickr_show_info_box=true" wmode="opaque" height="300" width="400"></embed></object>
<p><strong>Update: </strong>For those who are interested in seeing how this is done, I have posted schematics and source along with some technical details about this project.  <a href="http://mightyohm.com/blog/2008/09/pic-rgb-video-technical-details/">Click here to learn more.</a></p>
<p>After two days of straight coding, this is the result &#8211; two more aliens and an animation routine that toggles between 2 images for each alien and changes aliens every n frames.  The alien selection routine is implemented as a state machine and uses way too many instructions, but fit within a blank line of video so I called it good.  The hardest part again was maintaining a constant number of clock cycles regardless of the program flow through the display loop.  This is required to maintain the video timing and keep the LCD happy.</p>
<p>I also changed the image lookup table routine so that the image to be displayed is loaded during the blanking interval above the top of the visible screen.  This makes the pixel display much more efficient during the field but at the cost of a bunch of memory.  Now instead of execution time during the horizontal line limiting the max resolution, it&#8217;s memory instead&#8230;  sometimes you can&#8217;t win.  If I encoded color more efficiently the memory limitation would go away.</p>
<p>I need to clean up the code and add some more comments, but I&#8217;ll post the source in case anyone else is interested in learning how to generate RGB video with a PIC or wants to try a similar project.</p>
<p><strong>Update: </strong>The LCD display I am using is a Sharp 4L-U4EB I bought surplus years ago.  I haven&#8217;t been able to find any more of them since, does anyone have a source?</p>
<p>Here are some still images showing the animation sequence for each alien.  Click on each for a bigger version.</p>
<p><a class="tt-flickr tt-flickr-Small" href="http://www.flickr.com/photos/mightyohm/2845579559/"><img src="http://farm4.static.flickr.com/3021/2845579559_4a81f1af7d_m.jpg" border="0" alt="Still images from space invaders animation" width="240" height="180" /> Red!</a></p>
<p><a class="tt-flickr tt-flickr-Small" href="http://www.flickr.com/photos/mightyohm/2845579651/"><img src="http://farm4.static.flickr.com/3094/2845579651_8ae7f7fcd3_m.jpg" border="0" alt="Still images from space invaders animation" width="240" height="180" /> Green!</a></p>
<p><a class="tt-flickr tt-flickr-Small" href="http://www.flickr.com/photos/mightyohm/2846412660/"><img src="http://farm4.static.flickr.com/3255/2846412660_8ee3178085_m.jpg" border="0" alt="Still images from space invaders animation" width="240" height="180" /> Blue!</a></p>
<p>Previous posts related to this project:</p>
<p><a href="http://mightyohm.com/blog/2008/09/space-invaders/">http://mightyohm.com/blog/2008/09/space-invaders/</a></p>
<p><a href="http://mightyohm.com/blog/2008/09/generating-analog-rgb-video-with-a-pic-microcontroller/">http://mightyohm.com/blog/2008/09/generating-analog-rgb-video-with-a-pic-microcontroller/</a></p>
<p>Also check out my flickr set, <a href="http://www.flickr.com/photos/mightyohm/sets/72157607122118335/">PIC Microcontroller RGB Video</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mightyohm.com/blog/2008/09/pic-microcontroller-rgb-video-animations/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Space Invaders!</title>
		<link>http://mightyohm.com/blog/2008/09/space-invaders/</link>
		<comments>http://mightyohm.com/blog/2008/09/space-invaders/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 02:51:07 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[invaders]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mightyohm.com/blog/?p=205</guid>
		<description><![CDATA[More progress using a PIC microcontroller to generate video.  What next?  Color is easy.  Animations perhaps? PS: If you start looking, these guys are everywhere.]]></description>
			<content:encoded><![CDATA[<p><a class="tt-flickr tt-flickr-Medium" href="http://www.flickr.com/photos/mightyohm/2835124664/"><img src="http://farm4.static.flickr.com/3259/2835124664_3346a3cd42.jpg" border="0" alt="Space Invaders!!!" width="500" height="375" /></a></p>
<p>More progress <a href="http://mightyohm.com/blog/2008/09/generating-analog-rgb-video-with-a-pic-microcontroller/">using a PIC microcontroller to generate video</a>.  What next?  Color is easy.  Animations perhaps?</p>
<p>PS: If you start looking, these guys are <a href="http://www.space-invaders.com/">everywhere</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mightyohm.com/blog/2008/09/space-invaders/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generating Analog RGB Video with a PIC Microcontroller</title>
		<link>http://mightyohm.com/blog/2008/09/generating-analog-rgb-video-with-a-pic-microcontroller/</link>
		<comments>http://mightyohm.com/blog/2008/09/generating-analog-rgb-video-with-a-pic-microcontroller/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 07:55:26 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[rgb]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mightyohm.com/blog/?p=182</guid>
		<description><![CDATA[Here is a PIC16F628 microcontroller clocked at 20MHz generating an analog RGB video signal with composite sync. This project was inspired by Rickard Gunee&#8217;s PIC Video Howto which gave me a big headstart in writing the code.  Thanks Rickard!  I have been wanting to work on this project since reading the tutorial several years ago, [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010209">PIC16F628 microcontroller</a> clocked at 20MHz generating an analog RGB video signal with composite sync.</p>
<p><a class="tt-flickr tt-flickr-Medium" href="http://www.flickr.com/photos/28042570@N08/sets/72157607122118335/"><img src="http://farm4.static.flickr.com/3279/2830216800_9a86edacb1.jpg" border="0" alt="PIC Microcontroller RGB Video" width="500" height="375" /></a></p>
<p>This project was inspired by <a href="http://www.rickard.gunee.com/projects/video/pic/howto.php">Rickard Gunee&#8217;s PIC Video Howto</a> which gave me a big headstart in writing the code.  Thanks Rickard!  I have been wanting to work on this project since reading the tutorial several years ago, and finally got a chance to start it last week.</p>
<p>There are few fundamental differences in my approach compared to Rickard&#8217;s and others I have seen in the past.  His tutorial was written a few years ago before 20MHz PICs were commonly available (it uses an overclocked <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010229">PIC16F84</a>.)  He also focuses on generating composite video to drive a standard television (using the AV inputs).  I am generating RGB video which will interface with the Sharp LCD I had sitting on the shelf.  RGB is a little different in that it uses a separate sync signal (composite horizontal and vertical sync on one inverted TTL line) and each color is brought out as a separate 0.7Vpp signal.  These two differences make the RGB interface considerably easier (in my opinon) to work with, especially since the approach to composite video Rickard uses is limited to black and white.</p>
<p>So far the biggest challenges have been with getting the video timing right.  I am writing the whole program in PIC assembly and every clock cycle counts.</p>
<p>More on this project soon, but until then, there are a few <a href="http://www.flickr.com/photos/mightyohm/sets/72157607122118335/">more photos on flickr</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mightyohm.com/blog/2008/09/generating-analog-rgb-video-with-a-pic-microcontroller/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

