<?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>Project Notes &#187; Midge</title>
	<atom:link href="http://projectnotes.co.uk/tag/midge/feed/" rel="self" type="application/rss+xml" />
	<link>http://projectnotes.co.uk</link>
	<description>Random Computer, Internet and Electronics Projects</description>
	<lastBuildDate>Sat, 31 Jul 2010 10:33:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Use JABBER to Chat to Your Router &amp; its Devices</title>
		<link>http://projectnotes.co.uk/2010/07/use-jabber-to-chat-to-your-router-its-devices/</link>
		<comments>http://projectnotes.co.uk/2010/07/use-jabber-to-chat-to-your-router-its-devices/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 02:19:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Chat]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Jabber]]></category>
		<category><![CDATA[XMPP]]></category>
		<category><![CDATA[Mains Control]]></category>
		<category><![CDATA[Midge]]></category>

		<guid isPermaLink="false">http://projectnotes.co.uk/?p=240</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve done anything with these pages, and since then, a lot has changed. Both the hardware I&#8217;m using and the Internet Services available. When I first looked at using the sweex router for hardware control, &#8230; <a href="http://projectnotes.co.uk/2010/07/use-jabber-to-chat-to-your-router-its-devices/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve done anything with these pages, and since then, a lot has changed.</p>
