<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rdf:RDF [
<!ENTITY % HTMLlat1 PUBLIC
 "-//W3C//ENTITIES Latin 1 for XHTML//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
]>
<rdf:RDF
 xmlns="http://purl.org/rss/1.0/"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 xmlns:admin="http://webns.net/mvcb/"
>
<channel rdf:about="http://web.orbitel.bg/k155la3">
<title>КА155ЛА3</title>
<link>http://web.orbitel.bg/k155la3</link>
<description>random tests in engineering</description>
<dc:language>en-us</dc:language>
<dc:creator>k155la3</dc:creator>
<dc:date>2006-07-05T00:21:29+02:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://web.orbitel.bg/k155la3/archives/2006/07/#e2006-07-05T00_18_10.txt" />
<rdf:li rdf:resource="http://web.orbitel.bg/k155la3/archives/2006/06/#e2006-06-12T06_17_18.txt" />
</rdf:Seq>
</items>
</channel>
<item rdf:about="http://web.orbitel.bg/k155la3/archives/2006/07/#e2006-07-05T00_18_10.txt">
<link>http://web.orbitel.bg/k155la3/archives/2006/07/#e2006-07-05T00_18_10.txt</link>
<title>Rotary encoder</title>
<dc:date>2006-07-05T00:18:10+02:00</dc:date>
<dc:creator>k155la3</dc:creator>

<description><![CDATA[<p> Using a rotary encoder is really easy once you understand <a href="http://en.wikipedia.org/wiki/Rotary_encoder">the principle of operation</a>.  I found a lot of code snippets on the net, about how to connect a rotary encoder to an AVR (or any other microcontroller indeed).  Some of them did not work out for me because they required an interrupt pin.  Others did not work at all.  Here is the code, which actually did work out.  One of the nice things about it is that it does not require any interrupts, so one can use just about any two free pins, and a timer.
<br /><br />
<pre>
<code>
+---+       +------
| A |-------| PC0
|   |       |
| B |-------| PC1
+---+       |
  |         |
 GND
<br /><br />
static volatile int8_t enc_delta;
<br /><br />
ISR(TIMER0_OVF_vect)
{  
	static uint8_t last_state = 0,last_cnt = 0;
	uint8_t new_state;
<br /><br />
	new_state=PINC & (_BV(PINC1) | _BV(PINC0));
	if ((new_state^last_cnt)==(_BV(PINC1) | _BV(PINC0)) )
	{
		if ((new_state ^ last_state)==_BV(PINC1))
		{
			enc_delta += 1;
		}
		else
		{
			enc_delta -= 1;
		}
<br /><br />
		last_cnt=new_state;
	}
<br /><br />
	last_state=new_state;
}
<br /><br />
void rotary_init()
{
 	/* Switch the internal pull-ups on port C on */
	PORTC |= (_BV(PC0)|_BV(PC1));
	/* PC0 and PC1 are inputs */
	DDRC &= ~(_BV(DDC0) | _BV(DDC1));
	/* sample the inputs with clk/8 */
	TCCR0 = _BV(CS01);
	/* enable the overflow irq in order to sample the inputs */
        TIMSK |= _BV(TOIE0);
}
</code>
</pre>
<br /><br />
<i>The code is taken from a <a href="http://www.mikrocontroller.net/forum/read-4-250095.html">post</a> by Christian Kranz on www.mikrocontroller.net.</i>]]></description>
</item>
<item rdf:about="http://web.orbitel.bg/k155la3/archives/2006/06/#e2006-06-12T06_17_18.txt">
<link>http://web.orbitel.bg/k155la3/archives/2006/06/#e2006-06-12T06_17_18.txt</link>
<title>HOWTO flash a DI-514</title>
<dc:date>2006-06-12T06:17:18+02:00</dc:date>
<dc:creator>k155la3</dc:creator>

<description><![CDATA[If you have a D-Link 514 wireless router and you were unfortunate enough to interrupt the firmware upload or something else
 went wrong here is a short guide how you can bring your router back to life.
<br /><br />
When something goes wrong at boot up the bootloader will attempt to download the file application.dlf over TFTP from 192.1
68.1.100. If you are curious like I was, you can see it with the help of the <a href="http://netbsd.gw.com/cgi-bin/man-cgi?t
cpdump++NetBSD-current">tcpdump</a> command.  You can take the firmware from the D-Link site. What now follows is a step by
step guide for the somehow less *nix inclined users.
<br /><br />
You will need to set the IP of your PC to 192.168.1.100.  The Ethernet connector of your computer should now be plugged
in one of the four Ethernet ports of the router (<b>Not in the WAN port.</b>)
<br /><br />
You will need a TFTP server.  One of the ways is to download the <a href="http://dbox.feldtech.com/">DBOX II Boot Manager
</a>.  You need to turn on the TFTP server option and turn off the NFS server option.  The boot file menu must point to a 
file named application.dlf which you downloaded from D-Link's site.
<br /><br />
Now you are set.  Cross your fingers, press the START button in the Bootmanager window and turn the router on.  The route
r will download its firmware and reset. 
<br /><br />
Have fun!]]></description>
</item>
</rdf:RDF>

