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

Can't get com1 uart to work on Mini


  • Please log in to reply
1 reply to this topic

#1 Nissim

Nissim

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationNew Zealand

Posted 18 September 2011 - 07:06 AM

Hi There I used application MFDeploy.exe to erase Mini and I reloaded ER_Config and ER_Flash COM 2 RS232 is functioning as expected but I get no data from COM1 Do I need to upload any file to get it to work? using System; using System.Threading; using System.IO.Ports; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoMini; namespace NetduinoMiniApplication1 { public class Program { public static void Main() { var serialPortGPS = (SerialPort)null; var serialPortCP5200 = (SerialPort)null; Thread.Sleep(1000); byte[] testByte = new byte []{0x65,0x66}; serialPortCP5200 = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One);//" COM2" RS232 Pin 1,2 serialPortGPS = new SerialPort("COM1", 4800, Parity.None, 8, StopBits.One);//" COM1" TTL Pin 11,12 serialPortCP5200.Open(); serialPortGPS.Open(); serialPortCP5200.Write(testByte, 0, 1); // this line is working and i get data from comport // serialPort.Close(); byte[] dataReadFromGPS = new byte []{}; while (true) { var numberOfBytesToRead = serialPortGPS.BytesToRead; if (numberOfBytesToRead > 0) { dataReadFromGPS = new byte[numberOfBytesToRead]; var numberOfBytesRead = serialPortGPS.Read(dataReadFromGPS, 0, numberOfBytesToRead); } serialPortCP5200.Write(dataReadFromGPS, 0, numberOfBytesToRead);// * No data is received on COM 2 !! } } } }

#2 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

Posted 18 September 2011 - 07:38 PM

The mini had two com ports but you need to use one of them to deploy and debug your application. If com 1 is working I assume you're deploying on com 2. Once you're finished debugging it's possible to use both in you're application.




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.