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 Not Working


  • Please log in to reply
7 replies to this topic

#1 bsilvereagle

bsilvereagle

    Member

  • Members
  • PipPip
  • 11 posts

Posted 13 February 2013 - 02:39 AM

I am trying to get a Netduino Plus 2 to communicate with PuTTy.

 

using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.Netduino;using System.IO.Ports;namespace NetduinoPlusRx{    public class Program    {        static SerialPort port;        public static void Main()        {            // write your code here            port = new SerialPort(SerialPorts.COM2, 115200, Parity.None,8,StopBits.One);            port.Open();            while (true)            {                port.Write(new byte[] { 0x01, 0x02, 0x03 }, 0, 2);                Thread.Sleep(100);            }        }    }}

 

PuTTy isn't picking up anything. I have an FTDI cable with Ground connected to Ground, and Rx/Tx connected to pins 3/2. 

 

Any thoughts/obvious errors?

 



#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 13 February 2013 - 04:30 AM

Did you swap the RXD/TXD in order to flow the data from an output to an input?

Cheers


Biggest fault of Netduino? It runs by electricity.

#3 bsilvereagle

bsilvereagle

    Member

  • Members
  • PipPip
  • 11 posts

Posted 13 February 2013 - 01:38 PM

Yes, I flipped the wires and nothing changed. 



#4 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 13 February 2013 - 05:34 PM

Are you sure putty will display those values as characters?

Mightbe better to try values greater than 0x20 which map to real characters.

Paul



#5 Verdris

Verdris

    Advanced Member

  • Members
  • PipPipPip
  • 128 posts
  • LocationReno, NV

Posted 13 February 2013 - 08:07 PM

Silly suggestion, but last night I kicked rocks with serial communication for about an hour before I realized that the baudrates were different on the Netduino side and the laptop side. Maybe you overlooked this too?



#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 February 2013 - 09:09 PM

Hi bsilvereagle, What voltage does the particular FTDI cable use for signals? Is it a 3.3V cable, 5V cable, or RS232-level cable? Also, is it only COM2 that doesn't work for you? Or did COM1 (pins D0/D1) also not work in your scenario? Finally--are you using digital pins D2/D3 or analog pins A2/A3? Chris

#7 bsilvereagle

bsilvereagle

    Member

  • Members
  • PipPip
  • 11 posts

Posted 14 February 2013 - 04:25 AM

Paul you were absolutely correct, I changed the values to > 0x20 and now it's working, thanks a lot.  

 

Chris - not that it matters but it's the Adafruit FTDI Cable



#8 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 14 February 2013 - 08:36 PM

It was only guess!

Glad your back on track.






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.