<?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>Projects Log &#187; led</title>
	<atom:link href="http://dev.pulsed.net/wp/?cat=11&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://dev.pulsed.net/wp</link>
	<description>projects, diy</description>
	<lastBuildDate>Mon, 25 Jul 2011 11:22:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>640 Leds display [Project update]</title>
		<link>http://dev.pulsed.net/wp/?p=25</link>
		<comments>http://dev.pulsed.net/wp/?p=25#comments</comments>
		<pubDate>Sun, 08 Jul 2007 17:08:49 +0000</pubDate>
		<dc:creator>Kevin DEHLINGER</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[led]]></category>

		<guid isPermaLink="false">http://dev.pulsed.net/wp/?p=25</guid>
		<description><![CDATA[Finally i had enough free time to work on the PCB layer, here&#039;s the first version (unverified for now)

click to view the whole layout
Since I can&#039;t etch something >300mm, I have to split each board in two parts.
So we have the logic boards (74&#215;4094, and uln2803) on the top, and the &#034;matrices&#034; boards (with the [...]]]></description>
			<content:encoded><![CDATA[<p>Finally i had enough free time to work on the PCB layer, here&#039;s the first version (unverified for now)</p>
<p><center><br />
<a href="http://dev.pulsed.net/misc/typ_leddisplay_big.png"><img src="http://dev.pulsed.net/misc/typ_leddisplay_thumb.png" alt="PCB layout" /><br \/>click to view the whole layout</a></center></p>
<p>Since I can&#039;t etch something >300mm, I have to split each board in two parts.</p>
<p>So we have the logic boards (74&#215;4094, and uln2803) on the top, and the &#034;matrices&#034; boards (with the led matrices) on the bottom.</p>
<p>The power board (with the mosfets), and the controller board (with the ÂµC) are still in dev.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.pulsed.net/wp/?feed=rss2&amp;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[New project] 640 leds display (work in progress)</title>
		<link>http://dev.pulsed.net/wp/?p=21</link>
		<comments>http://dev.pulsed.net/wp/?p=21#comments</comments>
		<pubDate>Sat, 30 Dec 2006 12:36:25 +0000</pubDate>
		<dc:creator>Kevin DEHLINGER</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[to come]]></category>

		<guid isPermaLink="false">http://dev.pulsed.net/wp/?p=21</guid>
		<description><![CDATA[Hi!
Once again i&#039;ve been very busy lately&#8230;
Here&#039;s a preview of my new project&#8230; meet the 640-led-display(-to-be)!



Ok for now only 2 matrices (=128 leds), but there are way to much wire on that breadboard&#8230; even with only two of them!

Project Pictures

Project parts (estimated):
a lot of resistors (about 85)
some capacitors
10x 74HCT4094 (shift register, with latch, and serial [...]]]></description>
			<content:encoded><![CDATA[<p>Hi!</p>
<p>Once again i&#039;ve been very busy lately&#8230;</p>
<p>Here&#039;s a preview of my new project&#8230; meet the 640-led-display(-to-be)!</p>
<p><object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/2bDUOPklGcw"></param>
<param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/2bDUOPklGcw" type="application/x-shockwave-flash" wmode="transparent" width="425"height="350"></embed></object></p>
<p>Ok for now only 2 matrices (=128 leds), but there are way to much wire on that breadboard&#8230; even with only two of them!<br />
<br \/><br \/><br />
<a href="http://dev.pulsed.net/rand/led/">Project Pictures</a><br />
<br \/><br \/><br \/><br />
<u>Project parts (estimated):</u></p>
<li>a lot of resistors (about 85)</li>
<li>some capacitors</li>
<li>10x 74HCT4094 (shift register, with latch, and serial output for cascading)</li>
<li>10x ULN2803</li>
<li>10x 8&#215;8 led matrices</li>
<li>8x p channel mosfet</li>
<li>1 or 2 atmega8 ÂµC</li>
<p><br \/><br \/><br \/><br />
<u>Todo list:</u></p>
<li>etching</li>
<li>send data over USB</li>
<li>&#8230;</li>
]]></content:encoded>
			<wfw:commentRss>http://dev.pulsed.net/wp/?feed=rss2&amp;p=21</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project One: a clock with 7 segment displays and an Atmel Atmega8 ÂµC</title>
		<link>http://dev.pulsed.net/wp/?p=20</link>
		<comments>http://dev.pulsed.net/wp/?p=20#comments</comments>
		<pubDate>Mon, 18 Sep 2006 10:39:12 +0000</pubDate>
		<dc:creator>Kevin DEHLINGER</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[led]]></category>

		<guid isPermaLink="false">http://dev.pulsed.net/wp/?p=20</guid>
		<description><![CDATA[This is my first project with Atmel&#039;s microcontrolers&#8230;
it&#039;s an idea i had to learn how to use digital I/Os, internal timer, interrupts,&#8230;
The hardware/software may not be very optimised, but the clock is quite accurate! :p

1. The timer
How does it work?
the timer is increased by one every P clock ticks (P is the prescaler, its value [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first project with Atmel&#039;s microcontrolers&#8230;<br />
it&#039;s an idea i had to learn how to use digital I/Os, internal timer, interrupts,&#8230;</p>
<p>The hardware/software may not be very optimised, but the clock is quite accurate! :p<br />
<span id="more-20"></span><br />
<u>1. The timer</u></p>
<p>How does it work?</p>
<p>the timer is increased by one every <strong>P</strong> clock ticks (P is the prescaler, its value can be 1,8,64,256,1024), and it generate an interrupt each time it overflows (255 to 0)<br />
Now we have timer_interrupt_frequency = F_CPU/(P*256)<br />
thus with a 11,0592Mhz crystal, and P=64, the timer interrupt frequency is: 11059200/(64*256) = 675Hz (yeah exactly 675, not 675,00000000001 nor 674.9999999999999999999999, &#8230; 675!)</p>
<p>That means that 1 second = 675 interrupts<br />
we just need to increase the seconds every 675 interrupts, the minutes every 60 seconds, the hours every 60 minutes, &#8230;</p>
<p><u>2. the 7 segment displays</u></p>
<p>how to drive 7*4= 28 leds ?<br />
remember, we do not have 28 i/o pins! the solution? Charlieplexing!<br />
the 4 cathods (one per display) of each segments are linked together to 7i/o pins and the 4 common anodes are linked to 4 i/o pins<br />
and we make the whole thing go so fast that human eye sees the four displays on at the same time(remember pov &#034;article&#034;)</p>
<p><u>3. the electronical part</u><br />
<a href="http://dev.pulsed.net/misc/clock.png">schematic</a></p>
<p><u>4. the source code</u></p>
<div style="border: 1px dashed #708090; background-color: #add8e6">
	<code>#define F_CPU 11059200UL  // 11,0592mhz</code><br />
	<code></code><br />
	<code>#include &lt;avr/io.h&gt;</code><br />
	<code>#include &lt;avr/interrupt.h&gt;</code><br />
	<code>#include &lt;stdbool.h&gt;</code><br />
	<code></code><br />
	<code>#define STOP_TIMER    TCCR0 &amp;= 0b11111000</code><br />
	<code>#define START_TIMER   TCCR0 |= 0b00000011 // prescaler = c/64</code><br />
	<code></code><br />
	<code></code><br />
	<code>typedef volatile unsigned char BYTE;</code><br />
	<code>typedef volatile unsigned int WORD;</code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code>BYTE minutes=0;</code><br />
	<code>BYTE seconds=0;</code><br />
	<code>BYTE hours=0;</code><br />
	<code>WORD Interrupts=0;</code><br />
	<code></code><br />
	<code>bool s=false;</code><br />
	<code>bool h=false;</code><br />
	<code>bool m=false;</code><br />
	<code></code><br />
	<code></code><br />
	<code>unsigned char segs[]=</code><br />
	<code>{</code><br />
	<code>0b00111111,</code><br />
	<code>0b00000110,</code><br />
	<code>0b01011011,</code><br />
	<code>0b01001111,</code><br />
	<code>0b01100110,</code><br />
	<code>0b01101101,</code><br />
	<code>0b01111101,</code><br />
	<code>0b00000111,</code><br />
	<code>0b01111111,</code><br />
	<code>0b01101111</code><br />
	<code>};</code><br />
	<code></code><br />
	<code></code><br />
	<code>ISR(TIMER0_OVF_vect)</code><br />
	<code>{</code><br />
	<code></code><br />
	<code></code><br />
	<code>Interrupts++;</code><br />
	<code></code><br />
	<code>// at 11,0592mhz with a 'Clock/64' prescaler, 675 interrupts = 1 sec!</code><br />
	<code>if (Interrupts == 675)</code><br />
	<code>{</code><br />
	<code>if(++seconds&gt;=60)</code><br />
	<code>{</code><br />
	<code>seconds=0;</code><br />
	<code>if(++minutes&gt;=60)</code><br />
	<code>{</code><br />
	<code>minutes=0;</code><br />
	<code>if(++hours&gt;=24)</code><br />
	<code>{</code><br />
	<code>hours=0;</code><br />
	<code>}</code><br />
	<code>}</code><br />
	<code>}</code><br />
	<code>Interrupts = 0;</code><br />
	<code>}</code><br />
	<code></code><br />
	<code>}</code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code>void ConfigureDevice(void)</code><br />
	<code>{</code><br />
	<code>cli(); // mask interruptions</code><br />
	<code></code><br />
	<code></code><br />
	<code>_SFR_BYTE(DDRD)=0b11111111;</code><br />
	<code>_SFR_BYTE(DDRC)=0b00001111;</code><br />
	<code>_SFR_BYTE(DDRB)=0b00000000;</code><br />
	<code></code><br />
	<code>TCNT0 = 0x00;</code><br />
	<code>START_TIMER;</code><br />
	<code>TIMSK  |= _BV(TOIE0);</code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code>sei(); // unmask interruptions</code><br />
	<code>}</code><br />
	<code></code><br />
	<code>int main(void)</code><br />
	<code>{</code><br />
	<code>// format:   8 8 : 8 8</code><br />
	<code>// segment:  8 4   2 1</code><br />
	<code>// segment is used to select each 7segments display one after the other (with pov there's no need to have 4 seven bits ports)</code><br />
	<code>// 8=0b00001000;4=0b00000100;2=0b00000010;1=0b00000001</code><br />
	<code>// btw, it's possible to use only one pin from c port with the 8th from b port (2 bits = 4 combinations) but then we'll need some extra elecronic demux part</code><br />
	<code></code><br />
	<code>unsigned char segment=1;</code><br />
	<code>unsigned char portval=0;</code><br />
	<code>unsigned char temp=0;</code><br />
	<code>ConfigureDevice();</code><br />
	<code></code><br />
	<code>hours=0;</code><br />
	<code>minutes=0;</code><br />
	<code>seconds=0;</code><br />
	<code></code><br />
	<code>while(1)</code><br />
	<code>{</code><br />
	<code></code><br />
	<code>m=(PINB&amp;0b00000100)==0?0:m;</code><br />
	<code>h=(PINB&amp;0b00000010)==0?0:h;</code><br />
	<code></code><br />
	<code>if((PINB&amp;0b00000001)!=0 &amp;&amp; (PINB&amp;0b00000010)!=0 &amp;&amp;  !h)</code><br />
	<code>{</code><br />
	<code>h=true;</code><br />
	<code>seconds=0;</code><br />
	<code>Interrupts=0;</code><br />
	<code>if(++hours&gt;=24)</code><br />
	<code>{</code><br />
	<code>hours=0;</code><br />
	<code>}</code><br />
	<code>}</code><br />
	<code></code><br />
	<code></code><br />
	<code>temp=PINB&amp;0b00000100;</code><br />
	<code>if((PINB&amp;0b00000001)!=0 &amp;&amp; (PINB&amp;0b00000100)!=0 &amp;&amp;  !m)</code><br />
	<code>{</code><br />
	<code>m=true;</code><br />
	<code>seconds=0;</code><br />
	<code>Interrupts=0;</code><br />
	<code>if(++minutes&gt;=60)</code><br />
	<code>{</code><br />
	<code>minutes=0;</code><br />
	<code>}</code><br />
	<code>}</code><br />
	<code></code><br />
	<code></code><br />
	<code></code><br />
	<code>switch(segment)</code><br />
	<code>{</code><br />
	<code>//segs is inverted to use with common anode 7 segments displays (up to 300mA sinking current)</code><br />
	<code>case 1:/*xx:xV*/ portval=~segs[minutes%10];break;</code><br />
	<code>case 2:/*xx:Vx*/ portval=~segs[minutes/10];break;</code><br />
	<code>case 4:/*xV:xx*/ portval=~segs[hours%10];break;</code><br />
	<code>case 8:/*Vx:xx*/ portval=~segs[hours/10];break;</code><br />
	<code>}</code><br />
	<code>_SFR_BYTE(PORTC)=0;</code><br />
	<code>_SFR_BYTE(PORTD)=portval;</code><br />
	<code>_SFR_BYTE(PORTC)=segment;</code><br />
	<code>segment=(segment&lt;&lt;1)&gt;8?1:segment&lt;&lt;1;</code><br />
	<code>}</code><br />
	<code></code><br />
	<code>}</code>
</div>
<p>	<strong>Download this code:</strong> <a href="http://dev.pulsed.net/wp/code/avrclock.c">avrclock.c</a>
</ol>
<p><u>5. the final result</u><br />
<img src="http://dev.pulsed.net/misc/avrclock_done.jpg" alt="result" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.pulsed.net/wp/?feed=rss2&amp;p=20</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
