project logo   Electronics - PHCC - USB 
 
news
 
 
main
 
 
plans
 
electronics
 
    phcc
 
 
        input
 
 
        motherboard
 
 
        output
 
 
         LEDs and segmented displays
 
 
        keymatrix
 
 
        analog
 
 
        analog out
 
 
        lcd
 
 
        quadrature decoder
 
 
        servo
 
        usb
 
 
        digital out
 
 
        tutorials
 
 
        relay
 
 
        download
 
 
        docs
 
 
    cockpit interfacing
 
 
    keymatrix
 
 
    mcp
 
 
    picjoy
 
 
software
 
 
stephen
 
 
hangar
 
 
x11gc
 
 
inside the flightdeck
 
 
panels
 
 
ideas
 
 
tools
 
 
hardware
 
 
links
 
 
acronyms
 
 
contact
 
 
mailinglist
 

PHCC USB Interface

Introduction

The default method to connect PHCC to the computer is via the RS-232 serial port. While PHCC could do more, most PCs are limited to 115200 bit/second. This puts the effective bandwidth at about 11520 bytes/sec.

The problem is that new computers often don't have serial ports anymore. They want you to use the Universal Serial Port (USB) instead.

Speed Considerations

If you look at the (marketing) numbers of USB, it sounds great. For USB 1.1 those numbers are

  • Low Speed: 1.5Mb/s
  • Full Speed: 12Mb/s and USB 2.0 adds a third speed:
  • High Speed: 480Mb/s


Note: the above numbers with "Mb/s" are MegaBIT per second.

The problems here are:

  1. USB data rates are not per-device, but per bus (bandwidth)
  2. USB data rates are "raw". No device will ever get up to that number
    1. there is protocol overhead
    2. the protocol doesn't allow just blasting bits over the wire whenever the user feels like it. Packet size and frame transmit times are limited
  3. As more and more devices supporting USB make it to the market, people start using them
    1. This leads to lots of USB devices dangling from user's PCs.
    2. Since all devices on the bus share the bandwidth, things get slower with more devices
    3. some devices need lots of bandwidth, and if lots of data is transferred, the bandwidth is taken away from other devices
      1. webcams
      2. USB harddrives/cdroms
      3. USB card readers for compact flash, MMC, SD, ...
      4. digital cameras
  4. Many commerical USB devices with a higher bandwidth need use some nasty tricks to make USB faster. This, of course, can have adverse effects if you have other devices on the bus.
    1. one of the tricks seems to be to decrease the period of transmits (USB frame) from its defined value of 1ms to shorter periods. This violates the USB specs!

For more info, esp. on USB bandwith, check out the PDF from Microchip's Masters Conference 2004:
http://techtrain.microchip.com/masters2004/downloads/classes/858/858.htm
This contains some very good info.

USB vs. RS-232

If we were to compare the actual usable bandwidth of the RS-232 serial port and USB (low speed), RS-232 would clearly be the winner, even with (RS-232) speeds as low as 19200 bits/s.

We need at least the next USB speed class, full speed, to outperform RS-232. However, if there's a lot going on on that USB bus, effective data tranfer rates could drop below those of RS-232.

Here are a few quotes from the above mentioned document from Microchip:

Regarding Full Speed USB:

  • "Realistic raw data throughput to a single peripheral is ~1.0 MB/s"
  • "Only 64KB/s in many cases"

Regarding Low Speed USB:

  • "8- byte data transfer every 10 ms"
  • "= 800 Bytes/ second only"

USB and PHCC

To use PHCC effectively with USB, we should skip low speed USB entirely as its just not up to the task. High speed USB is only available on USB2.0, which is still too new, so not all computers support it yet, and interface chips are harder to come by and probably much more expensive.

This leaves us with Full Speed USB. There are many chips that can be used, those from FTDI are good, easy to work with, cheap and they don't need to be programmed. Their FT232 series fits the bill perfectly as it can talk RS-232 on one side and USB on the other side. It doesn't need a whole lot of external components.

In fact, this chip is used in many of the commerical serial-to-USB converters found on the market.

PHCC USB Interface Board "IFACE_USB_FTDI232"

Features:

  • plugs in the USB interface board socket on the PHCC motherboard
  • (serial port side) speeds up to 1Mbit/sec
  • (USB port side) Full Speed device (raw speed of 12Mbit/s)
  • USB1.1 and USB2.0 compatible
  • hardware handshake
  • uses FTDI Chip's FT232BM
  • USB 'B'-type socket

Schematic and Layout

Click to enlarge [16k, 342x319]


Click to enlarge [21k, 720x658]


Bill of Materials

The BOM is here: bom_iface_usb_ft232.txt
This list includes prices and links to to online catalogue pages of my primary source of electronics components, Reichelt Elektronik

made with MBWeb/sdf/vim, best viewed with eyes, powered by 230VAC        |       Get Firefox!