Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Serial Communication via D0 and D1


  • Please log in to reply
1 reply to this topic

#1 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 05 December 2010 - 10:58 PM

I'm trying to get this onewire to rs232 device working, and of course it's not... :(

For serial, using D0 for RX (hooked to TX on my device) and D1 as TX (hooked to RX on my device), do I need anything other than:

var s1 = new SerialPort(SerialPorts.COM1, 9600);
s1.Open()

... and then I can read and write using s1.Read and s1.Write?

What does .Read do if there's no data there? Does it just wait? Return garbage?

I'm getting data via s1.Read with nothing even hooked up to the netduino.

#2 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 06 December 2010 - 02:50 AM

OK I figured it out... I was receiving 4x more bytes than expected because the onewire->rs232 works in a completely unexpected way. Even once I disconnected the device, the uart still had data in it. So, when I ask it to read a byte, it returns the byte represented in hex using ascii characters... So, if I was expecting just this byte: 11111111 (in binary) (255 in decimal) (FF in hex) it actually sends the ascii character F twice followed by linefeed and carriage return, for a total of four bytes.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.