• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

First steps with the nrComLib for USB Pipe and some Problem

Started by thorsten, August 23, 2014, 02:21:49 pm

Previous topic - Next topic

thorsten

Hello,

I use the USBPIPEDemo with Delphi 2010, my Atmel Xmega-Device work with the Devicedriver good.

But I have some problem, my device use an Pipe-Data-Length with 64 Bytes. 

I fix the TnrUSBPipePair.ReadBufferSize to 64, too.

So if my device print the full Data-Paket in the Memo2. For the first test, the Atmel-Device answer on every sending in the Terminal a paket back with 64 x the sending char.
The USBPipePair receive 64 Bytes, but the packet is not right, only the first 32 Bytes.

My debug output from device, show the Data correct the Analyser too. But the Data in the USBPipePair-Receive isn't correct.

I send teh char "a", my device receive the char "a" (0x61), my device send back 64 x 'a' 0x61

see Analyser:
61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61   aaaaaaaaaaaaaaaa
61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61   aaaaaaaaaaaaaaaa
61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61   aaaaaaaaaaaaaaaa
61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61   aaaaaaaaaaaaaaaa

But the USBPipePair-Receive is:
Rec:64 bytes
61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61
61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61
AB AB AB AB 00 00 00 00 A0 72 AB 00 A8 5F 28 5B
EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE

If i send "1":
Analyser receive from my device:
31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31   1111111111111111
31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31   1111111111111111
31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31   1111111111111111
31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31   1111111111111111

USBPipePair-Receive is:
Rec:64 bytes
31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
AB AB AB AB 00 00 00 00 A0 71 AB 00 00 00 0D 00
15 DB 4C 50 01 00 AB AB AB AB EE EE EE EE EE EE

I hope someone has an idea.

Best regards from Germany  :)

Thorsten