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 Port Settings...


  • Please log in to reply
9 replies to this topic

#1 mososky

mososky

    New Member

  • Members
  • Pip
  • 4 posts

Posted 05 March 2012 - 03:28 AM

Hello, first posting new to group. With the help of previous forum posting, tonight I got a netduino plugged into a 7 segment display which is my first project. The thing that took the longest to figure out was, the code for creating the serial port. SerialPort p = new SerialPort("COM1"); What was a problem here was specifing the "COM1" string. Although I tracked down the com1 transmission is = ping 1 on the netduino, it is not clear why or where that spec comes from. First, is there a spec somewhere which shows COM1 relationship to pins? Second, why am I seemingly limited to com1 or 2 in creating a com port? Why can't I utilize 8 pairs for fully 8 serial comminication instances? Or can I? Last, if there are only 2 available serial ports to use, Then there is only a 1/2 relationship between a bet dunio and the number of serial comm devices that you can attach to it? That doesn't seem right and a huge design barrier. Please correct me. Thanks, Matthew

#2 ColinR

ColinR

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationCape Town, South Africa

Posted 05 March 2012 - 05:18 AM

is there a spec somewhere which shows COM1 relationship to pins?


Grab the pinout cards Tecchie made.

http://forums.netdui...5-pinout-cards/

#3 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 05 March 2012 - 08:14 AM

Second, why am I seemingly limited to com1 or 2 in creating a com port? Why can't I utilize 8 pairs for fully 8 serial comminication instances? Or can I?

The Netduino microcontroller has only two USART hardware modules and so called Debug Unit, which acts as third one, but has limited features. The Debug Unit is available as COM1 and one USART (USART0) as COM2, mainly because there is only very few pins available for features to be broken out (result of [hard] design decisions).

Technically, it is possible to implement UART in software, but managed code (C#) is too slow for that (at least for baudrates that can be used in practical scenarios; because .NET MF does not have JIT, the code is interpret) and there is no native driver (C/C++) for this feature yet.

Then there is only a 1/2 relationship between a bet dunio and the number of serial comm devices that you can attach to it? That doesn't seem right and a huge design barrier.

Yes, you can connect only two serial comm devices to Netduino, if they need both Rx and Tx lines; it is also possible to use multiplexing (requires external circuitry). Please note Netduino is more like general purpose board than a specialized serial comm board (e.g. for industrial purposes ?). You might need to consider using a serial comm expansion, for example a Netduino-compatible shield or a dedicated circuit that can be driven from Netduino (over UART, SPI, I2C etc.). In this case you can have more real-time-like behavior, which is not achievable by Netduino alone, due to .NET Micro Framework limitations (it is not real-time system).

#4 mososky

mososky

    New Member

  • Members
  • Pip
  • 4 posts

Posted 05 March 2012 - 03:11 PM

That really seems like a big problem. Say I want to build a system that has 100 temperature sensors. I'm looking at 50 netduino devices so that I can collect data from all of them? An thats assuming that I find another way to transmit the data back to a central respository not using serial? Anyone have a examples of a compatible comm board that allows for somthing like 8 or 16+ seriable ports to be added and managed from the netduino? Thanks Matthew

#5 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 05 March 2012 - 03:18 PM

Say I want to build a system that has 100 temperature sensors. I'm looking at 50 netduino devices so that I can collect data from all of them?

What sensors do you have? Or are you in design phase?

#6 mososky

mososky

    New Member

  • Members
  • Pip
  • 4 posts

Posted 05 March 2012 - 10:37 PM

http://www.robotshop.com/PDF/dht11.pdf

#7 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 06 March 2012 - 04:06 AM

That really seems like a big problem. Say I want to build a system that has 100 temperature sensors. I'm looking at 50 netduino devices so that I can collect data from all of them? An thats assuming that I find another way to transmit the data back to a central respository not using serial?

Anyone have a examples of a compatible comm board that allows for somthing like 8 or 16+ seriable ports to be added and managed from the netduino?

Thanks
Matthew


I have a setup that has multiple sensors all using I2C. If you get the right sensors, there shouldn't be an issue having several

#8 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 06 March 2012 - 04:21 AM

Mososky, it seems to me that the sensor is using the 1-wire protocol, not the USART one. To achieve such a communication, you should upgrade the Netduino to the 4.2 firmware (I'm not sure though).

I don't have clear what you are going to do. 100 sensors spread everywhere, and their measure collected into a server?
What's the supposed role of the Netduino(s)?

Serials...
There's no chips with dozen of serials, because it has no advantages. The easiest way is multiplexing the sensors.
Suppose you wish to read 16 sensors with a single Netduino. You can use a 74HC4067, which is a 16-to-1 multiplexer: the single signal available by the Netduino can be actually split to 16 paths (i.e. sensors).

Please, note that *any* of the available protocols (I2C, SPI, USART, 1-wire, etc) imply that the wiring from the Netduino to the sensor(s) has to be very short (15-20 cm max). If you seek for a long cable solution, you must consider a complex circuit.

Hope it helps
Cheers
Biggest fault of Netduino? It runs by electricity.

#9 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 06 March 2012 - 07:02 AM

Mososky, it seems to me that the sensor is using the 1-wire protocol, not the USART one.

DHTxx sensor uses proprietary 'Single wire' protocol, not to be confused with Maxim/Dallas 1-Wire. DHTxx has different timing, does not support multidrop because it does not have identifier etc. It does not require USART, the communication can happen over any general IO pin, as Mario suggested you can use multiplexer to address multiple devices. The driver for DHTxx is available in DHT11/22 sensor managed driver topic.

However, DHTxx has limited resolution and rather low accuracy, so you might want to consider a different sensor - I like for example DS18B20 1-Wire thermometer. It is more expensive, but calibrated, 12 bit resolution, ±0.5°C accuracy and you can have multiple devices on one 'wire' (pin), in parasite power mode it requires only data and ground lines.

#10 mososky

mososky

    New Member

  • Members
  • Pip
  • 4 posts

Posted 09 March 2012 - 09:29 PM

Thanks for the explainations. I had setup a netduino using a UART port that sent output to a seven seg display. I assumed most of the sensors would operate under such a protocol. Not clear if serial communications can take place over the other digital pins. So when you say 'one wire protocal' it's not clear if you mean it simply needs a single wire, like my 7 seg display did but still UART, or that it does not require UART and can run off any pin on Netduino. Thanks Mario for introducing me to multiplexing. This seems like a good design solution to have a great number of serial devices.




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.