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 !!
}
}
}
}
Can't get com1 uart to work on Mini
Started by Nissim, Sep 18 2011 07:06 AM
1 reply to this topic
#1
Posted 18 September 2011 - 07:06 AM
#2
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