Shop OBEX P1 Docs P2 Docs Learn Events
Omega Pressure Sensor - USB Host Communication Problem — Parallax Forums

Omega Pressure Sensor - USB Host Communication Problem

Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
edited 2012-03-04 15:57 in Propeller 1
Pressure Sensor:
OMEGA Model # PX409-25KAUSB.USB Connector

Problem: Does not communicate with the Propeller USB host software and I get a USB enumeration error 170

==============================================================================================
USB Host software tht I am using:

http://forums.parallax.com/showthread.php?121321-Working-full-speed-(12-Mb-s)-bit-banging-USB-Host-controller


USB socket to Breakout board. Propeller Chip connected on P0- Pins 1 and P2-pin2
Another adapter that works on the connection: I can connect FTDI based USB to Serial converter with a serial 9 pin connecter. It enumerates fine with the same wiring I'm am using for the pressure sensor. Therfore, I assume the pinouts and wiring is fine.

===================================================================================================================================================================================

1. Files attached: PressureSensorUSB Info.txt (Captured with a USB utility, with the pressure sensor plugged into the Laptop USB port (not connected to the Prop)

USB Serial Port_Com10.jpg ( (Captured from the control pannel, with the pressure sensor plugged into the Laptop USB port (not connected to the Prop)
================================================================================================================

Error Codes Added:

' So that multiple levels of the software stack can share
' error codes, we define a few reserved ranges:
'
' -1 to -99 : Application
' -100 to -150 : Device or device class driver
' -150 to -199 : USB host controller
'
' Within the USB host controller range:
'
' -150 to -159 : Device connectivity errors
' -160 to -179 : Low-level transfer errors
' -180 to -199 : High-level errors (parsing, resource exhaustion)
'
' When adding new errors, please keep existing errors constant
' to avoid breaking other modules who may depend on these values.
' (But if you're writing another module that uses these values,
' please use the constants from this object rather than hardcoding
' them!)

E_SUCCESS = 0

E_NO_DEVICE = -150 ' No device is attached
E_LOW_SPEED = -151 ' Low-speed devices are not supported
E_PORT_BOUNCE = -152 ' Port connection state changing during Enumerate

E_TIMEOUT = -160 ' Timed out waiting for a response
E_TRANSFER = -161 ' Generic low-level transfer error
E_CRC = -162 ' CRC-16 mismatch and/or babble condition
E_TOGGLE = -163 ' DATA0/1 toggle error
E_PID = -164 ' Invalid or malformed PID and/or no response
E_STALL = -165 ' USB STALL response (pipe error)

E_DEV_ADDRESS = -170 ' Enumeration error: Device addressing
E_READ_DD_1 = -171 ' Enumeration error: First device descriptor read
E_READ_DD_2 = -172 ' Enumeration error: Second device descriptor read
E_READ_CONFIG = -173 ' Enumeration error: Config descriptor read

E_OUT_OF_COGS = -180 ' Not enough free cogs, can't initialize
E_OUT_OF_MEM = -181 ' Not enough space for the requested buffer sizes
E_DESC_PARSE = -182 ' Can't parse a USB descriptor

Comments

  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-02-29 17:51
    From the Pressure sensor user guide:

    The USB connection appears on the PC as a virtual serial COM Port. In order to communicate with the
    PX409-USB, the PC running a terminal program (such as HyperTerminal) must have the following serial
    communication settings:
    Baud: 9600
    Data Bits: 8
    Parity: None
    Stop Bits: 1
    Flow Control: None
    In addition, the checkboxes in HyperTerminal “ASCII Setup”, “Send line ends with line feeds” and “Echo
    typed characters locally” should be checked for best appearance.
    Command Summary:
    P Transmit pressure in units specified by the UNITS Command.
    PA Transmit pressure in units specified by the UNITS Command,
    and ambient temperature Degrees Fahrenheit, separated by a
    comma, and without units.
    ENQ Transmit Unit ID code, firmware version, range, and units.
    UNITS Transmit default units for the device.
    DPLACES Transmit the number of decimal places used by the device.
    IFILTER Set/Transmit IIR filter period (time constant).
    MFILTER Set/Transmit Moving Average filter order.
    RANGE Transmit the pressure range of the
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-02-29 20:31
    Bob,
    Does your second post means you ave solved the problem or is it just an explanation?
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-02-29 23:01
    Odd. The Pressure sensor looks just like a regular FTDI FT232. I wonder if maybe it requires more power than you're giving it? Do you have 5v@500ma available to the USB port?
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-03-01 17:16
    Cluso99 wrote: »
    Bob,
    Does your second post means you ave solved the problem or is it just an explanation?

    That info was from the Pressure sensor user guide: Thanks! for having a look.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-03-01 19:36
    Odd. The Pressure sensor looks just like a regular FTDI FT232. I wonder if maybe it requires more power than you're giving it? Do you have 5v@500ma available to the USB port?

    Yes I use an external breadboard power supply: 5V @ 1.0 amps. Thanks!

    I haven't tried allot of troubleshooting yet but hope to get time tomorrow to try a few things.!
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-03-01 19:46
    Bob. Have been able to get Micahs code to work at all. That is, without your modifications?

    I have wanted for some time to get this running. I would think that using the code as a Com port should be the simplest to use as a base. But there are not enough hours in the day :(
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-03-02 06:58
    @Cluso99

    The library works fine with a HP USB to serial (9pin) FTDI adaptor. I am using that adaptor to establish a base line to go forward with the pressure sensor testing.

    Here is the HP USB to serial (9pin) FTDI adaptor. test results

    TEST 1: HP USB to serial (9pin) FTDI adaptor. (FT232 USB Serial Port driver for the Parallax Propeller)

    RESULT:
    :Device configuration:
    Interface ptr=038D number=00 alt=00 class=FF subclass=FF

    Endpoint ptr=0396 address=81 maxpacket=0040

    Endpoint ptr=039D address=02
    maxpacket=0040
    Found device 0403:6001


    Raw device descriptor:
    12 01 10 01 00 00 00 08 03 04 01 60 00 02 01 02 03 01

    Test 2: Test communications with an FT232 UART device.

    RESULT: " identified as a FT232 device"
    " Enter baud rate:"

    So, all is fine with this adapter.
    ================================================================================================================================
    I don't have it working with the pressure sensor but just started some additional testing today. I am stuck at the USB host stage.

    USB Pressure Sensor TEST 1: FT232 USB Serial Port driver for the Parallax Propeller.

    RESULT: Error 171

    Which is " E_READ_DD_1 = -171 ' Enumeration error: First device descriptor read "
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-03-02 10:18
    I had a look at the device descriptor files for the pressure sensor and the USB to serial port. The only differences that I see are the following:

    Pressure sensor:
    0x0409: "USB Pressure"
    0x0409: "USB Pressure"

    iInterface: 0x02
    0x0409: "USB Pressure"
    0x0409: "USB Pressure"

    iSerialNumber: 0x03
    0x0409: "00420220"


    Device Address:0x02, Device Address: 0x04 /// This changes depending on the number of USB devices added to the Laptop/ Windows 7.0

    ======================================
    USB UART:

    0x0409: "FT232R USB UART"
    0x0409: "FT232R USB UART"

    bmAttributes: 0xA0 (Bus Powered Remote Wakeup)
    MaxPower: 0x2D (90 Ma)

    iSerialNumber: 0x03
    0x0409: "A4003GKU"

    Device Address: 0x02

    =========================================
    I don't see any major difference between them.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-03-02 10:21
    @ Circuitsoft


    MaxPower: 0x32 (100 Ma)
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-03-02 16:12
    Sorry Bob. I misread what you are doing.

    Pressure sensor (USB)
    (USB host code) Propeller (serial)
    (serial) Adapter FTDI (USB)
    (USB) PC
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-03-04 09:29
    @Cluso99

    The FTDI serial adapter was only to test the library and it worked out of the box.

    The pressure sensor is now working and all I did was:

    1. Change the power and Gnd from the breadboard and used the Mouse connector of the Hybrid development board instead for +5V and GND.
    2. I shortened the USB cable length on the socket end.
    3. I adjusted the start-up baud rate from 115,600 to 57600 in both the Spin file and the terminal program. (the baud rate setting turned out to be the overall problem)

    ** Thanks to Micah Dowty for creating such a excellent set of software tools to use.** It was quite an undertaking. :)
    1024 x 640 - 35K
    1024 x 640 - 34K
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-03-04 15:57
    Fantastic result Bob. It is really great to see the prop do these impossible things ;) They just seem to take a little longer.

    As bait... what else can't the prop do?
Sign In or Register to comment.