Hi everyone,
I emailed this list a while back. I'm back because I got some data from my
device!
I am trying to control the GPIO lines on an SSS1623 chip on a USB sound
dongle.
The manufacturer sent me some test software (including source) but it was
compiled for a different product ID to my device. The source did not include
the code for constructing the packets which controlled the GPIO registers.
I could not recompile the code for my device because I didn't have access to a
Microsoft compiler, nor did anyone I know (although I'd like to thank
everyone who offered help).
I found out I could short two pins on the chip which changes the product into
a different model, and the product ID changes to the one the test software
will recognise. Hooray!
I hooked up an LED to GPIO0 and ran the test software. With the test software
I can set the GPIO pins to input or output, and I can write 0 or 1 to the
output pins. The LED goes on and off.
I ran a USB snooping program [1] and got some data when I set and cleared the
bits. In some ways I am disappointed as the format is the same as the CM108
chip. I speculated that this might be the case, but I couldn't make pyUSB
send these packets. Never mind. Now I know the format for sure I need to
work on my pyUSB code.
I need to send four bytes: 00 out ddr 00.
'out' is the bit pattern to drive the output (1 is output high)
'ddr' is the bit pattern for the pin direction (1 is output)
First I sent 0x01 0x01 (GPIO0 output high), then 0x00 0x01 (GPIO0 output low),
then 0x00 0x00 (GPIO0 input). I have attached the USBsnoop XML log file.
The first 14 packets are for identifying the device. After packet 14 I sent
0x01 0x01. After packet 18 I sent 0x00 0x01. After packet 24 I sent 0x00
0x00.
Here is the packet that sends 0x01 0x01
<urb sequence="9">
<function>CLASS_INTERFACE</function>
<timestamp>31341</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes>00010100</payloadbytes>
</payload>
</urb>
How do I do this in pyUSB? So far I have managed to identify the device,
detach the driver (for interface 3, the HID interface) and I can read the
state of the GPIO pins (but I cannot write to them).
Hints and tips would be welcome.
Thank you,
Andrew
[1] http://sourceforge.net/projects/usbsnoop/
<?xml version='1.0'?>
<!-- This file was generated by SnoopyPro -->
<snoopyprolog>
<urb sequence="1">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>
<timestamp>1</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="1">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>
<timestamp>1</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="2">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>
<timestamp>1</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="2">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>
<timestamp>1</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="3">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>
<timestamp>1</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="3">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>
<timestamp>1</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="4">
<function>SELECT_CONFIGURATION</function>
<timestamp>1</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="4">
<function>SELECT_CONFIGURATION</function>
<timestamp>1</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="5">
<function>CLASS_INTERFACE</function>
<timestamp>1</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="5">
<function>CONTROL_TRANSFER</function>
<timestamp>4</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="6">
<function>GET_DESCRIPTOR_FROM_INTERFACE</function>
<timestamp>4</timestamp>
<endpoint>-1</endpoint>
</urb>
<urb sequence="6">
<function>CONTROL_TRANSFER</function>
<timestamp>8</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>50</payloadcount>
<payloadbytes>050c0901a1011500250109e909ea75019502810209e20900810609009504810226ff000900750895038102090095049102c0</payloadbytes>
</payload>
</urb>
<urb sequence="7">
<function>BULK_OR_INTERRUPT_TRANSFER</function>
<timestamp>10</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="8">
<function>BULK_OR_INTERRUPT_TRANSFER</function>
<timestamp>10</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="9">
<function>CLASS_INTERFACE</function>
<timestamp>31341</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes>00010100</payloadbytes>
</payload>
</urb>
<urb sequence="9">
<function>CONTROL_TRANSFER</function>
<timestamp>31344</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="10">
<function>CLASS_INTERFACE</function>
<timestamp>31344</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="10">
<function>CONTROL_TRANSFER</function>
<timestamp>31348</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes>00ff0000</payloadbytes>
</payload>
</urb>
<urb sequence="11">
<function>CLASS_INTERFACE</function>
<timestamp>74659</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes>00000100</payloadbytes>
</payload>
</urb>
<urb sequence="11">
<function>CONTROL_TRANSFER</function>
<timestamp>74663</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="7">
<function>BULK_OR_INTERRUPT_TRANSFER</function>
<timestamp>74663</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes>00fe0000</payloadbytes>
</payload>
</urb>
<urb sequence="12">
<function>BULK_OR_INTERRUPT_TRANSFER</function>
<timestamp>74663</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="13">
<function>CLASS_INTERFACE</function>
<timestamp>74663</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="13">
<function>CONTROL_TRANSFER</function>
<timestamp>74667</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes>00fe0000</payloadbytes>
</payload>
</urb>
<urb sequence="14">
<function>CLASS_INTERFACE</function>
<timestamp>98275</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes>00000000</payloadbytes>
</payload>
</urb>
<urb sequence="14">
<function>CONTROL_TRANSFER</function>
<timestamp>98278</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="8">
<function>BULK_OR_INTERRUPT_TRANSFER</function>
<timestamp>98278</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes>00ff0000</payloadbytes>
</payload>
</urb>
<urb sequence="15">
<function>BULK_OR_INTERRUPT_TRANSFER</function>
<timestamp>98278</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="16">
<function>CLASS_INTERFACE</function>
<timestamp>98278</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes></payloadbytes>
</payload>
</urb>
<urb sequence="16">
<function>CONTROL_TRANSFER</function>
<timestamp>98282</timestamp>
<endpoint>-1</endpoint>
<packetcount>1</packetcount>
<payload packet="0">
<payloadcount>4</payloadcount>
<payloadbytes>00ff0000</payloadbytes>
</payload>
</urb>
</snoopyprolog>
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users