<?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>control7 blog</title>
	<atom:link href="http://control7.net/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://control7.net/blog</link>
	<description>~Electronics &#38; Programming~</description>
	<lastBuildDate>Thu, 05 Apr 2012 18:35:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PIC12F675 -Funny Police Light- LED project for Beginners (MikroC PRO)</title>
		<link>http://control7.net/blog/archives/147</link>
		<comments>http://control7.net/blog/archives/147#comments</comments>
		<pubDate>Thu, 05 Apr 2012 16:43:16 +0000</pubDate>
		<dc:creator>xenon ark</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[PIC microcontroller]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[MikroC]]></category>
		<category><![CDATA[PIC12F675]]></category>

		<guid isPermaLink="false">http://control7.net/blog/?p=147</guid>
		<description><![CDATA[This is a funny project for beginners. The tutorial will show how to control two I/O of PIC12F675. There is no external xtal included in the schematic. We use internal RC. To set internal RC in MikroC PRO IDE goto Project>Edit Project>Oscillator>Internal RC No Clock here is the schematic: the MikroC Source codes: 1 2 [...]]]></description>
			<content:encoded><![CDATA[<p>This is a funny project for beginners. The tutorial will show how to control two I/O of PIC12F675. There is no external xtal included in the schematic. We use internal RC. To set internal RC in MikroC PRO IDE goto Project>Edit Project>Oscillator>Internal RC No Clock</p>
<p>here is the schematic:</p>
<p><a href="http://control7.net/blog/wp-content/uploads/2012/04/Police-Light.jpg"><img src="http://control7.net/blog/wp-content/uploads/2012/04/Police-Light-300x280.jpg" alt="" title="Police Light" width="300" height="280" class="alignleft size-medium wp-image-148" /></a></p>
<h3>the MikroC Source codes:</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="c" style="font-family:monospace;">&nbsp;
<span style="color: #993333;">void</span> init_ports<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   TRISIO <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set as output</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
   init_ports<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
    GPIO <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    GPIO <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
    delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    GPIO <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    GPIO <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
    delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    GPIO <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    GPIO <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
    delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    GPIO <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    GPIO <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
    delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://control7.net/blog/archives/147/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PIC tutorial, Easy LCD interfacing with PIC16F877</title>
		<link>http://control7.net/blog/archives/130</link>
		<comments>http://control7.net/blog/archives/130#comments</comments>
		<pubDate>Sat, 24 Sep 2011 20:35:56 +0000</pubDate>
		<dc:creator>xenon ark</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[PIC microcontroller]]></category>
		<category><![CDATA[LCD]]></category>
		<category><![CDATA[PIC mocrocontroller]]></category>
		<category><![CDATA[PIC tutorial]]></category>
		<category><![CDATA[PIC16F877a]]></category>

		<guid isPermaLink="false">http://control7.net/blog/?p=130</guid>
		<description><![CDATA[This is a very easy tutorial to connect a PIC with an LCD. The program is written by mikroC PRO 4.60 Check the LCD library from the library manager before compiling the program. the program: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very easy tutorial to connect a PIC with an LCD. The program is written by mikroC PRO 4.60 Check the LCD library from the library manager before compiling the program.</p>
<h3>the program:</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// LCD module connections</span>
sbit LCD_RS at RB4_bit<span style="color: #339933;">;</span>
sbit LCD_EN at RB5_bit<span style="color: #339933;">;</span>
sbit LCD_D4 at RB0_bit<span style="color: #339933;">;</span>
sbit LCD_D5 at RB1_bit<span style="color: #339933;">;</span>
sbit LCD_D6 at RB2_bit<span style="color: #339933;">;</span>
sbit LCD_D7 at RB3_bit<span style="color: #339933;">;</span>
&nbsp;
sbit LCD_RS_Direction at TRISB4_bit<span style="color: #339933;">;</span>
sbit LCD_EN_Direction at TRISB5_bit<span style="color: #339933;">;</span>
sbit LCD_D4_Direction at TRISB0_bit<span style="color: #339933;">;</span>
sbit LCD_D5_Direction at TRISB1_bit<span style="color: #339933;">;</span>
sbit LCD_D6_Direction at TRISB2_bit<span style="color: #339933;">;</span>
sbit LCD_D7_Direction at TRISB3_bit<span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// End LCD module connections</span>
&nbsp;
<span style="color: #993333;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
  Lcd_Init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                        <span style="color: #666666; font-style: italic;">// Initialize LCD</span>
&nbsp;
  Lcd_Cmd<span style="color: #009900;">&#40;</span>_LCD_CLEAR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>               <span style="color: #666666; font-style: italic;">// Clear display</span>
  Lcd_Cmd<span style="color: #009900;">&#40;</span>_LCD_CURSOR_OFF<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>          <span style="color: #666666; font-style: italic;">// Cursor off</span>
&nbsp;
  Lcd_Out<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;PIC16F877A LCD&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">// Write text in first row</span>
  Lcd_Out<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span><span style="color: #0000dd;">3</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;control7.net&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>       <span style="color: #666666; font-style: italic;">// Write text in second row</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>The Schematic:</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/09/PIC_LCD_schematic.png"><img src="http://control7.net/blog/wp-content/uploads/2011/09/PIC_LCD_schematic-164x300.png" alt="" title="PIC_LCD_schematic" width="164" height="300" class="alignleft size-medium wp-image-131" /></a></p>
<h3>Demo run:</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/09/DSC06236.png"><img src="http://control7.net/blog/wp-content/uploads/2011/09/DSC06236-300x169.png" alt="" title="DSC06236" width="300" height="169" class="alignleft size-medium wp-image-132" /></a><br />
</p>
<h3>mikroC download</h3>
<p><a href="http://www.mikroe.com/eng/products/view/7/mikroc-pro-for-pic/">Download</a> mikroC from here.</p>
]]></content:encoded>
			<wfw:commentRss>http://control7.net/blog/archives/130/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serial Character LCD with AVR</title>
		<link>http://control7.net/blog/archives/115</link>
		<comments>http://control7.net/blog/archives/115#comments</comments>
		<pubDate>Tue, 19 Apr 2011 03:58:15 +0000</pubDate>
		<dc:creator>xenon ark</dc:creator>
				<category><![CDATA[AVR Microcontroller]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[AVR GCC]]></category>
		<category><![CDATA[LCD]]></category>

		<guid isPermaLink="false">http://control7.net/blog/?p=115</guid>
		<description><![CDATA[There are several character LCD available in market 16&#215;2, 16&#215;4, 20&#215;2 etc. these are very useful and pretty cheap also. This is a small program to demonstrate how interfacing LCD with AVR. I have used Atmega8 to run the program. This is the schematic: Pinout chart: LCD in action: Source code: Download source codes. (VAR [...]]]></description>
			<content:encoded><![CDATA[<p>There are several character LCD available in market 16&#215;2, 16&#215;4, 20&#215;2 etc. these are very useful and pretty cheap also. This is a small program to demonstrate how interfacing LCD with AVR. I have used Atmega8 to run the program.</p>
<h3>This is the schematic:</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/04/LCD-schematic.jpg"><img src="http://control7.net/blog/wp-content/uploads/2011/04/LCD-schematic-300x126.jpg" alt="" title="schematic" width="300" height="126" class="alignleft size-medium wp-image-116" /></a></p>
<h3>Pinout chart:</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/04/LCD-pinout.jpg"><img src="http://control7.net/blog/wp-content/uploads/2011/04/LCD-pinout-260x300.jpg" alt="" title="LCD-pinout" width="260" height="300" class="alignleft size-medium wp-image-117" /></a></p>
<h3>LCD in action:</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/04/AVR-LCD.jpg"><img src="http://control7.net/blog/wp-content/uploads/2011/04/AVR-LCD-300x255.jpg" alt="" title="AVR-LCD" width="300" height="255" class="alignleft size-medium wp-image-122" /></a></p>
<h3>Source code:</h3>
<p><a href="http://control7.net/blog/uploads/MyLCD.zip">Download</a> source codes. (VAR studio 4 required)</p>
]]></content:encoded>
			<wfw:commentRss>http://control7.net/blog/archives/115/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AVR tutorial &#8211; Basic I/O Operation. Input signal from push button and drive LED</title>
		<link>http://control7.net/blog/archives/94</link>
		<comments>http://control7.net/blog/archives/94#comments</comments>
		<pubDate>Wed, 30 Mar 2011 23:40:08 +0000</pubDate>
		<dc:creator>xenon ark</dc:creator>
				<category><![CDATA[AVR Microcontroller]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[AVR GCC]]></category>
		<category><![CDATA[I/O]]></category>
		<category><![CDATA[Input]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[Output]]></category>
		<category><![CDATA[Push Button]]></category>

		<guid isPermaLink="false">http://control7.net/blog/?p=94</guid>
		<description><![CDATA[This small tutorial will show how to read signal from a push button and on/off two led by the input signal. I have used Atmega48 to write and test the program but you can use any AVR which supports AVR GCC. Before pressing the push button it is like: After pressing the push button: Sketch [...]]]></description>
			<content:encoded><![CDATA[<p>This small tutorial will show how to read signal from a push button and on/off two led by the input signal. I have used Atmega48 to write and test the program but you can use any AVR which supports AVR GCC.</p>
<h3>Before pressing the push button it is like:</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/03/DSC055051.jpg"><img src="http://control7.net/blog/wp-content/uploads/2011/03/DSC055051-300x169.jpg" alt="" title="Before pressing the push button" width="300" height="169" class="alignleft size-medium wp-image-97" /></a></p>
<p></p>
<h3>After pressing the push button:</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/03/DSC05504.jpg"><img src="http://control7.net/blog/wp-content/uploads/2011/03/DSC05504-300x169.jpg" alt="" title="Button Pressed" width="300" height="169" class="alignleft size-medium wp-image-95" /></a></p>
<h3>Sketch of the schematic:</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/03/Untitled-Scanned-01.jpg"><img src="http://control7.net/blog/wp-content/uploads/2011/03/Untitled-Scanned-01-300x268.jpg" alt="" title="Schematic - AVR Basic I/O Operation" width="300" height="268" class="alignleft size-medium wp-image-100" /></a></p>
<h3>Here is the program:</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;avr/io.h&gt;</span>
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Method to read pin status</span>
<span style="color: #993333;">uint8_t</span> GetKeyStatus<span style="color: #009900;">&#40;</span><span style="color: #993333;">uint8_t</span> key<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>PINB <span style="color: #339933;">&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span>key<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	DDRB <span style="color: #339933;">=</span> <span style="color: #208080;">0b00000111</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//set B0, B1 and B2 as output</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>GetKeyStatus<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//reading B0 status</span>
		<span style="color: #009900;">&#123;</span>
			PORTB <span style="color: #339933;">=</span> <span style="color: #208080;">0b00000010</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//set B1 as HIGH</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			PORTB <span style="color: #339933;">=</span> <span style="color: #208080;">0b00000100</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//set B2 as HIGH</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>We can read PB0. When the button is not pressed, PB1 is high otherwise PB2 is high.</p>
]]></content:encoded>
			<wfw:commentRss>http://control7.net/blog/archives/94/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AVR PWM</title>
		<link>http://control7.net/blog/archives/74</link>
		<comments>http://control7.net/blog/archives/74#comments</comments>
		<pubDate>Tue, 29 Mar 2011 13:11:38 +0000</pubDate>
		<dc:creator>xenon ark</dc:creator>
				<category><![CDATA[AVR Microcontroller]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[PWM]]></category>

		<guid isPermaLink="false">http://control7.net/blog/?p=74</guid>
		<description><![CDATA[This is a program to show a PWM output. Attach an LED with B1 and run the program. I have used Atmega48 while testing. Here is the Circuit: This is the program 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [...]]]></description>
			<content:encoded><![CDATA[<p>This is a program to show a PWM output. Attach an LED with B1 and run the program. I have used Atmega48 while testing.</p>
<h3>Here is the Circuit:</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/03/pwm.jpg"><img src="http://control7.net/blog/wp-content/uploads/2011/03/pwm-300x169.jpg" alt="" title="AVR PWM" width="300" height="169" class="alignleft size-medium wp-image-79" /></a></p>
<h3>This is the program</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;avr/io.h&gt;</span>
<span style="color: #339933;">#include &lt;util/delay.h&gt;</span>
&nbsp;
main<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	OCR1AH <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	DDRB <span style="color: #339933;">|=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span>PB1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// PortB 1 as output</span>
	TCCR1A <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span>COM1A1<span style="color: #009900;">&#41;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// OC1A to zero, 8-Bit PWM</span>
	TCCR1B <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Start PWM</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Start the Unlimited Loop</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">255</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//Pulse Increasing Loop</span>
		<span style="color: #009900;">&#123;</span>
			OCR1AL <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">//Change lowbyte of OCR1A</span>
			_delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Delay of each pulse while Increasing </span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">255</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&gt;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//Pulse Decreasing Loop</span>
		<span style="color: #009900;">&#123;</span>
			OCR1AL <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
			_delay_ms<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Delay of each pulse while Decreasing</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://control7.net/blog/archives/74/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Single cell (1.5 Volt) LED flasher circuit</title>
		<link>http://control7.net/blog/archives/56</link>
		<comments>http://control7.net/blog/archives/56#comments</comments>
		<pubDate>Thu, 27 Jan 2011 12:05:56 +0000</pubDate>
		<dc:creator>xenon ark</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Coil]]></category>
		<category><![CDATA[LED]]></category>

		<guid isPermaLink="false">http://control7.net/blog/?p=56</guid>
		<description><![CDATA[LED is the most interesting part of amateur electronics hobbyist. The main barer of LED is, it needs minimum 3 vlots to illuminate. I’ve found many circuits to drive LED by a single cell alkaline or manganese cell. This is a complete circuit This is the coil of my first circuit. I collected copper wire [...]]]></description>
			<content:encoded><![CDATA[<p>LED is the most interesting part of amateur electronics hobbyist. The main barer of LED is, it needs minimum 3 vlots to illuminate. I’ve found many circuits to drive LED by a single cell alkaline or manganese cell.</p>
<h3>This is a complete circuit</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/01/led_c1.jpg"><img class="alignleft size-medium wp-image-57" title="the circuit" src="http://control7.net/blog/wp-content/uploads/2011/01/led_c1-300x187.jpg" alt="" width="300" height="187" /></a></p>
<h3>This is the coil of my first circuit.</h3>
<p>I collected copper wire from a relay and use a plastic-coated paper clip as core.</p>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/01/first_coil.jpg"><img class="alignleft size-medium wp-image-58" title="coil" src="http://control7.net/blog/wp-content/uploads/2011/01/first_coil-300x158.jpg" alt="" width="300" height="158" /></a></p>
<h3>For Experiment: I used a transformers 12-0-12 part as coil and it worked!</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/01/transformer_coil.jpg"><img class="alignleft size-medium wp-image-59" title="transformer_coil" src="http://control7.net/blog/wp-content/uploads/2011/01/transformer_coil-224x300.jpg" alt="" width="224" height="300" /></a></p>
<h3>This is the first circuit I made</h3>
<p>After making the circuit I wanted to check how long it will work. I found it can illuminate more than one day by a single cell!</p>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/01/illu_1.jpg"><img class="alignleft size-medium wp-image-60" title="complete prototype" src="http://control7.net/blog/wp-content/uploads/2011/01/illu_1-224x300.jpg" alt="" width="224" height="300" /></a></p>
<h3>The Circuit Diagram</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/01/circuit_diagram.jpg"><img class="alignleft size-medium wp-image-61" title="circuit_diagram" src="http://control7.net/blog/wp-content/uploads/2011/01/circuit_diagram-300x287.jpg" alt="" width="300" height="287" /></a></p>
<h3>Complete Circuit with ferrite core</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/01/circuit_2.jpg"><img class="alignleft size-medium wp-image-62" title="Complete Circuit with ferrite core" src="http://control7.net/blog/wp-content/uploads/2011/01/circuit_2-238x300.jpg" alt="" width="238" height="300" /></a></p>
<h3>Circuit</h3>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/01/circuit_3.jpg"><img class="alignleft size-medium wp-image-63" title="circuit" src="http://control7.net/blog/wp-content/uploads/2011/01/circuit_3-224x300.jpg" alt="" width="224" height="300" /></a></p>
<h3>The Coil</h3>
<p>The coil is the important part of the circuit. you can use 20-20 turn to any maximum turns. it will works better with ferrite core but you can use any core. At the first time i used a paper clip as core with 70-70 turns and it worked nicely.<br />
<br/><br />
<a href="http://control7.net/blog/wp-content/uploads/2011/01/circuit_4.jpg">More circuit picture</a></p>
]]></content:encoded>
			<wfw:commentRss>http://control7.net/blog/archives/56/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AVR fuse reset (tested)</title>
		<link>http://control7.net/blog/archives/21</link>
		<comments>http://control7.net/blog/archives/21#comments</comments>
		<pubDate>Sat, 15 Jan 2011 19:16:29 +0000</pubDate>
		<dc:creator>xenon ark</dc:creator>
				<category><![CDATA[AVR Microcontroller]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[Fuse]]></category>
		<category><![CDATA[GCC]]></category>
		<category><![CDATA[Microcontroller]]></category>

		<guid isPermaLink="false">http://control7.net/blog/?p=21</guid>
		<description><![CDATA[When I started to learn microcontroller, i have locked few AVR chips. These chips are very expensive here and hard to found. So I started researching why it occurred. I have found two main reasons why microcontrollers are not responding: 1. wrong  clock speed selected 2. Lock bit burned (SPIEN) I have found a solution to reset [...]]]></description>
			<content:encoded><![CDATA[<p>When I started to learn microcontroller, i have locked few AVR chips. These chips are very expensive here and hard to found. So I started researching why it occurred. I have found two main reasons why microcontrollers are not responding:</p>
<p>1. wrong  clock speed selected</p>
<p>2. Lock bit burned (SPIEN)</p>
<p>I have found a solution to reset fuse bits. here is the schematic.</p>
<p><a href="http://control7.net/blog/wp-content/uploads/2011/01/schematic.png"><img class="alignnone size-medium wp-image-23" title="AVR fuse resetter" src="http://control7.net/blog/wp-content/uploads/2011/01/schematic-300x177.png" alt="" width="300" height="177" /></a></p>
<p>You can reset Atmega8, Atmega48, Atmega88, Atmega128 by it.</p>
<p><a href="http://control7.net/blog/uploads/AVR_fuse_resetter.zip">Download</a> the hex and burn it to a Atmega8.</p>
<table border="0">
<tbody>
<tr>
<td><strong>IC1 (ATmega8) </strong></td>
<td><strong>IC2 (ATmega8/ATmega48/</strong><strong>ATmega</strong><span style="font-weight: 800;">88/<strong>ATmega</strong></span><strong>168)</strong></td>
</tr>
<tr>
<td colspan="2" bgcolor="white"></td>
</tr>
<tr>
<td>PD0</td>
<td>PB0</td>
</tr>
<tr>
<td>PD1</td>
<td>PB1</td>
</tr>
<tr>
<td>PD2</td>
<td>PB2</td>
</tr>
<tr>
<td>PD3</td>
<td>PB3</td>
</tr>
<tr>
<td>PD4</td>
<td>PB4</td>
</tr>
<tr>
<td>PD5</td>
<td>PB5</td>
</tr>
<tr>
<td>PD6</td>
<td>PC0</td>
</tr>
<tr>
<td>PD7</td>
<td>PC1</td>
</tr>
<tr>
<td colspan="2" bgcolor="white"></td>
</tr>
<tr>
<td>PB1</td>
<td>PD4</td>
</tr>
<tr>
<td>PB2</td>
<td>PD3</td>
</tr>
<tr>
<td>PB3</td>
<td>PD2</td>
</tr>
<tr>
<td>PB4</td>
<td>PD1</td>
</tr>
<tr>
<td>PB5</td>
<td>PD5</td>
</tr>
<tr>
<td colspan="2" bgcolor="white"></td>
</tr>
<tr>
<td>PC2</td>
<td>PC2</td>
</tr>
<tr>
<td>PC3</td>
<td>PB6 (XTAL1)</td>
</tr>
<tr>
<td>PC4</td>
<td>PD6</td>
</tr>
<tr>
<td>PC5</td>
<td>PD7</td>
</tr>
<tr>
<td colspan="2" bgcolor="white"></td>
</tr>
<tr>
<td>PB0</td>
<td>Vcc, AVcc</td>
</tr>
</tbody>
</table>
<p>No external xtal required. In the schematic the two AVRs are connected directly. You can add 1Kohm resistor to every line to provide some protection for the ATmega8 against inserting the target AVR incorrectly.</p>
<p><a href="http://control7.net/blog/uploads/AVR_fuse_resetter.zip">Download source and hex from here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://control7.net/blog/archives/21/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

