aerodyno
09-26-2008, 07:09 PM
I'm writing a C# program and I want to be able to read from and write to my BS1USB.
I've created a sample program, now running on my BS1USB that prints a random value to the debug terminal.
Here's the DEBUG window output:
VALUE = 4980
VALUE = 4864
VALUE = 4633
VALUE = 4170
Every five seconds, it prints a new random value via DEBUG.
I'm trying to read this same output into my C# program. I've got the serial port open from C#, but I get lots of gibberish.
Here's what the output looks like in my C# program (ideally it would be the same as above):
??????????????????????????????????[gibberish]??????
????????????????????????????????[gibberish]????????
??????????????????????????????[gibberish]??????????
????????????????????????????[gibberish]????????????
Note that the 'gibberish' block appears regularly, and I believe it's the "VALUE = XXXX" text coming through, because the rate is once every 5 seconds.
I've concluded that my serial settings are wrong -- so I'm reading the 1s as characters. So what are the appropriate settings for the BS1USB to read this DEBUG information? I've scoured the documentation but haven't found anything.
Most of the documentation points to SERIN and SEROUT which is for specific pins, not the built-in USB serial connection, so I'm confused.
Any help? Is there some existing BS1USB <-> C# communication library I just haven't found? ;)
Thanks,
Aerodyno
I've created a sample program, now running on my BS1USB that prints a random value to the debug terminal.
Here's the DEBUG window output:
VALUE = 4980
VALUE = 4864
VALUE = 4633
VALUE = 4170
Every five seconds, it prints a new random value via DEBUG.
I'm trying to read this same output into my C# program. I've got the serial port open from C#, but I get lots of gibberish.
Here's what the output looks like in my C# program (ideally it would be the same as above):
??????????????????????????????????[gibberish]??????
????????????????????????????????[gibberish]????????
??????????????????????????????[gibberish]??????????
????????????????????????????[gibberish]????????????
Note that the 'gibberish' block appears regularly, and I believe it's the "VALUE = XXXX" text coming through, because the rate is once every 5 seconds.
I've concluded that my serial settings are wrong -- so I'm reading the 1s as characters. So what are the appropriate settings for the BS1USB to read this DEBUG information? I've scoured the documentation but haven't found anything.
Most of the documentation points to SERIN and SEROUT which is for specific pins, not the built-in USB serial connection, so I'm confused.
Any help? Is there some existing BS1USB <-> C# communication library I just haven't found? ;)
Thanks,
Aerodyno