EmbeddedRelated.com
Forums

PDIUSBD12 USB odyssey,help

Started by blisca October 5, 2007
Hi to all

in the aim of studying USBprotocol i built a little board including a 9s12
microcontroller and a PDIUSBD12 parallel to USB interface,often called D12
well after spending tenth of hours on it i can't even have the enumeration,

i ask desperately help,

i started modifying(maybe not in the right way) the code from
http://www.beyondlogic.org/usbnutshell/usb7.htm#PIC16F876Example,it uses a
PDIUSBD11 that has some differences(I2C instead of parallel,8 bytes deep
control buffer instead of 16)

it is not completely dead,i can control what is happening inside via an In
circuit debugger and on a terminal screen,because my i told to my micro
(that runs on a clock>30 Mhz)to  sends short strings
at 115200 bps,so to have an intuitive log

once plugged in the USB it has:
1) a Bus _reset,
2)an interrupt at ENDP 0(CTRL_OUT) that signals a request from the host,it
is aSetup Packet
3)reading the buffer it appears to be a GetDescriptorRequest, wlenght is 64
4)the example that i'm refering to says to change the length of bytes to
send to 18,the length of a DeviceDescriptor structure,ok,i do that
5)the micro writes the CTRL_IN endpoint,first 16 bytes
6)the micro receives a CTRL_IN interrupt from the D12,the host asks for what
it said to want at step 2)
7)the remaining 2 bytes of the descriptor are written in CTRL_IN buffer

8) at this point i expect that the host sends another CTRL_IN interrupt,but
i have instead an Interrupt at CTRL_OUT,and after this the cycle repeat for
3 times until the host give up

Here is 1 third of the log
I** =Interrupt detected   BRes=Bus Reset interrupt  LastSt= Last Transaction
Status buffer
T_DEV_DSCR=Type_Device_Descriptor   all numbers are in Hex format

Wait_Intrpt
I**
BRes
Wait_Intrpt
I**
INT_EP0_OUT#EP0LastSt=21  -SetupPacket-readEndP00
dLength08  bmR=80  bR=06  wL=40  -flushed-StdDevReq-bReq=06
GET_DESCR_REQ
GetDescr-T_DEV_DSCR-Byttosend12
WR_EndP01  =12  01  01  10  00  00  00  00  04  5E  93  0A  00  00  01  00
I**-I_CTRL_IN-Norm#LastSt=C1  -Byttosend02
WR_EndP01  =00  01
I**
INT_EP0_OUT#EP0LastSt=41   datapacket     <<<<<<<<<<<(8  ?????
Wait_Intrpt
I**
BRes
Wait_Intrpt


Thanks even just for the effort to read all this long message!!