<p>Both the hardware I&#8217;m using and the Internet Services available.</p>
<p>When I first looked at using the sweex router for hardware control, access to the router from the Internet meant opening a port on your router, and running a web server.</p>
<p>But today, it is possible to use a chat server somewhere on the Internet to make the link between you and your devices &#8211; or your devices and each other!<span id="more-240"></span></p>
<p>There is also <a href="http://www.igniterealtime.org/projects/openfire/index.jsp">Openfire</a> a Java Chat / Jabber server that will run on just about any server you can install a Java SDK on.  Run this at one site (opening the necessary firewall ports), and you can have two way communication with hardware at any other net connected site.</p>
<p>As Soon as I get the time, I&#8217;ll be writing up how to flash the router from scratch with stock openwrt midge  and control its i/o ports using a Jabber / Chat client on an Android Phone.</p>
]]></content:encoded>
			<wfw:commentRss>http://projectnotes.co.uk/2010/07/use-jabber-to-chat-to-your-router-its-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blassic I2C Mains Remote Control</title>
		<link>http://projectnotes.co.uk/2008/09/blassic-i2c-mains-remote-control/</link>
		<comments>http://projectnotes.co.uk/2008/09/blassic-i2c-mains-remote-control/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 21:50:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blassic]]></category>
		<category><![CDATA[I/O Bus]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[OpenWrt Midge]]></category>
		<category><![CDATA[16F876A]]></category>
		<category><![CDATA[Mains Control]]></category>
		<category><![CDATA[Midge]]></category>

		<guid isPermaLink="false">http://www.projectnotes.co.uk/?p=159</guid>
		<description><![CDATA[Using the Remote Control Unit with the Pic I2C Slave connected to the Midge Router, it is possible to use Blassic to control regular mains devices via the the network.  Here is a sample. The following program requires an update &#8230; <a href="http://projectnotes.co.uk/2008/09/blassic-i2c-mains-remote-control/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Using the <strong>Remote Control Unit</strong> with the <strong>Pic I2C</strong> <strong>Slave</strong> connected to the <strong>Midge</strong> <strong>Router</strong>, it is possible to use Blassic to control regular mains devices via the the network.  Here is a sample.<span id="more-139"></span></p>
<p>The following program requires an update to the PIC I2C Slave software to set <strong>PORT B</strong> to output and the Remote Control On/Off lines connected to PORTB 0 and 1.  A 0v Line is also required between the two.  I continue to run the <strong>Mains Remote Control</strong> unit with its own 12v Battery although, the 12v supply to the router could also be used.</p>
<p>The following Blassic (Basic) program sets up the Router <strong>I2C</strong> software to talk to the <strong>PIC</strong> and then inputs &#8220;On or Off&#8221; from the console.  If the Response is On, PORT B0 is set high for a few seconds.  If it is &#8216;Off&#8217;, PORT B1 is used.</p>
<p>Here is the Program Listing</p>
<pre>     10 REM Remote.bas
     11 REM Test The Mains Remote Control Via I2C
     12 REM Input On or Off then Switch the Plug On or Off
     14 REM Needs Update to PIC I2C software to Set Port B as Output
     20 REM
     30 REM I2C Control
     40 I2CAddress=34
     50 I2CData=35
     60 PIC16F876=46 : REM Address of Our Chip
     70 REM Commands
     75 PortB=1
     80 AnalogRead = 4
     90 PortA1Invert = 5 : REM Invert A1
    100 REM Begin
    105 INPUT "On or Off ",a$
    106 IF a$ = "On" THEN OnOff = 1
    107 IF a$ = "Off" THEN OnOff = 2
    110 POKE I2CAddress,PIC16F876 : REM Address the chip
    200 POKE I2CData,PortB : REM we are sending port be some data
    210 POKE I2CData,0 : REM ensure PortB All off
    220 POKE I2CData,PortB
    225 POKE I2CData,OnOff : REM Bit 0 = A1On, Bit 1 = A1Off
    230 GOSUB 800 : REM Delay long enough for the Remote Xmit
    240 POKE I2CData,PortB
    250 POKE I2CData,0 : REM and Stop Pressing Remote Buttons
    300 END
    800 FOR x=0 TO 4000: NEXT : RETURN
Ok</pre>
<p>Update:<br />
I was setting PORT B to 03 to turn off the power switch, ( B0 and B1 both HIGH) in error, the above code now only sets PORT B1 HIGH.</p>
<p>I also was getting random result trying to use a Blassic program to control the PIC 16F876a/Mains Remote from inside a shell script.  That turned out to be a power problem, I&#8217;m only using a low power regulator for the 5v rail.  This supplies both the USB Memory Stick, an LCD Display and the PIC Processor.  When the USB Memory Stick is accessed, the power dips enough to reset the PIC Processor.</p>
<p>As the LCD Display was not needed for the Power Remote Control, I simply unplugged the display from the bus and the reduced power load allowed the rest of the systems to function.</p>
<p>I will now add a second 78L05 to the router and use that to power the bus.</p>
]]></content:encoded>
			<wfw:commentRss>http://projectnotes.co.uk/2008/09/blassic-i2c-mains-remote-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blassic PIC I2C I/O with Peek &amp; Poke</title>
		<link>http://projectnotes.co.uk/2008/08/blassic-pic-i2c-io-with-peek-poke/</link>
		<comments>http://projectnotes.co.uk/2008/08/blassic-pic-i2c-io-with-peek-poke/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 02:19:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blassic]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[OpenWrt Midge]]></category>
		<category><![CDATA[16F876A]]></category>
		<category><![CDATA[Midge]]></category>

		<guid isPermaLink="false">http://www.projectnotes.co.uk/?p=104</guid>
		<description><![CDATA[Here is a little (extended)Blassic program to read the PIC 16F876A I2C Slave. It first sets up the I2C Address. Then, Writes commands to read the PIC Serial Port, Toggling Port A,1 every New Line. The program exits if a &#8230; <a href="http://projectnotes.co.uk/2008/08/blassic-pic-i2c-io-with-peek-poke/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here is a little (extended)Blassic program to read the <strong>PIC</strong> <strong>16F876A</strong> <strong>I2C</strong> Slave.<span id="more-88"></span></p>
<p>It first sets up the <strong>I2C Address</strong>.</p>
<p>Then, Writes commands to read the <strong>PIC Serial Port</strong>, Toggling Port A,1 every New Line.</p>
<p>The program exits if a &#8220;!&#8221; is received.</p>
<pre>midge# more PeekPokeTest.bas
10 POKE 34,46 :  REM our chip at 2e
20 POKE 35,3 :  REM select serial port
30 a = PEEK(35) REM Get a serial Char (0 if none ready)
40 IF a = 0 THEN GOTO 30
50 PRINT CHR$(a);
55 IF a &lt;&gt; 13 THEN GOTO 60
56 POKE 35,5 : REM toggle port A1
57 POKE 35,3 : REM back to serial port
60 IF a &lt;&gt; 33 THEN 30
midge#</pre>
]]></content:encoded>
			<wfw:commentRss>http://projectnotes.co.uk/2008/08/blassic-pic-i2c-io-with-peek-poke/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EEPROM PCF8582C-2</title>
		<link>http://projectnotes.co.uk/2008/08/eeprom-pcf8582c-2/</link>
		<comments>http://projectnotes.co.uk/2008/08/eeprom-pcf8582c-2/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 11:41:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[I2C]]></category>
		<category><![CDATA[Blassic]]></category>
		<category><![CDATA[EEPROM]]></category>
		<category><![CDATA[Midge]]></category>

		<guid isPermaLink="false">http://www.projectnotes.co.uk/?p=63</guid>
		<description><![CDATA[The PCF8582C-2 is a 256&#215;8 bit CMOS EEPROM.  It contains less memory than some PIC Processors!  As have a few of these chips, I use them as a benchmark for the Router and PIC I2C interfaces. Reading or writing to &#8230; <a href="http://projectnotes.co.uk/2008/08/eeprom-pcf8582c-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The PCF8582C-2 is a 256&#215;8 bit CMOS <strong>EEPROM</strong>.  It contains less memory than some PIC Processors!  As have a few of these chips, I use them as a benchmark for the Router and PIC <strong>I2C</strong> interfaces. <span id="more-55"></span></p>
<p>Reading or writing to these chips involves sending the word address (0-255) before reading or writing the data byte.</p>
<p>After the first data byte has been read, simply reading from the chip will produce the next byte.</p>
<p>In the mods to Blassic on the Router, I have created a function to set the I2C chip address &#8211; &#8220;poke 34,ADRESSS&#8221; where ADDRESS is 0-255 will set up for reading or writing an I2C device The PCF8582C is at $50 (80 decimal) if all of its address lines are held low.</p>
<p>After this, 1 byte may be read from the chip by &#8220;x=peek(256+WORD)&#8221; where WORD = 0 to 255.</p>
<p>A byte may be written by &#8220;poke 256+WORD,data&#8221;</p>
<p>After Reading 1 byte as above, further bytes may be read simply by &#8220;x=peek (35)&#8221; inside the EEPROM, the WORD address is incremented after each read.</p>
<pre>     +==u==+
  A0 1     8 5v
  A1 2     7 PTC / Not used
  A2 3     6 SLC
  0V 4     5 SDA
     +=====+</pre>
<p>PCF8582C-2 Pinout</p>
]]></content:encoded>
			<wfw:commentRss>http://projectnotes.co.uk/2008/08/eeprom-pcf8582c-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Router I2C Interface</title>
		<link>http://projectnotes.co.uk/2008/08/router-i2c-interface/</link>
		<comments>http://projectnotes.co.uk/2008/08/router-i2c-interface/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 19:02:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[I/O Bus]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[OpenWrt Midge]]></category>
		<category><![CDATA[Midge]]></category>
		<category><![CDATA[PIC]]></category>

		<guid isPermaLink="false">http://www.projectnotes.co.uk/?p=50</guid>
		<description><![CDATA[These are the I2C Bus Hardware and Software settings I am using with the on OpenWrt Midge router to talk to a PIC 16F876 I2C Slave. I2C Hardware Here is the level shifter I&#8217;m using for the Router (3v) I2C &#8230; <a href="http://projectnotes.co.uk/2008/08/router-i2c-interface/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>These are the <strong>I2C</strong> Bus Hardware and Software settings I am using with the on <strong>OpenWrt</strong> <strong>Midge</strong> router to talk to a PIC <strong>16F876</strong> I2C Slave.<span id="more-43"></span></p>
<h2>I2C Hardware</h2>
<p>Here is the level shifter I&#8217;m using for the Router (3v) I2C interface (5v on Pic and other chips I have)</p>
<pre>                 5v
                |
                |
                R
               4k7
                R
                |
SCL ---+--R220--+-----&gt; 5v SCL
       |
     =====  Use the Same
      ZD\   For the Data
     /3.3\  Line
       |
       |
0v-----+---------------</pre>
<p>The above has so far worked happily with an old philips 2048bit (256 bytes!) eeprom.</p>
<p>Pin Header (for breadboard)</p>
<p>1: 0v</p>
<p>2: 3v</p>
<p>3: 5v</p>
<p>4: KEY NC</p>
<p>5: TX (I/O Bus -&gt; project)</p>
<p>6: RX (project &lt;- I/O Bus)</p>
<p>7: LED3 GPIO8 I2C SDA</p>
<p>8: LED5 GPIO11 I2C SCL</p>
<h2>I2C Software Settings</h2>
<p>In the sunspot.co.uk Midge rom, the default <strong>I2C</strong> port uses different gpio lines.  To use gpio 8 and 11, the file &#8220;/etc/init.d/S99start_i2c&#8221; file needs changing:-</p>
<p>The line containing &#8220;insmod i2c-adm5128&#8243; needs to read &#8220;insmod i2c-adm5120 scl=11 sda=8&#8243;</p>
]]></content:encoded>
			<wfw:commentRss>http://projectnotes.co.uk/2008/08/router-i2c-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a Serial Port</title>
		<link>http://projectnotes.co.uk/2008/08/adding-a-serial-port/</link>
		<comments>http://projectnotes.co.uk/2008/08/adding-a-serial-port/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 23:46:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OpenWrt Midge]]></category>
		<category><![CDATA[I/O Bus]]></category>
		<category><![CDATA[Midge]]></category>
		<category><![CDATA[PIC]]></category>

		<guid isPermaLink="false">http://www.projectnotes.co.uk/?p=24</guid>
		<description><![CDATA[Fitting a serial converter and lead insider the I/O Bus box gives us back a socket for other projects and gets the serial converter out of harms way.  Cutting a couple of I/O Bus tracks opens up even more options. &#8230; <a href="http://projectnotes.co.uk/2008/08/adding-a-serial-port/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Fitting a serial converter and lead insider the I/O Bus box gives us back a socket for other projects and gets the serial converter out of harms way.  Cutting a couple of I/O Bus tracks opens up even more options.<span id="more-20"></span></p>
<p>I have been using the 5 port &#8216;scart socket&#8217; I/O Bus simply as a passive backplane.  All of the lines are bussed together and using it simply involves hooking up the correct pins of a scart type plug to the corresponding pins on a circuit.</p>
<p>The <a title="The 5 port I/O Bus made from a scart splitter" href="http://www.projectnotes.co.uk/cheap-io-bus/">I/O bus</a> started life as a cheap breakout box for the Sweex/Edimax Router so that I could hook up different circuits to it without risking physical damage to the router itself &#8211; at least I won&#8217;t be able to break off a component whilst connecting a new circuit.</p>
<p>The Bus simply carries the router led, power (3v and 5v) and serial lines. I have been using a transistor based level converter to connect the router to a PC for uploading new ROM images.</p>
<p>Now that I&#8217;m going to add a PIC Processor and try a bit of communication between the PIC and the Router, it occured to me that it would be useful if I cut the serial lines somewhere on the bus so that I could hook up more than one serial device &amp; converter.</p>
<p>However, there is just room for my level converter or one based on a MAX232 IC (a better idea if you have one handy) where the original scart lead exited the case.</p>
<p>I added the circuit, connecting it to the nearest socket and cut the traces between the serial pins and the rest of the I/O Bus.</p>
<p>Now, if I need to boot the router and upload a new ROM Image or work with the serial port, I plug the router into the first socket.  If I move the router to another socket, I can plug a PIC or whatever into the first socket and upload software to that.</p>
]]></content:encoded>
			<wfw:commentRss>http://projectnotes.co.uk/2008/08/adding-a-serial-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
