<?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>AlferSoft Blog &#187; USB</title>
	<atom:link href="http://www.alfersoft.com.ar/blog/tag/usb/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alfersoft.com.ar/blog</link>
	<description>Explaining this blog in a few words since 1999</description>
	<lastBuildDate>Wed, 01 Feb 2012 22:36:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Make something useful out of your DPF (Digital Photo Frame)</title>
		<link>http://www.alfersoft.com.ar/blog/2011/04/04/make-something-useful-out-of-your-dpf-digital-photo-frame/</link>
		<comments>http://www.alfersoft.com.ar/blog/2011/04/04/make-something-useful-out-of-your-dpf-digital-photo-frame/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 16:52:05 +0000</pubDate>
		<dc:creator>fvicente</dc:creator>
				<category><![CDATA[Electronic Projects]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[circuit]]></category>
		<category><![CDATA[digital]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[dpf]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[parallel]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://www.alfersoft.com.ar/blog/?p=221</guid>
		<description><![CDATA[We had this great idea of using an old digital photo frame from smartparts to display some useful reports at work. In this case, useful will mean that the reports (pictures in the frame) needs to be automatically updated, with no human intervention. Take a look to this post, you may find something useful for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110401_171720.jpg"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110401_171720-150x150.jpg" alt="" title="IMG_20110401_171720" width="100" height="100" class="alignleft size-thumbnail wp-image-232" /></a>We had this great idea of using an old digital photo frame from <a href="http://smartpartsproducts.com/content/index.html">smartparts</a> to display some useful reports at work.<br />
In this case, useful will mean that the reports (pictures in the frame) needs to be automatically updated, with no human intervention.<br />
Take a look to this post, you may find something useful for your own DIY project!<br />
<span id="more-221"></span><br />
There are probably several ways to update the pictures dynamically, we have chosen the easiest one: connect it to an old Itona computer (we&#8217;ve plenty of these crappy machines 300Mhz processor, 512Mb of hard disk) running Ubuntu Linux and then make a script that will periodically (cron) gather the info we want to show from the Internet convert it to JPG images, and update the photo frame.</p>
<p><a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110404_105718.jpg"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110404_105718-225x300.jpg" alt="" title="IMG_20110404_105718" width="225" height="300" class="alignnone size-medium wp-image-225" /></a><br />
Too easy? Ok, a real ninja hacker solution would had been taking apart the photo frame, put a Linux on the nice ARC processor through the JTAG interface and then plug some Wi-Fi dongle and do Everything directly on the DPF itself. But that&#8217;s just dreaming, we don&#8217;t have experience nor time for that.</p>
<p>Now you may ask, why didn&#8217;t you plug a monitor on the machine and just display whatever you want directly on the monitor? and the first reason is, we don&#8217;t have spare LCD monitors for this purpose (in fact we have many CRT monitors that nobody uses, but that requires just too much space). The second reason is that we wanted to do something more exiting, like hacker things <img src='http://www.alfersoft.com.ar/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>So we setup everything: we made the scripts to generate the images, installed Ubuntu Linux 10.4 on the Itona and actually we borrowed another 512mb (flash) hard disk form another Itona and put it in the secondary IDE to get a RAID configuration with 1GB of space, just enough for Ubuntu and our script. Then realized of a small problem, as soon as you plug the DPF on the USB port, it enters in &#8220;transfer mode&#8221; and stops displaying the images. No matter if you eject, unmount, safe remove, shut down the computer, etc. the photo frame wont show the pictures until you physically unplug the USB cable (cut off the +5V). Here is were our ingenious circuit enters in action. A <strong>USB interrupter controlled by the parallel port</strong> (I guess serial RS-232 would work fine also using one of the signal pins).<br />
After googling, I&#8217;ve found <a href="http://forum.allaboutcircuits.com/showthread.php?t=38544&#038;page=2">a circuit</a> that seemed usable for this purpose. Just a couple transistors and a few resistors is everything we need.<br />
<a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110331_185113.jpg"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110331_185113-300x225.jpg" alt="" title="IMG_20110331_185113" width="300" height="225" class="alignnone size-medium wp-image-226" /></a><br />
Crop the board and put it in a case&#8230;<br />
<a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110331_191457.jpg"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110331_191457-300x225.jpg" alt="" title="IMG_20110331_191457" width="300" height="225" class="alignnone size-medium wp-image-227" /></a><br />
<a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110331_191507.jpg"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110331_191507-300x225.jpg" alt="" title="IMG_20110331_191507" width="300" height="225" class="alignnone size-medium wp-image-228" /></a><br />
<a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110331_192915.jpg"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110331_192915-300x225.jpg" alt="" title="IMG_20110331_192915" width="300" height="225" class="alignnone size-medium wp-image-229" /></a><br />
Finally, the whole thing mounted:<br />
The Itona hidden behind the desk&#8230;<br />
<a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110404_103336.jpg"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110404_103336-225x300.jpg" alt="" title="IMG_20110404_103336" width="225" height="300" class="alignnone size-medium wp-image-230" /></a><br />
And the DPF showing the reports!! <img src='http://www.alfersoft.com.ar/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
<a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110401_171707.jpg"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110401_171707-300x225.jpg" alt="" title="IMG_20110401_171707" width="300" height="225" class="alignnone size-medium wp-image-231" /></a><br />
<a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110401_171720.jpg"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/IMG_20110401_171720-300x225.jpg" alt="" title="IMG_20110401_171720" width="300" height="225" class="alignnone size-medium wp-image-232" /></a></p>
<p>For the circuit you will need:</p>
<ul>
<li>1k resistor (2)</li>
<li>10k resistor (2)</li>
<li>PNP transistor</li>
<li>NPN transistor</li>
<li>USB connectors, 1 to plug into the computer, the other whatever is better for your DPF</li>
<li>DB-25 male connector (if you decided to do it via parallel too)</li>
</ul>
<p><strong>IMPORTANT: following image was borrowed from http://forum.allaboutcircuits.com/showthread.php?t=38544&#038;page=2</strong><br />
<a href="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/5V-Switch.png"><img src="http://www.alfersoft.com.ar/blog/wp-content/uploads/2011/04/5V-Switch-300x216.png" alt="" title="5V-Switch" width="300" height="216" class="alignnone size-medium wp-image-238" /></a><br />
I&#8217;ve connected the control-in to the PIN #2 of the DB-25, and the PIN #20 to the ground.<br />
To turn the parallel port signal on/off I&#8217;ve made the following program in C (para.c):</p>
<pre>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include
<linux/ppdev.h>

static int pfd;

int main(int argc, char* argv[])
{
	unsigned char data=0;

	if (argc != 3) {
		printf("Usage:\n\tpara [port] [val]\n\nport: parallel port e.g. /dev/parport0\nval:  1 to activate all data bits in parallel port, or\n      0 to disable all data bits in parallel port\n\n");
		return 1;
	}
	if (argv[2][0] == '1') {
		data=0xff;
	}
	pfd = open(argv[1], O_RDWR);
	if (pfd < 0) {
		perror("Failed to open port");
		exit(0);
	}
	if ((ioctl(pfd, PPEXCL) < 0) || (ioctl(pfd, PPCLAIM) < 0)) {
		perror("Failed to lock port");
		close(pfd);
		exit(0);
	}
	printf("Setting %s data bits to: %.2X\n", argv[1], data);
	ioctl(pfd, PPWDATA, &#038;data);
	close(pfd);
	return 0;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.alfersoft.com.ar/blog/2011/04/04/make-something-useful-out-of-your-dpf-digital-photo-frame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USocket &#8211; USB controlled Socket with PIC18F4550</title>
		<link>http://www.alfersoft.com.ar/blog/2008/07/08/usocket-usb-controlled-socket-with-pic18f4550/</link>
		<comments>http://www.alfersoft.com.ar/blog/2008/07/08/usocket-usb-controlled-socket-with-pic18f4550/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 04:06:25 +0000</pubDate>
		<dc:creator>fvicente</dc:creator>
				<category><![CDATA[Electronic Projects]]></category>
		<category><![CDATA[CDC]]></category>
		<category><![CDATA[circuit]]></category>
		<category><![CDATA[electronic]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[PIC16F4550]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://www.alfersoft.com.ar/blog/?p=9</guid>
		<description><![CDATA[Introduction The idea of this project is to control (switch off/on) two power sockets with a computer by using its USB port. I&#8217;ve chosen USB in first place because I wanted to experiment with the PIC18F4550 microchip&#8217;s microcontroller, and secondly because the power supplied by this port (500mA) is enough to activate a relay without [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>The idea of this project is to control (switch off/on) two power sockets with a computer by using its USB port. I&#8217;ve chosen USB in first place because I wanted to experiment with the PIC18F4550 microchip&#8217;s microcontroller, and secondly because the power supplied by this port (500mA) is enough to activate a relay without any additional power supply.</p>
<p><img src="http://www.alfersoft.com.ar/files/usocket/pictures/proto04.jpg" alt="Prototype" width="450" height="338" /></p>
<p><span id="more-9"></span></p>
<p>The firmware is based in <a title="SIXCA USBDAQ" href="http://www.sixca.com/eng/articles/usbdaq/">SIXCA USBDAQ</a> which is in turn based on <a title="Microchip's CDC sample" href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=2124&amp;param=en532204&amp;page=wwwFullSpeedUSB">microchip&#8217;s CDC sample</a>. USBDAQ is extremely easy to use. It implements a very simple set of ASCII commands to turn on/off the digital outputs, that I use to control the two relays. I just needed to adjust the bMaxPower in order to negotiate the 500mA with the host, and I also changed the vendor ID and the name of the device to USocket.</p>
<p>I&#8217;ve also made the schematic and board design of the circuit with <a title="CadSoft Eagle" href="http://www.cadsoftusa.com/">Eagle</a>, but I never used it since I made it on a strip board <img src='http://www.alfersoft.com.ar/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> , so if you plan to use it please double check everything before.</p>
<p>The whole project including PIC firmware and Eagle files is available for download. You are free to use or modify it as you like, but please verify Microchip&#8217;s CDC sample license if you plan to use it for commercial applications.</p>
<p><span class="BODYTEXT"><span class="BODYTEXT"><strong>Disclaimer:</strong> This project involves high voltage electricity. You should not attempt this project unless you are comfortable with basic concepts of AC and DC electricity, induction, and reading circuit schematics. You and your adult supervisor are responsible for your safety when doing this project!</span></span></p>
<p><strong>Advice:</strong> Despites the high voltage part of the circuit is virtually isolated from the controller circuit by relays, these devices always represents a risk of mechanical failure and they can possibly damage your equipment or even cause physical injuries, so we (the author or the webmasters) are not responsible of any lose or damage.</p>
<h2>The Circuit</h2>
<p style="text-align: center;"><a title="Schematic" href="http://www.alfersoft.com.ar/files/usocket/pictures/full.png" target="_blank"><img class="aligncenter" style="border: 1px solid black;" src="http://www.alfersoft.com.ar/files/usocket/pictures/full.png" alt="Figure 1 - Schematic" width="450" height="393" /></a></p>
<p style="text-align: center;">Figure 1 &#8211; Schematic</p>
<p>Pretty much the same as USBDAQ but two (identical) sub-circuits were added to control the relays. A Darlington-transistor is used to protect the hardware. Once again, the idea was obtained from the web (thanks to google) and <a title="Relay control" href="http://b-l-w.de/serialrelay_en.php">here is the link to the original article</a>.</p>
<p>The PCB is divided in 3 little boards, for commodity and socket case space issues. (I&#8217;ve used only 2 strip boards in the actual prototype).</p>
<p style="text-align: center;"><a title="Board" href="http://www.alfersoft.com.ar/files/usocket/pictures/full_board.png" target="_blank"><img class="aligncenter" style="border: 1px solid black;" src="http://www.alfersoft.com.ar/files/usocket/pictures/full_board.png" alt="Figure 2 - Board" width="450" height="271" /></a></p>
<p style="text-align: center;">Figure 2 &#8211; Board</p>
<p>List of materials:</p>
<ul>
<li>IC1 &#8211; PIC16F4550 Microchip&#8217;s micro-controller (<a title="PIC18F4550 by Microchip" href="http://www.alfersoft.com.ar/files/usocket/datasheets/pic18f4550-microchip.pdf">datasheet</a>)</li>
<li>Q2 &#8211; Crystal 20Mhz</li>
<li>R1 &#8211; Resistor 4.7K</li>
<li>R2 &#8211; Resistor 1M</li>
<li>R3, R5 &#8211; Resistors 150</li>
<li>R4, R6 &#8211; Resistors 100K</li>
<li>K1, K3 &#8211; 5v Relays. I&#8217;ve used FBR211 by Fujitsu (<a title="FBR211 Relay by Fujitsu" href="http://www.alfersoft.com.ar/files/usocket/datasheets/fbr211-relay-fujitsu.pdf">datasheet</a>)</li>
<li>D1, D2, D3. D4 &#8211; Diodes 1N4004</li>
<li>Q1, Q3 &#8211; BC517 Darlington-transistors (<a title="BC517 Darlington Transistor" href="http://www.alfersoft.com.ar/files/usocket/datasheets/bc517.pdf">datasheet</a>)</li>
<li>LED1, LED2 &#8211; Regular leds</li>
<li>C1, C2 &#8211; Capacitors 22pF</li>
<li>C3 &#8211; Capacitor 470pF</li>
<li>X1 &#8211; Mini-USB Connector Type B (<a title="USB connector type B" href="http://www.alfersoft.com.ar/files/usocket/datasheets/2411-02-lumberg-usb-connector-type-b.pdf">datasheet</a>)</li>
</ul>
<p></p>
<h2>PIC Firmware</h2>
<p>Here is what I needed to modify from the original <a title="SIXCA USBDAQ" href="http://www.sixca.com/eng/articles/usbdaq/" target="_blank">SIXCA USBDAQ</a>:</p>
<p>I set bMaxPower to 250, which means 500mA. The power provided by hosts and hubs is twice the value of bMaxPower field, but in reality they are likely to allocate either 100 or 500 milliamperes rather than the specified amount.</p>
<p>The file modified is the one that contains the USB descriptor: fw/cdc/autofiles/usbdsc.c</p>
<pre class="brush: cpp; title: ; notranslate">

/* Configuration 1 Descriptor */
CFG01=
{
/* Configuration Descriptor */
sizeof(USB_CFG_DSC),    // Size of this descriptor in bytes
DSC_CFG,                // CONFIGURATION descriptor type
sizeof(cfg01),          // Total length of data for this cfg
2,                      // Number of interfaces in this cfg
1,                      // Index value of this configuration
0,                      // Configuration string index
_DEFAULT,               // Attributes, see usbdefs_std_dsc.h
250,                    // Max power consumption (2X mA) 250 = 500mA

...
</pre>
<p>In the same file I modified the Vendor ID, Product ID and corresponding strings</p>
<pre class="brush: cpp; title: ; notranslate">

/* Device Descriptor */
rom USB_DEV_DSC device_dsc=
{
sizeof(USB_DEV_DSC),    // Size of this descriptor in bytes
DSC_DEV,                // DEVICE descriptor type
0x0200,                 // USB Spec Release Number in BCD format
CDC_DEVICE,             // Class Code
0x00,                   // Subclass code
0x00,                   // Protocol code
EP0_BUFF_SIZE,          // Max packet size for EP0, see usbcfg.h
0xAF01,                 // Vendor ID
0xAF0A,                 // Product ID: CDC RS-232 Emulation Demo
0x0000,                 // Device release number in BCD format
0x01,                   // Manufacturer string index
0x02,                   // Product string index
0x00,                   // Device serial number string index
0x01                    // Number of possible configurations
};

...

rom struct{byte bLength;byte bDscType;word string[16];}sd001={
sizeof(sd001),DSC_STR,
'a','l','f','e','r','s','o','f','t','.',
'c','o','m','.','a','r'};

rom struct{byte bLength;byte bDscType;word string[21];}sd002={
sizeof(sd002),DSC_STR,
'A','l','f','e','r','S','o','f','t',' ',
'U','S','o','c','k','e','t',' ','1','.','0'};
</pre>
<p>And the file driver/win2k_winxp/mchpcdc.inf  Windows, to match the new vendor, product ID and description</p>
<pre class="brush: cpp; title: ; notranslate">

[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_AF01&amp;PID_AF0A

...

;------------------------------------------------------------------------------
;  String Definitions
;------------------------------------------------------------------------------

[Strings]
MCHP=&quot;alfersoft.com.ar&quot;
MFGNAME=&quot;alfersoft.com.ar&quot;
DESCRIPTION=&quot;Communications Port&quot;
SERVICE=&quot;AlferSoft USocket 1.0&quot;
</pre>
<h2>Programming the PIC</h2>
<p>I&#8217;ve used WinPic800 to program the PIC. Here is a screenshot of the parameters I used to program it.</p>
<p><img style="border: 1px solid black;" src="http://www.alfersoft.com.ar/files/usocket/pictures/usbparams.png" alt="Parameters to program the PIC" width="450" height="304" /></p>
<h2>Commands</h2>
<p>I didn&#8217;t modified any of the USBDAQ commands. They are all available but I only need to use these 4 commands:</p>
<ul>
<li>*A01 (activate relay 1)</li>
<li>*A00 (deactivate relay 1)</li>
<li>*A11 (activate relay 2)</li>
<li>*A10 (deactivate relay 2)</li>
</ul>
<p>All the commands are followed by an enter (chr(13) or &#8216;\n&#8217;).</p>
<h2>Installing (Windows)</h2>
<ol>
<li>Plug the device into the USB port, the following message will appear in the tray bar.</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket01_inst_win.png" alt="Installation Windows step 1" width="440" height="180" /></p>
<li>In the first page of the &#8220;Found New Hardware Wizard&#8221; select &#8220;No, not this time&#8221; and click Next button.</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket02_inst_win.png" alt="Installation Windows step 2" width="450" height="351" /></p>
<li>Select the &#8220;Install from a list or specific location (Advanced)&#8221; option and click Next button.</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket03_inst_win.png" alt="Installation Windows step 3" width="450" height="351" /></p>
<li>Mark the &#8220;Include this location in the search:&#8221; and browse for the directory where the .inf file is located (driver\win2k_winxp)</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket04_inst_win.png" alt="Installation Windows step 4" width="450" height="351" /></p>
<li>This message will appear:</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket05_inst_win.png" alt="Installation Windows step 5" width="450" height="351" /></p>
<li>And then this one:</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket06_inst_win.png" alt="Installation Windows step 6" width="450" height="351" /></p>
<li>When the installation is done press &#8220;Finish&#8221;</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket07_inst_win.png" alt="Installation Windows step 7" width="450" height="351" /></p>
<li>After that the hardware is ready to use.</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket08_inst_win.png" alt="Installation Windows step 8" width="440" height="180" /></p>
</ol>
<h2>Testing (Windows)</h2>
<ol>
<li>Go to the device manager and locate the new COM port added, in my example COM10 was added</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket09_test_win.png" alt="Installation Windows step 9" width="450" height="317" /></p>
<li>Open Hyperterminal and choose a name for the new conection</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket10_test_win.png" alt="Installation Windows step 10" width="332" height="299" /></p>
<li>Select the new COM port</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket11_test_win.png" alt="Installation Windows step 11" width="296" height="300" /></p>
<li>Set the Bit rate to 115200</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket12_test_win.png" alt="Installation Windows step 12" width="344" height="407" /></p>
<li>This step is optional to see what we are typing on the screen, choose ASCII Setup</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket13_test_win.png" alt="Installation Windows step 13" width="344" height="423" /></p>
<li>Then mark &#8220;Echo typed characters locally&#8221;</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket14_test_win.png" alt="Installation Windows step 14" width="263" height="316" /></p>
<li>Finally connect and type one of the commands</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket15_test_win.png" alt="Installation Windows step 15" width="450" height="302" /></p>
</ol>
<h2>Installing (Linux &#8211; Ubuntu)</h2>
<ol>
<li>Plug it. That&#8217;s it! a new device probably called /dev/ttyACM0 will be added by the OS.</li>
</ol>
<p></p>
<h2>Testing (Linux &#8211; Ubuntu)</h2>
<ol>
<li>Open gtkterm if you don&#8217;t have it installed type &#8220;sudo apt-get install gtkterm&#8221; from a terminal</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket01_linux.png" alt="Testing Linux step 1" width="450" height="294" /></p>
<li>Go to Configuration -&gt; Port, set the port to /dev/ttyACM0, the speed to 115200 and click OK</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket02_linux.png" alt="Testing Linux step 2" width="450" height="234" /></p>
<li>Select Configuration -&gt; Local echo</li>
<li>Type the command and press enter</li>
<p style="text-align: center;"><img class="aligncenter" src="http://www.alfersoft.com.ar/files/usocket/pictures/screenshots/usocket03_linux.png" alt="Testing Linux step 3" width="450" height="294" /></p>
<p style="text-align: center;">
</ol>
<h2>Problem</h2>
<p>After I mounted everything in the case a problem appeared, if I plug the USB cable to the computer and then the socket to the wall, the PIC hangs. But it works well the other way round (first plug to the wall and the to the computer). That is probably because the high voltage cables are too close to the PIC and unfortunatelly I&#8217;m not an expert in that matter and I don&#8217;t know how to fix it except by putting the circuit in a separated box. Experts needed! If you know another way to fix it please let me know!</p>
<h2>Pictures</h2>
<p><img src="http://www.alfersoft.com.ar/files/usocket/pictures/proto01.jpg" alt="Prototype" width="450" height="338" /></p>
<p><img src="http://www.alfersoft.com.ar/files/usocket/pictures/proto05.jpg" alt="Prototype" width="450" height="338" /></p>
<p><img src="http://www.alfersoft.com.ar/files/usocket/pictures/board02.jpg" alt="Board" width="450" height="338" /></p>
<p><img src="http://www.alfersoft.com.ar/files/usocket/pictures/board04.jpg" alt="Board" width="450" height="338" /></p>
<p><img src="http://www.alfersoft.com.ar/files/usocket/pictures/case01.jpg" alt="Case" width="450" height="338" /></p>
<p><img src="http://www.alfersoft.com.ar/files/usocket/pictures/case02.jpg" alt="Case" width="450" height="338" /></p>
<h2>Download</h2>
<p><a title="USocket Project" href="http://www.alfersoft.com.ar/files/usocket/usocket.zip">Link to download USocket project</a>, enjoy it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alfersoft.com.ar/blog/2008/07/08/usocket-usb-controlled-socket-with-pic18f4550/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

