[Mono-list] Invalid data from CP2102 USB device

Steve Ricketts velocedge at hotmail.com
Mon Apr 12 15:53:00 EDT 2010


This was actually posted by leblanc but I copied it here because the thread
was moved.

<[hidden email]> <[hidden email]>
Message-ID: <[hidden email]>
X-Sender: [hidden email]
Received: from airband-66-226-226-90.airband.net [66.226.226.90] with
HTTP/1.1
        (POST); Mon, 12 Apr 2010 15:53:59 +0000
User-Agent: RoundCube Webmail/0.1b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit



> to be consistent, same data every time the same key is pressed, but not
> the

It is because your losing the sign bit. (all except 213/184 )  Make sure
your saving to unsigned byte


// 1 - 186 90
10111010
01011010


// 2 - 133 5
10000101
00000101


//3 - 213 184
11010101
10111000


//4 - 128 0
10000000
00000000


//5 - 130 2
10000010
00000010

//7 - 145 17
10010001
00010001




On Mon, 12 Apr 2010 04:27:51 -0800 (PST), Steve Ricketts
<[hidden email]> wrote:
>
> I used BackgroundWorker to set up a thread to continually look at
> BytesToRead
> and grab the data.  It does that ok, but the data is not correct.  It
> seems
> to be consistent, same data every time the same key is pressed, but not
> the
> correct values.  The USB device is an RF receiver that listens to
wireless

> remote controls.  When I press a button on the wireless remote, I get the
> proper packet size (8) but the values are off.  An example below with the
> results from the program in Windows:
>
> Linux      Windows (correct values)
> 0 - 255   255
> 1 - 186   90
> 2 - 133   5
> 3 - 213   184
> 4 - 128   0
> 5 - 130   2
> 6 - 128   0
> 7 - 145   17
>
> Using the same baud rate on Linux that I do with Windows (128000) I get
> nothing from the receiver.  Switching to 115200 I get the data but as I
> said, it's incorrect.  No other baud rate gives me any response at all.
>
> Has anyone had any similar issues or know what else I could try?
> --
> View this message in context:
>
... [show rest of quote]
http://n4.nabble.com/Reading-from-a-USB-device-attempting-anyway-tp1835480p1837047.html
> Sent from the Mono - MonoDevelop IDE mailing list archive at Nabble.com.
> _______________________________________________
> Monodevelop-list mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monodevelop-list

_______________________________________________
Monodevelop-list mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monodevelop-list
-- 
View this message in context: http://n4.nabble.com/Invalid-data-from-CP2102-USB-device-tp1837224p1837654.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list