index.html 9.16 KB
Newer Older
Prashant Patil's avatar
Prashant Patil committed
1 2 3 4 5 6 7 8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>FabFTDI</title>
</head>

<body>
Prashant Patil's avatar
Prashant Patil committed
9
<h1>Building the FabFTDI (i.e. USB to Serial Converter) </h1>
Prashant Patil's avatar
Prashant Patil committed
10 11
<h1>&nbsp;</h1>
<h1>1 Introduction </h1>
Prashant Patil's avatar
Prashant Patil committed
12
<p>This page descirbes how to make your own FabFTDI cable (i.e. USB to serial converter). FabFTDI is DIY version of FTDI cable that can be made in fablab. It uses an Atmega16U2 microcontroller and is based on USBtoSerial example of LUFA library. Figure below shows the schematic diagram of the the FabFTDI circuit:</p>
Prashant Patil's avatar
Prashant Patil committed
13 14 15
<img src="FabFTDI_Schematic.png" width="900" height="560" alt=""/>
<p><em>Figure: Schematic circuit diagram of FabFTDI.</em></p>
<p>&nbsp;</p>
Prashant Patil's avatar
Prashant Patil committed
16
<p>The FabFTDI is powered through USB port which provides 500mA at 5V. The USB controller needs a precise clock, therefore, an external 16MHz resonator is used as a precise clock source (note- eventhough the resonator is not as precise as a crystal, its precision is sufficient for a USB 2.0 full speed device). The FabFTDI is a USB 2.0 Full-speed device and support upto&nbsp;38400bps of serial communication. The Unix and Mac OS doesn not require any drivers, however, a driver is required for windows operating system (more on this later). </p>
Prashant Patil's avatar
Prashant Patil committed
17
<h1>2 Fabrication of FabFTDI</h1>
Prashant Patil's avatar
Prashant Patil committed
18
<p>Figure below shows the FabFTDI board design. </p>
Prashant Patil's avatar
Prashant Patil committed
19 20 21 22 23 24
<h2>2.1 Board Design</h2>
<img src="FabFTDI_Board.png" width="900" height="400" alt=""/>
<p><em>Figure: Board design of FabFTDI.</em></p>
<h2>2.2 PCB Fabrication</h2>
<p>Download the PCB trace file and outline file from the links below:</p>
<ul>
Prashant Patil's avatar
Prashant Patil committed
25 26
  <li><a href="FabFTDI_trace.png">FabFTDI Board Traces (2000dpi) </a></li>
  <li><a href="FabFTDI_cutout.png">FabFTDI Board cutout (2000dpi) </a></li>
Prashant Patil's avatar
Prashant Patil committed
27 28
</ul>
<p>Figure below shows the milled board. Inspect for error and make sure no wires are short-circuiting. </p>
Prashant Patil's avatar
Prashant Patil committed
29
<img src="index_files/FAbFDI_Milled2.JPG" width="900" height="423" alt=""/>
Prashant Patil's avatar
Prashant Patil committed
30 31
<h2>2.3 PCB Assembly</h2>
<p>For stuffing FabFTDI board you will need following components:</p>
Prashant Patil's avatar
Prashant Patil committed
32
<ol>
Prashant Patil's avatar
Prashant Patil committed
33 34 35 36
  <li>Atmega16U2 micro-controller (or a compatible micro-controller such ast Atmega8U2 or Atmega32U2 with same pin count).</li>
  <li>One 0.1uF capacitor, and one 1.uF capacitor.</li>
  <li>One 0ohm resistor, two 22ohm resistors, two 499ohm resistors, and one 10K resistor.</li>
  <li>One 16MHz resonator. </li>
Prashant Patil's avatar
Prashant Patil committed
37
  <li>One 6 pin 2x3 connector (aka ISP connector), and one 6 pin 1x6 connector. </li>
Prashant Patil's avatar
Prashant Patil committed
38
  
