<?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>
	<atom:link href="http://www.voltsandbytes.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.voltsandbytes.com</link>
	<description>Your Analog and Digital Electronics Hobby Site</description>
	<lastBuildDate>Sun, 03 Jan 2010 22:24:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>8-pin AVR based Mood Lamp</title>
		<link>http://www.voltsandbytes.com/8-pin-avr-based-mood-lamp/</link>
		<comments>http://www.voltsandbytes.com/8-pin-avr-based-mood-lamp/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 13:35:52 +0000</pubDate>
		<dc:creator>kuya</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[ATtiny]]></category>
		<category><![CDATA[ATTiny45]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[RGB]]></category>

		<guid isPermaLink="false">http://www.voltsandbytes.com/?p=527</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 ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-medium wp-image-533" title="RGB" src="http://www.voltsandbytes.com/wp-content/uploads/2009/12/RGB-400x299.jpg" alt="RGB" width="400" height="299" /></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.</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/SERIAuIXsew" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/SERIAuIXsew"></embed></object></p>
<p style="TEXT-ALIGN: center"> <script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>I soldered a potentiometer to ATtiny45 to provide an input to its on-chip ADC or analog-to-digital converter. The speed of the color transitions from the RGB Led can, then, be controlled by adjusting the potentiometer.</p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-530" title="mood-potentiometer" src="http://www.voltsandbytes.com/wp-content/uploads/2009/12/mood-potentiometer-400x299.jpg" alt="mood-potentiometer" width="400" height="299" /></p>
<p style="text-align: center;"> <script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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 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-medium wp-image-531" title="moodprototype1" src="http://www.voltsandbytes.com/wp-content/uploads/2009/12/moodprototype1-400x299.jpg" alt="moodprototype1" width="400" height="299" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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: center;"><img class="aligncenter size-medium wp-image-532" title="prototype2" src="http://www.voltsandbytes.com/wp-content/uploads/2009/12/prototype2-400x299.jpg" alt="prototype2" width="400" height="299" /></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-540" title="sch" src="http://www.voltsandbytes.com/wp-content/uploads/2009/12/sch-600x341.jpg" alt="sch" width="600" height="341" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* Txt-banner */
google_ad_slot = "1215599900";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="TEXT-ALIGN: left">The following is the source code. The compiler that I used is WinAVR.</p>
<blockquote>
<pre>#include &lt;avr/io.h&gt;
#define F_CPU 1000000UL
#include &lt;util/delay.h&gt;</pre>
<pre>int main(void)
{ unsigned char a=0,b=0,c=0,aa=0,bb=0,cc=0,temp;
 DDRB=0xFF;
 PORTB=0xFF;</pre>
<pre> //initialize ADC
 ADMUX=0b00100011;
 ADCSRA=0b10000100;</pre>
<pre> //Set OC0A on Compare Match, clear OC0A at BOTTOM
 TCCR0A|=(1&lt;&lt;COM0A1); 
 TCCR0A|=(1&lt;&lt;COM0A0); 
 //Set OC0B on Compare Match, clear OC0B at BOTTOM
 TCCR0A|=(1&lt;&lt;COM0B1); 
 TCCR0A|=(1&lt;&lt;COM0B0);
 //Fast PWM, TOP=0xFF, Update of OCRx at BOTTOM
 TCCR0A|=(1&lt;&lt;WGM01);     
 TCCR0A|=(1&lt;&lt;WGM00);
 //clkI/O/(No prescaling)
 TCCR0B&amp;=~(1&lt;&lt;WGM02); 
 TCCR0B&amp;=~(1&lt;&lt;CS02);  
 TCCR0B&amp;=~(1&lt;&lt;CS01);
 TCCR0B|=(1&lt;&lt;CS00);</pre>
<pre> OCR0A=0x00;
 OCR0B=0x00;</pre>
<pre> //PWM1B: Pulse Width Modulator B Enable
 GTCCR|=(1&lt;&lt;PWM1B);
 //OC1x Set on compare match. Cleared when TCNT1= $00.
 GTCCR&amp;=~(1&lt;&lt;COM1B1);
 GTCCR|=(1&lt;&lt;COM1B0);
 //clock select bits
 TCCR1&amp;=~(1&lt;&lt;CS13);
 TCCR1|=(1&lt;&lt;CS12);
 TCCR1&amp;=~(1&lt;&lt;CS11);
 TCCR1|=(1&lt;&lt;CS10);</pre>
<pre> //OCR1B=0xFF;
 //OCR1C=0xFF;</pre>
<pre> while(1)
 { ADCSRA |= (1&lt;&lt;ADSC);
  while((ADCSRA&amp;0x10)==0x00);
  temp=ADCH;</pre>
<pre>  OCR0A=c;
  OCR0B=b;
  OCR1B=~a;</pre>
<pre>  while(temp&gt;0)
  { temp--;
   _delay_ms(1);
  }</pre>
<pre>  if(aa==0)
  { a=a+1;
   if(a==0xFF)
   aa=1;
  }
  
  if(aa==1)
  { a=a-1;
   if(a==0)
   aa=0;
  }</pre>
<pre>  if(bb==0)
  { b=b+3;
   if(b==0xFF)
    bb=1;
  }
  
  if(bb==1)
  { b=b-3;
   if(b==0)
    bb=0;
  }</pre>
<pre>  if(cc==0)
  { c=c+5;
   if(c==0xFF)
    cc=1;
  }
   
  if(cc==1)
  { c=c-5;
   if(c==0)
    cc=0;
  }
 }
}</pre>
</blockquote>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.voltsandbytes.com/8-pin-avr-based-mood-lamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8051 Tutorial 6: 8051 Interrupts Programming in C</title>
		<link>http://www.voltsandbytes.com/8051-tutorial-6-8051-interrupts-programming-in-c/</link>
		<comments>http://www.voltsandbytes.com/8051-tutorial-6-8051-interrupts-programming-in-c/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 06:54:08 +0000</pubDate>
		<dc:creator>kuya</dc:creator>
				<category><![CDATA[8051 Microcontroller]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[8051]]></category>
		<category><![CDATA[AT89C2051]]></category>
		<category><![CDATA[Interrupt]]></category>
		<category><![CDATA[Interrupts]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.voltsandbytes.com/?p=479</guid>
		<description><![CDATA[



What is an interrupt?
An interrupt is an asynchronous signal that needs attention. An interrupt stops the CPU of a microcontroller, leaving the tasks that it is currently doing, to give attention to the interrupt signal. Once the attention has been given to the interrupt signal, the CPU goes back to its unaccomplished ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>
<h3 style="text-align: left;">What is an interrupt?</h3>
<p style="text-align: left;">An interrupt is an asynchronous signal that needs attention. An interrupt stops the CPU of a microcontroller, leaving the tasks that it is currently doing, to give attention to the interrupt signal. Once the attention has been given to the interrupt signal, the CPU goes back to its unaccomplished task before the interrupt has occured and continues the task.</p>
<h3 style="text-align: left;">The Interrupts of AT89C2051</h3>
<p style="text-align: left;">The interrupts of AT89C2051 is compatible with the interrupts of the original 8051 microcontroller. It has 6 interrupts sources ( 5 interrupts + RESET). The interrupt sources of AT89C2051 are the following:</p>
<table style="text-align: center;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="19" valign="top"> </td>
<td width="138" valign="top"><strong>Interrupt </strong></td>
<td width="90" valign="top"><strong>Source</strong></td>
<td width="132" valign="top"><strong>Priority Number</strong></td>
</tr>
<tr>
<td width="19" valign="top">1</td>
<td width="138" valign="top">RESET</td>
<td width="90" valign="top">RST</td>
<td width="132" valign="top">N/A</td>
</tr>
<tr>
<td width="19" valign="top">2</td>
<td width="138" valign="top">External Interrupt 0</td>
<td width="90" valign="top">IE0</td>
<td width="132" valign="top">0</td>
</tr>
<tr>
<td width="19" valign="top">3</td>
<td width="138" valign="top">Timer 0 Interrupt</td>
<td width="90" valign="top">TF0</td>
<td width="132" valign="top">1</td>
</tr>
<tr>
<td width="19" valign="top">4</td>
<td width="138" valign="top">External Interrupt 1</td>
<td width="90" valign="top">IE1</td>
<td width="132" valign="top">2</td>
</tr>
<tr>
<td width="19" valign="top">5</td>
<td width="138" valign="top">Timer 1 Interrupt</td>
<td width="90" valign="top">TF1</td>
<td width="132" valign="top">3</td>
</tr>
<tr>
<td width="19" valign="top">6</td>
<td width="138" valign="top">UART Interrupt</td>
<td width="90" valign="top">RI or TI</td>
<td width="132" valign="top">4</td>
</tr>
</tbody>
</table>
<p style="text-align: left;"><em>Please note that in this tutorial, we will not consider the interrupt from RESET.</em></p>
<p style="text-align: left;">The table above shows the interrupt sources of AT89C2051 and their respective interrupt priority number. Knowing the priority number is important specially if two different interrupt sources occur at the same time.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>
<h3 style="text-align: left;">Interrupt Enable Register</h3>
<p style="text-align: left;">The <strong>Interrupt Enable</strong> (<strong>IE</strong>) register is responsible in enabling and disabling the different interrupt sources of 8051.</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-488" title="IEregister" src="http://www.voltsandbytes.com/wp-content/uploads/2009/11/IEregister-600x91.jpg" alt="IEregister" width="600" height="91" /></p>
<p style="text-align: center;"> </p>
<table style="text-align: center;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="text-align: left;" width="43" valign="top"><strong>EA</strong></td>
<td style="text-align: left;" width="595" valign="top">Disables all interrupts. If EA = 0, no interrupt is acknowledged. If EA = 1, each interrupt source is individually enabled or disabled by setting or clearing its enable bit.</td>
</tr>
<tr>
<td style="text-align: left;" width="43" valign="top"><strong>__</strong></td>
<td style="text-align: left;" width="595" valign="top">Not implemented</td>
</tr>
<tr>
<td style="text-align: left;" width="43" valign="top"><strong>__</strong></td>
<td style="text-align: left;" width="595" valign="top">Not implemented in AT89C2051 but it is implemented as ET2 in 8052 compatible microcontrollers such as AT89S52 (Enables or disables the Timer 2 overflow or capture interrupt)</td>
</tr>
<tr>
<td style="text-align: left;" width="43" valign="top"><strong>ES</strong></td>
<td style="text-align: left;" width="595" valign="top">Enables or disables the serial port interrupt.</td>
</tr>
<tr>
<td style="text-align: left;" width="43" valign="top"><strong>ET1</strong></td>
<td style="text-align: left;" width="595" valign="top">Enables or disables the Timer 1 overflow interrupt.</td>
</tr>
<tr>
<td style="text-align: left;" width="43" valign="top"><strong>EX1</strong></td>
<td style="text-align: left;" width="595" valign="top">Enables or disables External Interrupt 1.</td>
</tr>
<tr>
<td style="text-align: left;" width="43" valign="top"><strong>ET0</strong></td>
<td style="text-align: left;" width="595" valign="top">Enables or disables the Timer 0 overflow interrupt.</td>
</tr>
<tr>
<td style="text-align: left;" width="43" valign="top"><strong>EX0</strong></td>
<td style="text-align: left;" width="595" valign="top">Enables or disables External Interrupt 0.</td>
</tr>
</tbody>
</table>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>
<h3 style="text-align: left;">How To Enable an Interrupt</h3>
<p style="text-align: left;">1. Initialize the sources of interrupts such as Timers, External Interrupts, or UART.</p>
<p style="text-align: left;">2. Set the bits of the<strong> IE</strong> register that corresponds to the interrupt sources that you want to be enabled.</p>
<p style="text-align: left; padding-left: 30px;">Example: If you want to enable the interrupt of the serial port or UART set<strong> ES</strong> to 1 or <strong>ES</strong>=1.</p>
<p style="text-align: left;">3. Enable the global interrupt by setting the <strong>EA</strong> bit of the <strong>IE</strong> register (EA=1).</p>
<h3 style="text-align: left;">How to Write an interrupt service routine or ISR</h3>
<p style="text-align: left;">The <strong>interrupt service routine</strong> or<strong> ISR</strong> is the routine that an MCU is servicing every time an interrupt occurs. It can be treated as an ordinary subroutine in a C program.</p>
<p style="text-align: left;">The format of the <strong>ISR</strong> is:</p>
<blockquote style="text-align: center;">
<pre style="text-align: left;"> void <strong><em>your_ISR_name</em></strong>(void) interrupt <strong><em>interrupt_priority_number</em></strong>
 {
  <strong>//your routine here</strong>
 }</pre>
</blockquote>
<p> The <em>your_ISR_name</em> is user defined. It can be any name.</p>
<p>The <em>interrupt_priority_number</em> is fixed depending on the source of the interrupt. Refer to the table of the interrupt sources above for reference.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* txt-img-banner */
google_ad_slot = "1822032645";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.voltsandbytes.com/8051-tutorial-6-8051-interrupts-programming-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>USB Development Board</title>
		<link>http://www.voltsandbytes.com/pic18f4550-development-board/</link>
		<comments>http://www.voltsandbytes.com/pic18f4550-development-board/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 10:33:12 +0000</pubDate>
		<dc:creator>kuya</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://www.voltsandbytes.com/?p=454</guid>
		<description><![CDATA[USB has established itself as the new standard for connectivity. That is why USB connectivity has become the &#8220;holy grail&#8221; 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 ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">USB has established itself as the new standard for connectivity. That is why USB connectivity has become the &#8220;holy grail&#8221; 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.</p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-458" title="4" src="http://www.voltsandbytes.com/wp-content/uploads/2009/11/4-400x163.jpg" alt="4" width="400" height="163" /></p>
<p style="text-align: center;"><span id="more-454"></span><img class="aligncenter size-medium wp-image-457" title="3" src="http://www.voltsandbytes.com/wp-content/uploads/2009/11/3-400x228.jpg" alt="3" width="400" height="228" /></p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-455" title="1" src="http://www.voltsandbytes.com/wp-content/uploads/2009/11/1-400x245.jpg" alt="1" width="400" height="245" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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 schematic can be downloaded <a href="http://www.voltsandbytes.com/wp-content/uploads/2009/11/pic18f4550-board.zip">here</a>. You will need Eagle CAD to open the schematic file.</p>
<p>This development board features Microchip&#8217;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&#8217;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&#8217;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-medium wp-image-460" title="bot" src="http://www.voltsandbytes.com/wp-content/uploads/2009/11/bot-400x344.jpg" alt="bot" width="400" height="344" /></p>
<p> </p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-461" title="bot2" src="http://www.voltsandbytes.com/wp-content/uploads/2009/11/bot2-400x347.jpg" alt="bot2" width="400" height="347" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>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/rkoynLGxxXQ" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/rkoynLGxxXQ"></embed></object><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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/Vc5tTi2lxwY" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/Vc5tTi2lxwY"></embed></object></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* txt-img-banner */
google_ad_slot = "1822032645";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.voltsandbytes.com/pic18f4550-development-board/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8051 Tutorial 5: 8051 UART Programming in C</title>
		<link>http://www.voltsandbytes.com/8051-tutorial-5-8051-uart-programming-in-c/</link>
		<comments>http://www.voltsandbytes.com/8051-tutorial-5-8051-uart-programming-in-c/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 09:37:50 +0000</pubDate>
		<dc:creator>kuya</dc:creator>
				<category><![CDATA[8051 Microcontroller]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[8051]]></category>
		<category><![CDATA[AT89C2051]]></category>
		<category><![CDATA[RS-232]]></category>
		<category><![CDATA[RS232]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[UART]]></category>

		<guid isPermaLink="false">http://www.voltsandbytes.com/?p=289</guid>
		<description><![CDATA[



What is UART?
UART stands for Universal Asynchronous Receiver/Transmitter. As its name implies, it is universal. It can be used to establish a communication between a microcontroller and another device &#8211; microcontroller, USB controller, Bluetooth modules, GSM modules, GPS modules, personal computers, etc.
I am not going to discuss the UART protocol ...]]></description>
			<content:encoded><![CDATA[<p style="TEXT-ALIGN: center"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>
<h3>What is UART?</h3>
<p><strong>UART</strong> stands for <strong>Universal Asynchronous Receiver/Transmitter</strong>. As its name implies, it is universal. It can be used to establish a communication between a microcontroller and another device &#8211; microcontroller, USB controller, Bluetooth modules, GSM modules, GPS modules, personal computers, etc.<span id="more-289"></span></p>
<p>I am not going to discuss the UART protocol here. If UART is still unknown to you, you may read <a href="http://en.wikipedia.org/wiki/UART">this article from wikipedia</a> first.</p>
<h3>What is RS-232?</h3>
<p><strong>RS-232</strong> is a standard for serial transmission of data between a <strong>DTE</strong> (Data Terminal Equipment) and a <strong>DCE</strong> (Data Circuit-terminating Equipment). It is commonly found in desktop computers where it is commonly referred as <strong>COM port</strong>. You can read <a href="http://en.wikipedia.org/wiki/RS-232">this wikipedia article</a> for more info about the RS-232 standard.</p>
<h3>AT89C2051 UART</h3>
<p>The AT89C2051 has one UART port. Its <strong>TXD</strong> (<em>Transmit</em>) pin is the same as its <strong>P3.1</strong> pin. Its <strong>RXD</strong> (<em>Receive</em>) pin is the same as its <strong>P3.0 </strong>pin.</p>
<h3>AT89C2051 RS-232 Interface</h3>
<p>The UART port of a microcontroller can be used to interface to a RS-232 port of a personal computer. However, the voltage levels of UART must be converted to voltage levels compatible to RS-232.</p>
<p>To convert UART voltage levels to RS-232 voltage levels, you may use the following circuits:</p>
<h4>1. Using a MAX232 or similar IC</h4>
<p><img class="aligncenter size-large wp-image-403" title="ttl-rs232-max232" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/ttl-rs232-max232-600x402.jpg" alt="ttl-rs232-max232" width="600" height="402" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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 is the most preferred circuit to convert UART using the TTL voltage levels to RS232 voltage levels. The 5V levels are converted by MAX232 to -9V to -12V and vice versa. The 0V levels are converted by MAX232 to +9V to +12V and vice versa.</p>
<p>The female DB-9 connector is used to connect with the RS-232 port of a personal computer.</p>
<h4>2. Using Transistors</h4>
<p><img class="aligncenter size-large wp-image-404" title="ttl-rs232-transistor" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/ttl-rs232-transistor-600x399.jpg" alt="ttl-rs232-transistor" width="600" height="399" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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 circuit is preferred by budget conscious individuals. The transistors serve as inverters. The NPN transistor converts negative voltage levels to +VCC  and positive voltage levels to 0V. The PNP transistor converts the +logic level from the TXD pin of a MCU (equal to VCC) to 0V and the 0V level from the MCU to +VCC.</p>
<p><em>Please note that the circuits above are used to convert UART lines with 0-5V levels to RS232 voltage levels. This means that the circuits above should be used to interface a microcontroller to a device with RS-232 port (personal computers). Other devices with UART ports such as GSM modules, GPS modules, Bluetooth modules, RF modules, etc <strong>does not require</strong> the RS-232 to UART converters. These devices can be interfaced to MCUs directly (as long as voltage levels for both ends are compatible with each other).</em></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* txt-img-banner */
google_ad_slot = "1822032645";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.voltsandbytes.com/8051-tutorial-5-8051-uart-programming-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Handy FPGA Laboratory</title>
		<link>http://www.voltsandbytes.com/handy-fpga-laboratory/</link>
		<comments>http://www.voltsandbytes.com/handy-fpga-laboratory/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 07:33:51 +0000</pubDate>
		<dc:creator>kuya</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Development Board]]></category>
		<category><![CDATA[Development Tool]]></category>
		<category><![CDATA[FPGA]]></category>
		<category><![CDATA[Spartan 3-E]]></category>
		<category><![CDATA[Spartan3E]]></category>
		<category><![CDATA[Xilinx]]></category>

		<guid isPermaLink="false">http://www.voltsandbytes.com/?p=293</guid>
		<description><![CDATA[



Want to learn real digital hardware design? You might want to consider Field Programmable Grid Arrays or FPGAs. There are a lot of FPGA learning kits available today. Some are specially designed to target developments of commercial projects which are, of course, very expensive. Some are a little bit price friendly ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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;">Want to learn real digital hardware design? You might want to consider <a href="http://en.wikipedia.org/wiki/Field-programmable_gate_array">Field Programmable Grid Arrays or FPGAs</a>. There are a lot of FPGA learning kits available today. Some are specially designed to target developments of commercial projects which are, of course, very expensive. Some are a little bit price friendly specially for students and FPGA newbies (like me).<span id="more-293"></span></p>
<p style="text-align: left;">I got one FPGA development board designed by <a href="http://www.digilentinc.com/">Digilent</a> which is the <a href="http://www.digilentinc.com/Products/Detail.cfm?Prod=BASYS&amp;Nav1=Products&amp;Nav2=Programmable">Basys FPGA board</a> (there is already a newer version &#8211; <a href="http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,790&amp;Prod=BASYS2">Basys2</a>). The regular price is USD79 and the academic price is USD59. I got mine from <a href="http://www.ebay.com">ebay</a> for USD49 &#8211; of course, it is already used.</p>

<a href='http://www.voltsandbytes.com/handy-fpga-laboratory/basys-box/' title='basys-box'><img width="150" height="150" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/basys-box-150x150.jpg" class="attachment-thumbnail" alt="Digilent Basys FPGA Board - Box" title="basys-box" /></a>
<a href='http://www.voltsandbytes.com/handy-fpga-laboratory/basys-top/' title='basys-top'><img width="150" height="150" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/basys-top-150x150.jpg" class="attachment-thumbnail" alt="Digilent Basys FPGA Board - Top View" title="basys-top" /></a>
<a href='http://www.voltsandbytes.com/handy-fpga-laboratory/basys-bottom/' title='basys-bottom'><img width="150" height="150" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/basys-bottom-150x150.jpg" class="attachment-thumbnail" alt="Digilent Basys FPGA Board - Bottom View" title="basys-bottom" /></a>

<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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;">So, what does this FPGA board feature?</p>
<p style="padding-left: 30px;">The on-board FPGA is from the Spartan 3-E family of <a href="http://www.xilinx.com">Xilinx</a>.</p>
<p style="padding-left: 30px;">It has on board I/O devices &#8211; 7-segment displays, LEDs, slide, switches, and push buttons.</p>
<p style="padding-left: 30px;">It has one VGA port and one PS/2 port.</p>
<p style="padding-left: 30px;">It has external I/O  connectors.</p>
<p style="padding-left: 30px;">It can be powered by USB or wall DC adaptor.</p>
<p style="padding-left: 30px;">It has on-board oscillator &#8211; 25, 50, and 100MHz.</p>
<p style="padding-left: 30px;">It has on-board flash configuration ROM.</p>
<p style="padding-left: 30px;">It can be configured using the on-board USB board!</p>
<p>Pretty complete, isn&#8217;t it?</p>
<p>Indeed, it is a handy FPGA laboratory&#8230;</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* txt-img-banner */
google_ad_slot = "1822032645";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="text-align: center;"> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.voltsandbytes.com/handy-fpga-laboratory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>8051 Tutorial 4: 8051 Timer/Counter Programming in C</title>
		<link>http://www.voltsandbytes.com/8051-tutorial-4-8051-timercounter-programming-in-c/</link>
		<comments>http://www.voltsandbytes.com/8051-tutorial-4-8051-timercounter-programming-in-c/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 04:10:19 +0000</pubDate>
		<dc:creator>kuya</dc:creator>
				<category><![CDATA[8051 Microcontroller]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[8051]]></category>
		<category><![CDATA[AT89C2051]]></category>
		<category><![CDATA[Counter]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Timer]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.voltsandbytes.com/?p=221</guid>
		<description><![CDATA[Introduction
This tutorial is about using the internal timers/counters of 8051. This will tackle the registers associated with the internal timers/counters of 8051 and this will also enumerate the steps on using the timers/counters.
The Timers/Counters of AT89C2051
The AT89C2051 has two 16-bit Timer/Counters: Timer0 and Timer1. This means that it can time/count from ...]]></description>
			<content:encoded><![CDATA[<h3 style="TEXT-ALIGN: left">Introduction</h3>
<p>This tutorial is about using the internal timers/counters of 8051. This will tackle the registers associated with the internal timers/counters of 8051 and this will also enumerate the steps on using the timers/counters.<span id="more-221"></span></p>
<h3>The Timers/Counters of AT89C2051</h3>
<p>The AT89C2051 has two <strong>16-bit</strong> Timer/Counters: <strong>Timer0</strong> and <strong>Timer1</strong>. This means that it can time/count from <strong>0-65535</strong>. The timers can be used to generate accurate delays and the counters can be used to count events. An event can be anything. It can be a pulse, a push, a pull, or any stimulus.</p>
<h3>Basic Registers of Timer/Counter</h3>
<h4>Timer0 Registers</h4>
<p>Timer0 is a 16-bit timer/counter and it is accesed as <strong>TH0</strong> (Timer0 high byte) and <strong>TL0</strong> (Timer0 low byte).</p>
<p style="text-align: left;"><img class="aligncenter size-large wp-image-230" title="Timer0" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/Timer0-600x51.jpg" alt="Timer0" width="600" height="51" /></p>
<h4>Timer1 Registers</h4>
<p>Timer1 is a 16-bit timer/counter and it is accesed as <strong>TH1</strong> (Timer1 high byte) and <strong>TL1</strong> (Timer1 low byte).</p>
<p><img class="aligncenter size-large wp-image-231" title="Timer1" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/Timer1-600x51.jpg" alt="Timer1" width="600" height="51" /></p>
<h4 style="text-align: left;">TMOD Register</h4>
<p style="text-align: left;">The TMOD (timer mode) register sets the operational modes of Time0 and Timer1. It is 8 bits wide in which the upper nibble is for Timer1 and the lower nibble is for Timer0.</p>
<p style="text-align: left;"><img class="aligncenter size-large wp-image-249" title="TMOD" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/TMOD-600x114.jpg" alt="TMOD" width="600" height="114" /></p>
<p style="TEXT-ALIGN: center"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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><strong>GATE</strong>: Gating control when set. Timer/Counter x is enabled only while INTx pin is high and TRx control pin is set. When cleared, Timer x is enabled whenever TRx control bit is set.</p>
<p><strong>C/T</strong>: If <strong>C/T</strong> = 1, the counter operation is selected. If <strong>C/T</strong>=0, the timer operation is selected</p>
<p><strong>M1</strong>: Mode bit 1</p>
<p><strong>M0</strong>: Mode bit 0</p>
<p><em>When the timer operating mode is selected, the clock source of the timer is the same as the clock source of AT89C2051 (ex: external quartz crystal). The frequency of the timer&#8217;s clock source is equal to the frequency of At89C2051&#8217;s</em><em> clock source divided by 12. If the clock source is a 12MHz quartz crystal, the timer&#8217;s clock frequency is equal to 12MHz/12  = 1MHz.</em></p>
<h4>TCON Register</h4>
<p>The TCON (Timer/counter control) register is responsible to the control and status bits of  AT89C2051&#8217;s timers/counters (and external interrupts).</p>
<p><img class="aligncenter size-large wp-image-250" title="TCON" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/TCON-600x89.jpg" alt="TCON" width="600" height="89" /></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="44">
<p align="center"><strong>TF1</strong></p>
</td>
<td width="583" valign="top">Timer 1 overflow flag. Set by hardware on Timer/Counter overflow. Cleared by hardware when processor vectors to interrupt routine.</td>
</tr>
<tr>
<td width="44">
<p align="center"><strong>TR1</strong></p>
</td>
<td width="583" valign="top">Timer 1 run control bit. Set/cleared by software to turn Timer/Counter on/off.</td>
</tr>
<tr>
<td width="44">
<p align="center"><strong>TF0</strong></p>
</td>
<td width="583" valign="top">Timer 0 overflow flag. Set by hardware on Timer/Counter overflow. Cleared by hardware when processor vectors to interrupt routine.</td>
</tr>
<tr>
<td width="44">
<p align="center"><strong>TR0</strong></p>
</td>
<td width="583" valign="top">Timer 0 run control bit. Set/cleared by software to turn Timer/Counter on/off.</td>
</tr>
<tr>
<td width="44">
<p align="center"><strong>IE1</strong></p>
</td>
<td width="583" valign="top">Interrupt 1 edge flag. Set by hardware when external interrupt edge detected. Cleared when interrupt processed.</td>
</tr>
<tr>
<td width="44">
<p align="center"><strong>IT1</strong></p>
</td>
<td width="583" valign="top">Interrupt 1 type control bit. Set/cleared by software to specify falling edge/low level triggered external interrupts.</td>
</tr>
<tr>
<td width="44">
<p align="center"><strong>IE0</strong></p>
</td>
<td width="583" valign="top">Interrupt 0 edge flag. Set by hardware when external interrupt edge detected. Cleared when interrupt processed.</td>
</tr>
<tr>
<td width="44">
<p align="center"><strong>IT0</strong></p>
</td>
<td width="583" valign="top">Interrupt 0 type control bit. Set/cleared by software to specify falling edge/low level triggered external interrupts.</td>
</tr>
</tbody>
</table>
<p style="TEXT-ALIGN: center"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* txt-img-banner */
google_ad_slot = "1822032645";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.voltsandbytes.com/8051-tutorial-4-8051-timercounter-programming-in-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>All-in-One AVR Development Tool</title>
		<link>http://www.voltsandbytes.com/all-in-one-avr-development-tool/</link>
		<comments>http://www.voltsandbytes.com/all-in-one-avr-development-tool/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 13:22:18 +0000</pubDate>
		<dc:creator>kuya</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Atmel]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[AVR Dragon]]></category>
		<category><![CDATA[Development Board]]></category>
		<category><![CDATA[Development Tool]]></category>

		<guid isPermaLink="false">http://www.voltsandbytes.com/?p=270</guid>
		<description><![CDATA[



If you are an AVR fan, you must be familiar with most of Atmel&#8217;s AVR development  tools: STK500, AVR Studio, AVRISP, AVR TJAGICE, AVR JTAGICE mkII, AVRISP mkII, STK600, etc. But there is one Atmel AVR development tool that provides ISP programming, High Voltage Programming, and debugging which comes in small ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>If you are an AVR fan, you must be familiar with most of <a href="http://www.atmel.com">Atmel&#8217;s AVR development  tools</a>:<strong> STK500</strong>, <strong>AVR Studio</strong>, <strong>AVRISP</strong>, <strong>AVR TJAGICE</strong>, <strong>AVR JTAGICE mkII</strong>, <strong>AVRISP mkII</strong>, <strong>STK600</strong>, etc. But there is one Atmel AVR development tool that provides ISP programming, High Voltage Programming, and debugging which comes in small form, beautiful box, and cheap price.<span id="more-270"></span> </p>
<p>The development tool that I am talking about is the <strong>AVR Dragon</strong>.</p>
<p><img class="size-large wp-image-271 alignnone" title="dragon" src="http://www.voltsandbytes.com/wp-content/uploads/2009/10/dragon-600x375.jpg" alt="dragon" width="600" height="375" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>AVR Dragon is highlighting <strong>In-System-Programming</strong>, <strong>High Voltage Serial</strong> and <strong>Parallel Programming</strong>,<strong> JTAG</strong>, and <strong>debugWire</strong>. You can almost do all kinds of programming and debugging methods with those features. Aside from that, the PC communication and power is provided by USB. It is fully supported by the free AVR Studio IDE which makes developing AVR projects very fast.</p>
<p>Using the AVR Dragon requires some hardware configuration. Each target AVR MCU must be connected to the proper header pins provided with the board. However, the user must provide and solder the other remaining header pins to fully use it. Also, one major drawback of the AVR dragon is that it does not come with wire connectors and USB cable.</p>
<p>All in all, I am a very satisfied user of AVR Dragon and it saved me from a lot of hassles. For a retail price of USD49, it gives me the comfort that i deserve when it comes to developing projects using my favorite AVR microcontrollers.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* txt-img-banner */
google_ad_slot = "1822032645";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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://www.voltsandbytes.com/all-in-one-avr-development-tool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>8051 Tutorial 3: I/O Port Programming in C</title>
		<link>http://www.voltsandbytes.com/8051-tutorial-3-io-port-programming-in-c/</link>
		<comments>http://www.voltsandbytes.com/8051-tutorial-3-io-port-programming-in-c/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 14:09:36 +0000</pubDate>
		<dc:creator>kuya</dc:creator>
				<category><![CDATA[8051 Microcontroller]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[8051]]></category>
		<category><![CDATA[AT89C2051]]></category>
		<category><![CDATA[I/O Port]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.voltsandbytes.com/?p=77</guid>
		<description><![CDATA[



Introduction
This tutorial will introduce you the basics about programming the input and output ports on an 8051 microcontroller using C language. Therefore, it is recommended that the reader is familiar or has basic knowledge about C programming language and electronics circuit analysis. I am going to use Atmel&#8217;s AT89C2051 as ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>
<h3>Introduction</h3>
<p>This tutorial will introduce you the basics about programming the input and output ports on an 8051 microcontroller using C language. <span id="more-77"></span>Therefore, it is recommended that the reader is familiar or has basic knowledge about C programming language and electronics circuit analysis. I am going to use <a href="http://www.atmel.com">Atmel</a>&#8217;s <a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=1938">AT89C2051</a> as an example for the 8051 microcontroller and the C compiler that I am going to use is the RC-51 which is included with the <a href="http://www.mcu-raisonance.com/~free-evaluation-8051-software-toolset__microcontrollers__product~product__T017:4d4ua0vi1fsg.html">Free Evaluation 8051 Software Toolset</a> of <a href="http://www.mcu-raisonance.com/">Raisonance</a>. You may see <a href="http://www.mcu-raisonance.com/~free-evaluation-8051-software-toolset__microcontrollers__product~product__T017:4d4ua0vi1fsg.html">this</a> for more info about the toolset or you may download the free evaluation 8051 Software Toolset  <a href="http://www.mcu-raisonance.com/mcu_downloads.html/">here</a>(RKit-Eval51). See <a href="http://www.voltsandbytes.com/8051-tutorial-2-raisonances-free-evaluation-8051-software-toolset/">this tutorial</a> for a quick start guide with this software.</p>
<p>For an introduction about AT89C2051, see <a href="http://www.voltsandbytes.com/8051-tutorial-1-introduction-to-at89c2051/">this</a>.</p>
<h3>AT89C2051 General Input and Output Ports</h3>
<p>The original 8051 microcontroller (40 pins)  contains 4 digital input and output ports which are <strong>P0</strong>, <strong>P1</strong>, <strong>P2</strong>, and <strong>P3</strong>. Its little brother, AT89C2051 (20pins), only contains two bidirectional input and output ports which are <strong>P1</strong> and <strong>P3</strong>. Both ports are one-byte (8-bits) wide and each pin of each port can be accessed externally (see the pin diagram below) except <strong>bit 6 of P3 </strong>or <strong>P3.6</strong>.</p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-81" title="pin" src="http://www.voltsandbytes.com/wp-content/uploads/2009/09/pin-300x268.jpg" alt="pin" width="300" height="268" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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><strong>P3.6</strong>, however, do exist. It is hardwired internally to the output of AT89C2051&#8217;s on-chip analog comparator (see diagram below). All port pins of AT89C2051 have internal pullups except <strong>P1.0</strong> and <strong>P1.1. </strong>Pins <strong>P1.0 and P1.1</strong> do not have internal pullups because these pins are also used as inputs of the on-chip analog comparator.</p>
<p style="text-align: center;"> <img title="port1n3" src="http://www.voltsandbytes.com/wp-content/uploads/2009/09/port1n3.jpg" alt="port1n3" width="572" height="215" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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">As you can see, the pins of AT89C2051 has alternate functions and we will discuss about those functions in the next series of tutorials about AT89C2051. Just for a quick view of these alternate functions, you may refer to the table below.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="69" valign="top">
<p align="center"><strong>Port Pin</strong></p>
</td>
<td width="459" valign="top">
<p align="center"><strong>Alternate Functions</strong></p>
</td>
</tr>
<tr>
<td width="69" valign="top">P1.0</td>
<td width="459" valign="top">AIN0 (positive input) of the on-chip precision analog comparator</td>
</tr>
<tr>
<td width="69" valign="top">P1.1</td>
<td width="459" valign="top">AIN1 (negative input) of the on-chip precision analog comparator</td>
</tr>
<tr>
<td width="69" valign="top">P3.0</td>
<td width="459" valign="top">RXD (serial input port)</td>
</tr>
<tr>
<td width="69" valign="top">P3.1</td>
<td width="459" valign="top">TXD (serial output port)</td>
</tr>
<tr>
<td width="69" valign="top">P3.2</td>
<td width="459" valign="top">INT0 (external interrupt 0)</td>
</tr>
<tr>
<td width="69" valign="top">P3.3</td>
<td width="459" valign="top">INT1 (external interrupt 1)</td>
</tr>
<tr>
<td width="69" valign="top">P3.4</td>
<td width="459" valign="top">T0 (timer 0 external input)</td>
</tr>
<tr>
<td width="69" valign="top">P3.5</td>
<td width="459" valign="top">T1 (timer 1 external input)</td>
</tr>
</tbody>
</table>
<p style="text-align: center;"> <script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* img-banner */
google_ad_slot = "2525571674";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.voltsandbytes.com/8051-tutorial-3-io-port-programming-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8051 Tutorial 2: Raisonance&#8217;s Free Evaluation 8051 Software Toolset</title>
		<link>http://www.voltsandbytes.com/8051-tutorial-2-raisonances-free-evaluation-8051-software-toolset/</link>
		<comments>http://www.voltsandbytes.com/8051-tutorial-2-raisonances-free-evaluation-8051-software-toolset/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 11:34:37 +0000</pubDate>
		<dc:creator>kuya</dc:creator>
				<category><![CDATA[8051 Microcontroller]]></category>
		<category><![CDATA[8051]]></category>
		<category><![CDATA[AT89C2051]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Raisonance]]></category>
		<category><![CDATA[RC-51]]></category>
		<category><![CDATA[Ride]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.voltsandbytes.com/?p=171</guid>
		<description><![CDATA[ 
Introduction
In this tutorial, I am going to discuss how to create a C project intended for 8051 family of microcontrollers. I am going to use the free evaluation toolkit for 8051 from Raisonance. This tutorial aims to discuss the basics of creating project using the toolkit from Raisonance. However, the ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"> </p>
<h3 style="TEXT-ALIGN: left">Introduction</h3>
<p>In this tutorial, I am going to discuss how to create a C project intended for 8051 family of microcontrollers. I am going to use the free evaluation toolkit for 8051 from <a href="http://www.mcu-raisonance.com/">Raisonance</a>. This tutorial aims to discuss the basics of creating project using the toolkit from <a href="http://www.mcu-raisonance.com/">Raisonance</a>. However, the reader is advised to read the documentation of the said toolkit for more advanced usage and configuration.<span id="more-171"></span></p>
<h3>What is the Free Evaluation 8051 Software Toolset of Raisonance?</h3>
<p>The <a href="http://www.mcu-raisonance.com/~free-evaluation-8051-software-toolset__microcontrollers__product~product__T017:4d4ua0vi1fsg.html">Free Evaluation 8051 Software Toolset of Raisonance</a> is a free development tool provided by Raisonance that enables developers to compile and debug applications using 8051 microcontrollers. This toolset includes the following:</p>
<li style="POSITION: relative">
<p style="POSITION: relative; MARGIN-BOTTOM: 0cm"><strong style="POSITION: relative">Ride6</strong> integrated development environment</p>
</li>
<li style="POSITION: relative">
<p style="POSITION: relative; MARGIN-BOTTOM: 0cm"><strong style="POSITION: relative">RC-51</strong> ANSI C compiler, output up to 4Kbytes of code</p>
</li>
<li style="POSITION: relative">
<p style="POSITION: relative; MARGIN-BOTTOM: 0cm"><strong style="POSITION: relative">MA-51</strong> Macro Assembler, output up to 4Kbytes of code</p>
</li>
<li style="POSITION: relative">
<p style="POSITION: relative; MARGIN-BOTTOM: 0cm"><strong style="POSITION: relative">LX-51</strong> Code Banking Linker, output up to 4Kbytes of code</p>
</li>
<li style="POSITION: relative">
<p style="POSITION: relative; MARGIN-BOTTOM: 0cm"><strong style="POSITION: relative">KR-51Tiny</strong> RTOS, supports up to 3 tasks</p>
</li>
<li style="POSITION: relative">
<p style="POSITION: relative; MARGIN-BOTTOM: 0cm"><strong style="POSITION: relative">SIMICE-51</strong> Simulator, debug up to 4Kbytes of code</p>
</li>
<p> </p>
<p>For more info about this toolset, you may visit <a href="http://www.mcu-raisonance.com/~free-evaluation-8051-software-toolset__microcontrollers__product~product__T017:4d4ua0vi1fsg.html">this</a>. You may also download the toolset (look for RKit-Eval51) <a href="http://www.mcu-raisonance.com/mcu_downloads.html">here</a>.</p>
<h3>Creating a Project using the Free Evaluation 8051 Software Toolset</h3>
<p>1. The first thing that you need to do is to download and install the Free Evaluation 8051 Software Toolset of Raisonance. Installation should be easy and straight forward. After you have installed the application, you are now ready to create your first target application using the software toolset. In this tutorial, our target device would be <a href="http://www.atmel.com/dyn/Products/Product_card.asp?part_id=1938">AT89C2051</a> of <a href="http://www.atmel.com">Atmel</a>.</p>
<p>2. Next, start the <strong>RIDE6 IDE</strong>. You may go to <strong>Start-&gt;Programs-&gt;Raisonance Kit 6.1</strong> and click the <strong>Ride IDE</strong> icon.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-173" title="ride1" src="http://www.voltsandbytes.com/wp-content/uploads/2009/09/ride1.jpg" alt="ride1" width="428" height="266" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>3. The Ride integrated development environment should start. Once the IDE has started, you should see something like this:</p>
<p style="text-align: center;"><a href="http://www.voltsandbytes.com/wp-content/uploads/2009/09/ride2.jpg"><img class="aligncenter size-full wp-image-174" title="ride2" src="http://www.voltsandbytes.com/wp-content/uploads/2009/09/ride2.jpg" alt="ride2" width="442" height="265" /></a></p>
<p>4. Locate the menu bar and point your mouse to the <strong>Project</strong> menu. Under the <strong>Project</strong> menu, click <strong>New</strong>&#8230;</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-175" title="ride3" src="http://www.voltsandbytes.com/wp-content/uploads/2009/09/ride3.jpg" alt="ride3" width="540" height="382" /></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>5. A <strong>Project</strong> dialog box will appear. Type your desired project name under the <strong>Application Name</strong> box. Locate where you want to save your project under the <strong>Directory</strong> field. The <strong>Target Family</strong> must be <strong>80C51</strong>. Under <strong>Type of application</strong> field, choose <strong>Application</strong>. Click <strong>Next</strong>.</p>
<p style="TEXT-ALIGN: center"> <img class="aligncenter size-full wp-image-197" title="ride4-1" src="http://www.voltsandbytes.com/wp-content/uploads/2009/09/ride4-1.jpg" alt="ride4-1" width="505" height="335" /></p>
<p>6. The <strong>Target</strong> dialog box will appear. Under the <strong>Device</strong> tab, choose <strong>AT89C2051</strong>. Click <strong>Finish</strong>.</p>
<p style="TEXT-ALIGN: center"><img class="aligncenter size-full wp-image-198" title="ride5" src="http://www.voltsandbytes.com/wp-content/uploads/2009/09/ride5.jpg" alt="ride5" width="503" height="335" /><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* Txt-banner */
google_ad_slot = "1215599900";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.voltsandbytes.com/8051-tutorial-2-raisonances-free-evaluation-8051-software-toolset/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>8051 Tutorial 1: Introduction to AT89C2051</title>
		<link>http://www.voltsandbytes.com/8051-tutorial-1-introduction-to-at89c2051/</link>
		<comments>http://www.voltsandbytes.com/8051-tutorial-1-introduction-to-at89c2051/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 09:00:38 +0000</pubDate>
		<dc:creator>kuya</dc:creator>
				<category><![CDATA[8051 Microcontroller]]></category>
		<category><![CDATA[8051]]></category>
		<category><![CDATA[AT89C2051]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.voltsandbytes.com/?p=119</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 ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>
<h3>What is 8051?</h3>
<p>The 8051 is a popular 8-bit single chip microcontroller which was first introduced by <a href="http://www.intel.com/">Intel</a>. 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.<span id="more-119"></span></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.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* lnk */
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>
<h3>What is AT89C2051?</h3>
<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 style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-4129695434726741";
/* Txt-banner */
google_ad_slot = "1215599900";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.voltsandbytes.com/8051-tutorial-1-introduction-to-at89c2051/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
