<?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>Volts and Bytes<title>&#187; Featured</title>
</title>
	<atom:link href="http://voltsandbytes.com/category/featured/feed/" rel="self" type="application/rss+xml" />
	<link>http://voltsandbytes.com</link>
	<description>Microcontroller projects, tutorials, and other electronics stuffs...</description>
	<lastBuildDate>Tue, 31 Aug 2010 09:57:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>DIY Digital Thermometer 2</title>
		<link>http://voltsandbytes.com/diy-digital-thermometer-2/</link>
		<comments>http://voltsandbytes.com/diy-digital-thermometer-2/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 08:23:35 +0000</pubDate>
		<dc:creator>jer</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[Atmel]]></category>
		<category><![CDATA[ATtiny]]></category>
		<category><![CDATA[ATtiny26]]></category>
		<category><![CDATA[ATTiny26L]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[digital]]></category>
		<category><![CDATA[digital thermometer]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[LM35]]></category>
		<category><![CDATA[Sensor]]></category>
		<category><![CDATA[seven segment display]]></category>
		<category><![CDATA[temperature]]></category>
		<category><![CDATA[thermometer]]></category>

		<guid isPermaLink="false">http://voltsandbytes.com/?p=398</guid>
		<description><![CDATA[Few months ago, I published my first DIY digital thermometer. However, like any simple projects/prototypes,  that project needs some improvements. Previously, I used a voltage regulator that has a 100mA rating. Though it was able to source current to the whole circuit, it gets too hot easily. Another problem with that was that the voltage regulator was very close [...]]]></description>
			<content:encoded><![CDATA[<p>Few months ago, I published my first <a href="http://voltsandbytes.com/diy-digital-thermometer/">DIY digital thermometer</a>. However, like any simple projects/prototypes,  that project needs some improvements. Previously, I used a voltage regulator that has a 100mA rating. Though it was able to source current to the whole circuit, it gets too hot easily. Another problem with that was that the voltage regulator was very close to the sensor. Since the voltage regulator heated up easily, it always affected the temperature reading of the digital thermometer.</p>
<p>To solve those problems, I came up with a second version of digital thermometer.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-404" title="digitalthermometer2-top" src="http://voltsandbytes.com/wp-content/uploads/2010/08/digitalthermometer2-top.jpg" alt="" width="588" height="248" /></p>
<p style="text-align: center;"><span id="more-398"></span></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>This version of digital thermomter is basically the same as the previous one. However, this version of digital thermometer solves the problems encountered previously. There is also some improvements in the aesthetics aspect and also in the firmware.</p>
<p>I used a voltage regulator with a higher current rating. This is to avoid the regulator to heat up easily and to dissipate any heat as fast as possible. I also put the voltage regulator as far from the sensor as possible.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-400" title="digitalthermometer2-7805" src="http://voltsandbytes.com/wp-content/uploads/2010/08/digitalthermometer2-7805.jpg" alt="" width="588" height="394" /></p>
<p>I also used a smaller and better seven-segment display. This has resulted to a smaller but more beautiful board. It also resulted to easier PCB routing.</p>
<p style="text-align: center;"><img class="size-full wp-image-402 alignnone" title="digitalthermometer2-display" src="http://voltsandbytes.com/wp-content/uploads/2010/08/digitalthermometer2-display.jpg" alt="" width="588" height="394" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: left;">However, I kept LM35 as the sensor. I had no reason to change the sensor at all. Besides, this temperature sensor is probably the easiest to use.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-403" title="digitalthermometer2-lm35" src="http://voltsandbytes.com/wp-content/uploads/2010/08/digitalthermometer2-lm35.jpg" alt="" width="588" height="394" /></p>
<p>To keep the functionality simple and the same, I did not replace the microcontroller that I used in the first version. I kept ATtiny26 as the brain of the digital thermometer. It is easy to use and just enough to my application.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-401" title="digitalthermometer2-attiny26" src="http://voltsandbytes.com/wp-content/uploads/2010/08/digitalthermometer2-attiny26.jpg" alt="" width="588" height="394" /></p>
<p><strong>Build it&#8230;</strong></p>
<p>If you are interested to build this project, here are the source files for you: <a href="http://voltsandbytes.com/wp-content/uploads/2010/08/digitalthermometer.zip">digitalthermometer</a></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://voltsandbytes.com/diy-digital-thermometer-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY Power Supply</title>
		<link>http://voltsandbytes.com/diy-power-supply/</link>
		<comments>http://voltsandbytes.com/diy-power-supply/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 05:03:19 +0000</pubDate>
		<dc:creator>jer</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[LM1117]]></category>
		<category><![CDATA[LM7805]]></category>
		<category><![CDATA[power supply]]></category>

		<guid isPermaLink="false">http://voltsandbytes.com/?p=6</guid>
		<description><![CDATA[Every circut board requires a power supply to operate properly. Usually, the power supply provides+5Vdc or +3.3Vdc to the whole circut board. There are also instances in which the power supply is not integrated to the circuit board and power must be provided by an external or separate power supply. Overview This project is a DIY DC [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://voltsandbytes.com/wp-content/uploads/2010/07/power-schematic.jpg"></a><img class="size-full wp-image-13    aligncenter" title="powersupply" src="http://voltsandbytes.com/wp-content/uploads/2010/07/powersupply.jpg" alt="" width="600" height="402" /></p>
<p style="text-align: left;">Every circut board requires a power supply to operate properly. Usually, the power supply provides+5Vdc or +3.3Vdc to the whole circut board. There are also instances in which the power supply is not integrated to the circuit board and power must be provided by an external or separate power supply.<span id="more-6"></span></p>
<p style="text-align: left;"><strong>Overview</strong></p>
<p style="text-align: left;">This project is a DIY DC power supply. It can provide a regulated +5Vdc or +3.3Vdc to any circuit board that requires external power supply. It uses two <a href="http://en.wikipedia.org/wiki/Voltage_regulator">voltage regulators</a>: one for +5Vdc and the other for +3.3Vdc. It also features power-indicating LED (<a href="http://en.wikipedia.org/wiki/Light-emitting_diode">light-emitting diode</a>) and reverse-polarity protection <a href="http://en.wikipedia.org/wiki/Diode">diode</a>.</p>
<p style="text-align: left;"><strong>Hardware</strong></p>
<p style="text-align: center;"><a href="http://voltsandbytes.com/wp-content/uploads/2010/07/power-schematic.jpg"></a></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-39" title="powersupply-schematic" src="http://voltsandbytes.com/wp-content/uploads/2010/07/powersupply-schematic.jpg" alt="" width="600" height="383" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: left;">The circuit of this project is very basic. It includes a voltage source connector (JP1) which a regulated or unregulated power source can be connected. Mine is a 9-volt battery connector so that 9-volt batteries can be connected to my board.</p>
<p style="text-align: left;">When the voltage source or battery is connected properly or in correct polarity, current passes through <a href="http://www.diodes.com/products/catalog/detail.php?item-id=3254">1N4001</a> diode (D1). The purpose of the diode is to block any negative voltage that may damage the whole circuit board.</p>
<p style="text-align: center;"><img class="size-full wp-image-15  aligncenter" title="powersupply-lm7805" src="http://voltsandbytes.com/wp-content/uploads/2010/07/powersupply-lm7805.jpg" alt="" width="600" height="402" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: left;">The voltage that passed through the diode enters <a href="http://www.national.com/mpf/LM/LM78M05.html#Overview">7805</a> (IC1) which is a 5-volt regulator. This IC provides a constant and regulated +5Vdc output as long as its input voltage is within +7Vdc and +35Vdc.</p>
<p style="text-align: center;"><img class="size-full wp-image-14  aligncenter" title="powersupply-lm1117" src="http://voltsandbytes.com/wp-content/uploads/2010/07/powersupply-lm1117.jpg" alt="" width="600" height="402" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: left;">Another voltage regulator is <a href="http://www.national.com/mpf/LM/LM1117.html#Overview">LM1117-3.3</a> (IC2) which is a +3.3-volt regulator. Its input is +5Vdc from IC1 and its output is a regulated +3.3Vdc.</p>
<p style="text-align: left;"><a href="http://en.wikipedia.org/wiki/Decoupling_capacitor">Decoupling capacitors</a> (C1, C2, C3) are also found in the circuit. These capacitors filter the inputs and outputs of each voltage regulator and they enhance the regulating capabilities of each voltage regulator.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-16" title="powersupply-top" src="http://voltsandbytes.com/wp-content/uploads/2010/07/powersupply-top.jpg" alt="" width="600" height="402" /></p>
<p style="text-align: left;">The dual-row male header connectors (JP2 and JP3)  included in the circuit can be used to provide power to different circuit boards that require +3.3Vdc or +5Vdc. The light-emitting diode (LED1) serves as a power indicator.</p>
<p style="text-align: left;"><strong><span style="text-decoration: underline;">Build it&#8230;</span></strong></p>
<p style="text-align: left;">If you want to build it, you may download the Eagle schematic and PCB files <a href="http://voltsandbytes.com/wp-content/uploads/2010/07/powersupply-eaglefiles.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://voltsandbytes.com/diy-power-supply/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple 8×8 LED Matrix Board using AVR</title>
		<link>http://voltsandbytes.com/simple-8x8-led-matrix-board-using-avr/</link>
		<comments>http://voltsandbytes.com/simple-8x8-led-matrix-board-using-avr/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 06:28:47 +0000</pubDate>
		<dc:creator>jer</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[8x8]]></category>
		<category><![CDATA[8x8 LED Matrix]]></category>
		<category><![CDATA[8x8 Matrix]]></category>
		<category><![CDATA[Atmel]]></category>
		<category><![CDATA[ATtiny]]></category>
		<category><![CDATA[ATtiny2313]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[Matrix]]></category>

		<guid isPermaLink="false">http://voltsandbytes.com/?p=379</guid>
		<description><![CDATA[I am featuring here a simple project that uses an 8×8 LED matrix and an AVR microcontroller. It is fun to have something like this. Using this, you can make flashing texts, scrolling texts, or any sort of animations that involves texts or graphics. Features The microcontroller used in this project is ATtiny2313. This microcontroller is from the AVR [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I am featuring here a simple project that uses an 8×8 LED matrix and an AVR microcontroller. It is fun to have something like this. Using this, you can make flashing texts, scrolling texts, or any sort of animations that involves texts or graphics.</p>
<p style="text-align: center;"><img class="size-full wp-image-384  aligncenter" title="matrix" src="http://voltsandbytes.com/wp-content/uploads/2010/08/matrix.jpg" alt="" width="588" height="458" /></p>
<h4><span id="more-379"></span></h4>
<h4>Features</h4>
<p>The microcontroller used in this project is <a href="http://www.atmel.com/dyn/Products/Product_card.asp?part_id=3229">ATtiny2313</a>. This microcontroller is from the <a href="http://www.atmel.com/AVR">AVR family</a> of microcontrollers of <a href="http://www.atmel.com/">Atmel</a>. It has 2KB of flash memory for program storage, 128 bytes of RAM, and 128 bytes of EEPROM. It also has enough I/O ports for this project, USART for serial communication, and it has up to 8MHz of internal oscillator.</p>
<p>The TX and RX pins of the microcontroller are brought out to male headers for future use. The pins can be used to communicate with PC or other devices using UART. Therefore, this project can be customized so that its animations would be programmable using a customized PC software.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-387" title="attiny2313" src="http://voltsandbytes.com/wp-content/uploads/2010/08/attiny2313.jpg" alt="" width="588" height="473" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>The project is powered by four AA batteries. The battery holder can be mounted on the copper side of the PCB which makes the project more compact.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-380" title="battery-holder" src="http://voltsandbytes.com/wp-content/uploads/2010/08/battery-holder.jpg" alt="" width="588" height="408" /> </p>
<p>The 8×8 matrix can be made detachable. Female header connectors can be used as the LED matrix socket. This makes the LED matrix easily replaceable and reusable.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-381" title="detachable-matrix" src="http://voltsandbytes.com/wp-content/uploads/2010/08/detachable-matrix.jpg" alt="" width="588" height="406" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h4>Buid it…</h4>
<p>If you are interested in building the project, you can download the Eagle schematic and PCB files <a href="http://voltsandbytes.com/wp-content/uploads/2010/08/PCB-and-SCH.zip">here</a>.</p>
<p>While building it, make sure that you solder a jumper wire beneath the microcontroller as shown below:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-383" title="jumper" src="http://voltsandbytes.com/wp-content/uploads/2010/08/jumper.jpg" alt="" width="588" height="454" /></p>
<h4>Sample…</h4>
<p>Here is a demo of the project.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/smmIMsGNfwo" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/smmIMsGNfwo"></embed></object></p>
<p>The source code of the demo is compiled using WinAVR and AVR Studio and it can be downloaded <a href="http://voltsandbytes.com/wp-content/uploads/2010/08/Sample-code.zip">here</a>.</p>
<h3>SOURCE FILES</h3>
<p><a href="http://voltsandbytes.com/wp-content/uploads/2010/08/PCB-and-SCH.zip">PCB and SCH</a></p>
<p><a href="http://voltsandbytes.com/wp-content/uploads/2010/08/Sample-code.zip">Sample code</a></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://voltsandbytes.com/simple-8x8-led-matrix-board-using-avr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8-pin AVR based Mood Lamp</title>
		<link>http://voltsandbytes.com/8-pin-avr-based-mood-lamp/</link>
		<comments>http://voltsandbytes.com/8-pin-avr-based-mood-lamp/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 15:04:59 +0000</pubDate>
		<dc:creator>jer</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Atmel]]></category>
		<category><![CDATA[ATtiny]]></category>
		<category><![CDATA[ATTiny45]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[Mood Lamp]]></category>
		<category><![CDATA[PWM]]></category>
		<category><![CDATA[RGB]]></category>
		<category><![CDATA[RGB LED]]></category>

		<guid isPermaLink="false">http://voltsandbytes.com/?p=212</guid>
		<description><![CDATA[I got a sample of a RGB LED (Red Green Blue Light Emitting Diode). So, I decided to make something fun out of it. Using an 8-pin AVR microcontroller, ATtiny45, I made a simple prototype to control the RGB LED using PWM or Pulse Width Modulation. Then, I put the prototype inside a translucent candle [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-219" title="mood-lamp" src="http://voltsandbytes.com/wp-content/uploads/2010/07/mood-lamp.png" alt="" width="588" height="248" /></p>
<p>I got a sample of a RGB LED (Red Green Blue Light Emitting Diode). So, I decided to make something fun out of it. Using an 8-pin AVR microcontroller, ATtiny45, I made a simple prototype to control the RGB LED using PWM or Pulse Width Modulation.<span id="more-212"></span></p>
<p style="text-align: center;"><img class="size-full wp-image-217 alignnone" title="RGB" src="http://voltsandbytes.com/wp-content/uploads/2010/07/RGB.jpg" alt="" width="519" height="389" /></p>
<p>Then, I put the prototype inside a translucent candle vase. The vase diffused the light from the RGB very nicely and below is the video of the result.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/AVme_rwakCg" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/AVme_rwakCg"></embed></object></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: left;">I soldered a potentiometer to ATtiny45 to provide an input to its on-chip ADC or analog-to-digital converter. The rate of color transitions of the RGB LED can, then, be controlled by adjusting the potentiometer.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-214" title="mood-potentiometer" src="http://voltsandbytes.com/wp-content/uploads/2010/07/mood-potentiometer.jpg" alt="" width="519" height="389" /></p>
<p>The following are the pictures of the prototype. No printed circuit boards were used to simplify the project. The project is powered by two AA batteries.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-215" title="moodprototype1" src="http://voltsandbytes.com/wp-content/uploads/2010/07/moodprototype1.jpg" alt="" width="519" height="389" /></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-216" title="prototype2" src="http://voltsandbytes.com/wp-content/uploads/2010/07/prototype2.jpg" alt="" width="519" height="389" /></p>
<p style="text-align: left;">Below is the schematic of the prototype.</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-218" title="sch" src="http://voltsandbytes.com/wp-content/uploads/2010/07/sch-600x341.jpg" alt="" width="600" height="341" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>The following is the source code for the project. The compiler that I used is WinAVR.</p>
<blockquote><p>#include &lt;avr/io.h&gt;<br />
#define F_CPU 1000000UL<br />
#include &lt;util/delay.h&gt;</p>
<p>int main(void)<br />
{ unsigned char a=0,b=0,c=0,aa=0,bb=0,cc=0,temp;<br />
 DDRB=0xFF;<br />
 PORTB=0xFF;</p>
<p>//initialize ADC<br />
 ADMUX=0b00100011;<br />
 ADCSRA=0b10000100;</p>
<p>//Set OC0A on Compare Match, clear OC0A at BOTTOM<br />
 TCCR0A|=(1&lt;&lt;COM0A1); <br />
 TCCR0A|=(1&lt;&lt;COM0A0); <br />
 //Set OC0B on Compare Match, clear OC0B at BOTTOM<br />
 TCCR0A|=(1&lt;&lt;COM0B1); <br />
 TCCR0A|=(1&lt;&lt;COM0B0);<br />
 //Fast PWM, TOP=0xFF, Update of OCRx at BOTTOM<br />
 TCCR0A|=(1&lt;&lt;WGM01);     <br />
 TCCR0A|=(1&lt;&lt;WGM00);<br />
 //clkI/O/(No prescaling)<br />
 TCCR0B&amp;=~(1&lt;&lt;WGM02); <br />
 TCCR0B&amp;=~(1&lt;&lt;CS02);  <br />
 TCCR0B&amp;=~(1&lt;&lt;CS01);<br />
 TCCR0B|=(1&lt;&lt;CS00);</p>
<p>OCR0A=0&#215;00;<br />
 OCR0B=0&#215;00;</p>
<p>//PWM1B: Pulse Width Modulator B Enable<br />
 GTCCR|=(1&lt;&lt;PWM1B);<br />
 //OC1x Set on compare match. Cleared when TCNT1= $00.<br />
 GTCCR&amp;=~(1&lt;&lt;COM1B1);<br />
 GTCCR|=(1&lt;&lt;COM1B0);<br />
 //clock select bits<br />
 TCCR1&amp;=~(1&lt;&lt;CS13);<br />
 TCCR1|=(1&lt;&lt;CS12);<br />
 TCCR1&amp;=~(1&lt;&lt;CS11);<br />
 TCCR1|=(1&lt;&lt;CS10);</p>
<p>//OCR1B=0xFF;<br />
 //OCR1C=0xFF;</p>
<p>while(1)<br />
 { ADCSRA |= (1&lt;&lt;ADSC);<br />
  while((ADCSRA&amp;0&#215;10)==0&#215;00);<br />
  temp=ADCH;</p>
<p>OCR0A=c;<br />
  OCR0B=b;<br />
  OCR1B=~a;</p>
<p>while(temp&gt;0)<br />
  { temp&#8211;;<br />
   _delay_ms(1);<br />
  }</p>
<p>if(aa==0)<br />
  { a=a+1;<br />
   if(a==0xFF)<br />
   aa=1;<br />
  }</p>
<p>  if(aa==1)<br />
  { a=a-1;<br />
   if(a==0)<br />
   aa=0;<br />
  }</p>
<p>if(bb==0)<br />
  { b=b+3;<br />
   if(b==0xFF)<br />
    bb=1;<br />
  }</p>
<p>  if(bb==1)<br />
  { b=b-3;<br />
   if(b==0)<br />
    bb=0;<br />
  }</p>
<p>if(cc==0)<br />
  { c=c+5;<br />
   if(c==0xFF)<br />
    cc=1;<br />
  }</p>
<p>  if(cc==1)<br />
  { c=c-5;<br />
   if(c==0)<br />
    cc=0;<br />
  }<br />
 }<br />
}</p></blockquote>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://voltsandbytes.com/8-pin-avr-based-mood-lamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USB Development Board</title>
		<link>http://voltsandbytes.com/usb-development-board/</link>
		<comments>http://voltsandbytes.com/usb-development-board/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 11:57:41 +0000</pubDate>
		<dc:creator>jer</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Development Board]]></category>
		<category><![CDATA[Development Tool]]></category>
		<category><![CDATA[Microchip]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC USB]]></category>
		<category><![CDATA[PIC18F]]></category>
		<category><![CDATA[PIC18F4550]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://voltsandbytes.com/?p=176</guid>
		<description><![CDATA[USB has established itself as the new standard for connectivity. That is why USB connectivity has become the “holy grail” of most embedded applications. Well, let me get straight to the point. If you want to start developing projects with USB interface, you want to have  the  proper development tools. To have the tools that you need, you either [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-194" title="USBPIC-front" src="http://voltsandbytes.com/wp-content/uploads/2009/11/USBPIC-front.jpg" alt="" width="588" height="248" /></p>
<p>USB has established itself as the new standard for connectivity. That is why USB connectivity has become the “holy grail” of most embedded applications.</p>
<p>Well, let me get straight to the point. If you want to start developing projects with USB interface, you want to have  the  proper development tools. To have the tools that you need, you either have to buy or to do-it-yourself.</p>
<p>If you want to build a USB development board yourself, here is one for you.<span id="more-176"></span></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-181" title="USBPIC-side1" src="http://voltsandbytes.com/wp-content/uploads/2010/07/USBPIC-side1.jpg" alt="" width="588" height="248" /></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-182" title="USBPIC-side2" src="http://voltsandbytes.com/wp-content/uploads/2010/07/USBPIC-side2.jpg" alt="" width="588" height="307" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p> This development board features Microchip’s PIC18F4550. This development board is a simplified version of <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en021940">Microchip’s PICDEM Full Speed USB</a>. It has one trimmer for ADC, LEDs, push buttons, and USB connector. Most of the pins of PIC18F4550 are brought out to header connectors. It is powered by USB port. Lastly, it is compatible with <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=2680&amp;dDocName=en537044">Microchip’s MCHPFSUSB USB Framework</a>.</p>
<p>Since this development board is a simplified PICDEM FS USB board, hex files can be loaded to PIC18F4550 using the USB bootloader provided by Microchip. Microchip also provided a software tool to download hex files to PIC18F4550.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-177" title="bot" src="http://voltsandbytes.com/wp-content/uploads/2010/07/bot.jpg" alt="" width="564" height="486" /></p>
<p style="text-align: center;"> <img class="aligncenter size-full wp-image-178" title="bot2" src="http://voltsandbytes.com/wp-content/uploads/2010/07/bot2.jpg" alt="" width="569" height="494" /></p>
<p style="text-align: center;"> <script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: left;">Here is a video of my development board in action.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/RYEouDEhILg" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/RYEouDEhILg"> </embed></object></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>Aside from the software tool, Microchip also provides a lot of application notes, sample codes, and libraries to help developers in developing USB embedded applications.</p>
<p>I tried writing a simple code using CDC and here is the video.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/lAA58gHTYWc" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/lAA58gHTYWc"></embed></object></p>
<p style="text-align: left;"> </p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>Download</strong></span></p>
<p style="text-align: left;">The schematic of the board can be downloaded <a href="http://voltsandbytes.com/wp-content/uploads/2010/07/pic18f4550-board.zip">here</a>. You will need Eagle CAD to open the schematic file.</p>
]]></content:encoded>
			<wfw:commentRss>http://voltsandbytes.com/usb-development-board/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8051 Tutorial 1: Introduction to AT89C2051</title>
		<link>http://voltsandbytes.com/8051-tutorial-1-introduction-to-at89c2051/</link>
		<comments>http://voltsandbytes.com/8051-tutorial-1-introduction-to-at89c2051/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 04:51:06 +0000</pubDate>
		<dc:creator>jer</dc:creator>
				<category><![CDATA[8051 Microcontroller]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[8051]]></category>
		<category><![CDATA[AT89C2051]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://voltsandbytes.com/?p=101</guid>
		<description><![CDATA[What is 8051? The 8051 is a popular 8-bit single chip microcontroller which was first introduced by Intel. The first 8051 is a 40-pin microcontroller which has 4kB of program memory, 128 bytes of RAM, 2 timer/counter, 1 UART, and six interrupt sources. Later on, the 8052 microcontroller was introduced. The 8052 microcontroller is a better [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><strong>What is 8051?</strong></p>
<p>The 8051 is a popular 8-bit single chip <a href="http://en.wikipedia.org/wiki/Microcontroller">microcontroller</a> which was first introduced by <a href="http://www.intel.com/">Intel</a>. The <a href="http://en.wikipedia.org/wiki/Intel_8051">first 8051</a> is a 40-pin microcontroller which has 4kB of program memory, 128 bytes of RAM, 2 timer/counter, 1 UART, and six interrupt sources.</p>
<p>Later on, the 8052 microcontroller was introduced. The 8052 microcontroller is a better version of 8051 microcontroller. It has 8kB of code memory and 256 bytes of RAM. It also has an additional timer.</p>
<p>8051 became very propular and it became an industry standard. Due to its popularity, many semiconductor manufacturers like <a href="http://www.atmel.com/">Atmel</a>, <a href="http://www.infineon.com/">Infineon Technologies</a>, <a href="http://www.maxim-ic.com/">Maxim Integrated Products</a>, <a href="http://www.nxp.com/">NXP</a>, <a href="http://www.st.com/">ST Microelectronics</a>, <a href="https://www.silabs.com/">Silicon Laboratories</a>, <a href="http://www.ti.com/">Texas Instruments</a>, <a href="http://www.cypress.com/">Cypress Semiconductor</a>, etc have included 8051 in their line of products.<span id="more-101"></span></p>
<p><strong>What is AT89C2051?</strong></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-128" title="AT89C2051" src="http://voltsandbytes.com/wp-content/uploads/2010/07/AT89C2051.jpg" alt="" width="600" height="402" /></p>
<p><a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=1938">AT89C2051</a> is manufactured by Atmel and it is a member of 8051 family of microcontrollers. Unlike the original 8051 microcontroller which has 40 pins, AT89C2051 has only 20 pins which makes it ideal for 8051 beginners. It takes the standard features of the original features of 8051 except that it has only 20 pins compared to 40 pins of the original 8051. However, AT89C2051 is made of flash program memory and it has additional on-chip analog comparator.</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="213" valign="top"><strong>8051</strong></td>
<td width="213" valign="top"><strong>8052</strong></td>
<td width="213" valign="top"><strong>AT89C2051</strong></td>
</tr>
<tr>
<td width="213" valign="top">4kB code memory</td>
<td width="213" valign="top">8kB code memory</td>
<td width="213" valign="top">2 kB code memory</td>
</tr>
<tr>
<td width="213" valign="top">128 bytes RAM</td>
<td width="213" valign="top">256 bytes RAM</td>
<td width="213" valign="top">128 bytes RAM</td>
</tr>
<tr>
<td width="213" valign="top">Two 16-bit Timer Counters</td>
<td width="213" valign="top">Three 16-bit Timer/Counters</td>
<td width="213" valign="top">Two 16-bit Timer Counters</td>
</tr>
<tr>
<td width="213" valign="top">One Programmable Serial UART</td>
<td width="213" valign="top">One Programmable Serial UART</td>
<td width="213" valign="top">One Programmable Serial UART</td>
</tr>
<tr>
<td width="213" valign="top">40 pins (32 IO pins)</td>
<td width="213" valign="top">40 pins (32 IO pins)</td>
<td width="213" valign="top">20 pins (15 IO pins)</td>
</tr>
<tr>
<td width="213" valign="top">Six Interrupt Sources</td>
<td width="213" valign="top">Eight Interrupt Sources</td>
<td width="213" valign="top">Six Interrupt Sources</td>
</tr>
<tr>
<td width="213" valign="top"> </td>
<td width="213" valign="top"> </td>
<td width="213" valign="top">On-chip Analog Comparator</td>
</tr>
</tbody>
</table>
<p><strong> </strong> </p>
<p><strong>AT89C2051 Pin Diagram and Description</strong></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-107" title="AT89C2051-pin" src="http://voltsandbytes.com/wp-content/uploads/2010/07/AT89C2051-pin.jpg" alt="" width="600" height="389" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>VCC</p>
<p style="padding-left: 30px;">This pin is the supply voltage pin. The voltage range that can be supplied to this pin is from 2.7 volts to 6 volts but the most commonly used is 5 volts. Just remember to put a decoupling capacitor across this pin to filter out sudden voltage changes in the supply line and put the capacitor as close to VCC pin as possible. Typical values for the capacitor is 100nF.</p>
<p>GND</p>
<p style="padding-left: 30px;">This is the pin for ground.</p>
<p>XTAL1 &amp; XTAL2</p>
<p style="text-align: left; padding-left: 30px;">These are the input and output, respectively, of the inverting oscillator amplier located inside AT89C2051. The inverting oscillator amplier can be used as an on-chip oscillator as shown below. Either a quartz crystal or a ceramic resonator may be used. The values of C1 and C2 can be from 20pF to 40pF if a quartz crystal is used and 30pF to 50pF if a ceramic oscillator is used. Frequencies can be up to 24MHz.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-109" title="AT89C2051-oscillator" src="http://voltsandbytes.com/wp-content/uploads/2010/07/AT89C2051-oscillator.jpg" alt="" width="600" height="324" /></p>
<p style="padding-left: 30px;">The device can also be driven by an external clock source. Just connect the external clock source to XTAL1 and leave XTAL2 unconnected.</p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-111" title="AT89C2051- clock" src="http://voltsandbytes.com/wp-content/uploads/2010/07/AT89C2051-clock.png" alt="" width="600" height="324" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>RST</p>
<p style="padding-left: 30px;">This is the input for device reset. The device is being reset as soon as the RST pin goes HIGH.</p>
<p style="padding-left: 30px;">There is one thing that must be considered for this pin. The  AT89C2051 must operate as intended as soon as it is powered up. To be able to make that happen, AT89C2051 must perform the first instruction located in its program memory. Therefore, the MCU must undergo a reset upon powering up and this is called the <strong>power-on reset</strong>. The power-on reset for AT89C2051 will only occur when there is a capacitor across VCC and RST pin and a pulldown resitor from RST to ground. The typical configuration for the RST is shown below.</p>
<p style="text-align: center;"> <img class="aligncenter size-full wp-image-113" title="AT89C2051- reset" src="http://voltsandbytes.com/wp-content/uploads/2010/07/AT89C2051-reset.png" alt="" width="600" height="335" /></p>
<p>P1.0 – P1.7</p>
<p style="padding-left: 30px;">Pins <strong>P1.0</strong> to <strong>P1.7</strong> are the pins of <strong>Port1</strong>. These pins are bidirectional which means any pin of <strong>Port1</strong> can be used as an input pin or an output pin. Pins <strong>P1.2</strong> to <strong>P1.7</strong> have internal pullups but pins<strong> P1.0</strong> and <strong>P1.1</strong> require external pullups. However, pins <strong>P1.0</strong> and <strong>P1.1</strong> are also used as inputs of the on-chip analog comparator.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-115" title="AT89C2051- p1p3" src="http://voltsandbytes.com/wp-content/uploads/2010/07/AT89C2051-p1p3.png" alt="" width="600" height="236" /></p>
<p>P3.0 - P3.7</p>
<p style="text-align: left; padding-left: 60px;">Pins <strong>P3.0</strong> to <strong>P3.7</strong> are the pins of <strong>Port3</strong>. Like the <strong>Port1</strong>, <strong>Port3</strong> is also bidirectional and all pins have internal pullups. <strong>P3.6</strong> can not be accessed externally because it is hard-wired internally to the output of the on-chip analog comparator. Other functions of the pins of <strong>Port3</strong> are shown below: </p>
<table style="text-align: left;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="text-align: center;" width="115" valign="top"><strong>Port Pin</strong></td>
<td style="text-align: center;" width="408" valign="top"><strong>Alternate Functions</strong></td>
</tr>
<tr>
<td style="text-align: center;" width="115" valign="top">P1.0</td>
<td width="408" valign="top">AIN0 (positive input) of the on-chip precision analog comparator</td>
</tr>
<tr>
<td style="text-align: center;" width="115" valign="top">P1.1</td>
<td width="408" valign="top">AIN1 (negative input) of the on-chip precision analog comparator</td>
</tr>
<tr>
<td style="text-align: center;" width="115" valign="top">P3.0</td>
<td width="408" valign="top">RXD (serial input port)</td>
</tr>
<tr>
<td style="text-align: center;" width="115" valign="top">P3.1</td>
<td width="408" valign="top">TXD (serial output port)</td>
</tr>
<tr>
<td style="text-align: center;" width="115" valign="top">P3.2</td>
<td width="408" valign="top">INT0 (external interrupt 0)</td>
</tr>
<tr>
<td style="text-align: center;" width="115" valign="top">P3.3</td>
<td width="408" valign="top">INT1 (external interrupt 1)</td>
</tr>
<tr>
<td style="text-align: center;" width="115" valign="top">P3.4</td>
<td width="408" valign="top">T0 (timer 0 external input)</td>
</tr>
<tr>
<td style="text-align: center;" width="115" valign="top">P3.5</td>
<td width="408" valign="top">T1 (timer 1 external input)</td>
</tr>
</tbody>
</table>
<p style="text-align: center;"><strong> </strong><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
google_ad_slot = "5940435964";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: left;"><strong>AT89C2051 Basic Hardware Configuration</strong></p>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-123" title="AT89C2051- basic" src="http://voltsandbytes.com/wp-content/uploads/2010/07/AT89C2051-basic.png" alt="" width="600" height="321" /></p>
<p style="text-align: left;">The image above shows the summary of what was just discussed and it shows the basic hardware configuration to make AT89C2051 work.</p>
]]></content:encoded>
			<wfw:commentRss>http://voltsandbytes.com/8051-tutorial-1-introduction-to-at89c2051/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