Prashant Patil's avatar
Prashant Patil committed
39
</ol>
Prashant Patil's avatar
Prashant Patil committed
40
<p>It is recommended to start with stuffing smaller and difficult components first and then bigger and easy components such as connectors. For FabFTDI, start with soldering the micro-controller as it is tricky since the pins are very close to each other. Here, I am showing an easy way to solder the microcontroller. First, carelessly solder all the pins to the pads and then use copper braid to remove excess solder. </p>
Prashant Patil's avatar
Prashant Patil committed
41 42 43 44 45 46 47 48

<p>
<img src="index_files/uCSoldering1.png" width="450" height="336" alt=""/>
&nbsp
&nbsp
<img src="index_files/uCSoldering2.png" width="450" height="336" alt=""/>
	</p>

Prashant Patil's avatar
Prashant Patil committed
49
<p>Once the micro-controller is soldered. Solder other components like resistors and capacitors. Finally, at last, solder ISP connector and FTDI connector. Figure below shows my stuffed board. </p>
Prashant Patil's avatar
Prashant Patil committed
50 51
<img src="index_files/FabFTDI_Assembled.JPG" width="900" height="337" alt=""/>
<h1>3 Program the FabFTDI firmware</h1>
Prashant Patil's avatar
Prashant Patil committed
52
<ol>
Prashant Patil's avatar
Prashant Patil committed
53 54 55 56
  <li>Download the firmware file from <a href="Firmware.zip">here</a> and extract it. </li>
  <li>Open a terminal and navigate to the the <em>Firmware</em> directory. Connect your programmer (In my case I am using FabISP) to the FabFTDI ISP connector (make sure to connect in right orientation). To program your board execute the following command:
   
    <pre><strong> $ make program-usbtiny </strong></pre>
Prashant Patil's avatar
Prashant Patil committed
57
    <br />
