Omega Pressure Sensor - USB Host Communication Problem
Bob Lawrence (VE1RLL)
Posts: 1,720
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
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
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
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.
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.!
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
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 "
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.
MaxPower: 0x32 (100 Ma)
Pressure sensor (USB)
(USB host code) Propeller (serial)
(serial) Adapter FTDI (USB)
(USB) PC
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.
As bait... what else can't the prop do?