Prashant Patil's avatar
Prashant Patil committed
58 59 60 61 62 63 64 65 66 67 68
    (if you are using avrisp2 porgramer than execute the following command:<br />
    <pre><strong> $ make program-avrisp2</strong></pre>
    (Note - The code is pre-complied, however, if you want to recompile it locally before flashing it into your FabFTDI board execute the following commands:<br />
    Clean and remove the previously compiled files.<br /> 
    <pre><strong> $ make clean</strong> </pre>
    Recomplie the files again<br />
    <pre> <strong>$ make</strong> </pre>
    Program the newly created hex file to your FabFTDI board. <br />
    <pre> <strong>$ make program-usbtiny</strong> </pre> 
    </li>
  <li>Once the program is succesfully flashed, disconnect the programmer and disconnect the FabFTDI from your computer. Now, connect the FabFTDI back again to your computer and this time the operating system should detect your bouard as FabFTDI. Next section describes how to check if your operating system can detect connected FabFTDI. <br />
Prashant Patil's avatar
Prashant Patil committed
69 70
  </li>
</ol>
Prashant Patil's avatar
Prashant Patil committed
71
<h3></p>
Prashant Patil's avatar
Prashant Patil committed
72
<p>&nbsp;</p>
Prashant Patil's avatar
Prashant Patil committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86
<h1>4 Verify that the OS succesfully detects the FabFTDI</h1>
<p>Once you connect the FabFTI to your computer, both Mac and Unix operating system should detect it right away without needing any driver. However, Windows operating system would require a driver (more on this later). Follow the instruction for your operating system to check if the FabFTDI is detected sucessfully</p>
<h2>4.1 MAC OSX</h2>
<p>Click on the apple icon on the top-left of the screen and then click on "About this Mac". A "system information" box will open, click on the "system report" button which will open another window. On the left of the window, scroll-down and click on USB. Here you should see FabFTDI listed. &nbsp;See the image below for reference.</p>
<img src="index_files/FabFTDI_Mac.png" width="884" height="685" alt=""/>
<h2>4.2 Ubuntu</h2>
<p>In ubuntu, lsusb command is used to list all connected usb devices. Open a terminal and type<br />
  <br />
<pre><strong> $ lsusb</strong></pre>
  <br />
In the list of connected USB devices, you should see FabFTDI listed.
</p>
<h2>4.3 Windows</h2>
<p>Windows operating system need a driver for the FabFTDI to work. When you will connect the FabFTDI to your Windows PC, it will be registered as an "unrecognized device". Follow the instructios below to install the driver.</p>
Prashant Patil's avatar
Prashant Patil committed
87
<ol>
Prashant Patil's avatar
Prashant Patil committed
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
  <li>Downlaod the driver (.inf file) from <a href="Firmware/LUFA USBtoSerial.inf">here.</a></li>
  <li>Open the device manager, right click on the "unrecognized device" and click on "update driver".</li>
  <li>Give the path to the downloaded .inf driver file and windows should be able to succesfully install the driver. </li>
  
</ol>
<p>Once the drive is succesfully installed, the FabFTDI should be listed as "LUFA USB to Serial" in windows device manager. Check the image below for reference. </p>
<img src="index_files/DeviceManager_Windows.PNG" width="803" height="587" alt=""/>
<h1>5 Testing your FabFTDI</h1>
<p>We are almost done! To check that our FabFTDI is indeed functining as a FTDI cable, we would need a serial terminal through which we will send some characters to our FabFTDI. The easiest way I have found is using the serial monitor that comes with Arduino IDE. Below are the instructions to test your FabFTDI:</p>
<ol>
  <li>If you don't already have arduino, download and istall it.</li>
  <li>Open the arduino IDE.Go to tools-port and select the FabFTDI port (in my case, its COM6)<br />
    <br />
  </li>
  <img src="index_files/Arduino_SetPort.png" width="507" height="608" alt=""/>
  <li>Now go to Tools and open "Serial Monitor".</li>
  <li>Connect the Rx and Tx pin of your FabFTDI board using a jumper wire (or a jumper, or just wrap a wire around Rx and Tx pin) as show below. </li>
  <li>Now go to "Tools" and open "Serial Monitor". In the Serial Monitor, the top text input box is for sending the character to the FabFTDI and the bottom "read only text box is showing the recieved characters. Since, we have connected the Rx and Tx pin. Any character send to the FabFTDI will be recieved back to FabFTD and should appear in the reciever text box. <br />
Prashant Patil's avatar
Prashant Patil committed
106
    <br />
Prashant Patil's avatar
Prashant Patil committed
107 108
    Type something on the top text box and click on "send". If you see the same characters show in the text box below, you have a working FabFTDI. Congratulations!! </li>
  <img src="index_files/Serial_Monitor.PNG" width="780" height="391" alt=""/>
Prashant Patil's avatar
Prashant Patil committed
109 110 111
</ol>
<p>&nbsp;</p>
<p>&nbsp;</p>
Prashant Patil's avatar
Prashant Patil committed
112 113 114
<p>&nbsp;</p>
<h1>6 Troubleshooting</h1>
<p>Sometime things don't workout the way we want them to, If your FabFTDI is not working, try following things</p>
Prashant Patil's avatar
Prashant Patil committed
115
<ol>
Prashant Patil's avatar
Prashant Patil committed
116 117 118
  <li>Consider using other USB port on your computer. Our FabFTDI is a USB 2.0 full speed device. Many modern computers come with USB 3.0 ports which technically should be compatible with USB 2.0, however, sometime connecting a USB 2.0 to a USB 3.0 port doesn't work. </li>
  <li>Check that you have used the right resonator. It must be 16MHz resonator. </li>
  
Prashant Patil's avatar
Prashant Patil committed
119 120 121 122 123 124 125 126
</ol>
<p>&nbsp;</p>

<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.


</body>
</html>