2020-11-09T00:00:00Z
I was doing a short program to understand de UART transmission. For it, I am using COM2 Port connected to an FTDI basic allowing connection to a USB (Windows 10). I am using Hyperterminal to receive serial information.
This is the code I am using in Visual Studio 2015.
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.IO.Ports;
using System.Text;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
namespace UARTtrms
{
public class Program
{
static SerialPort transmitter = new SerialPort(“COM2”, 9600, Parity.None, 8, StopBits.One);
public static void Main()
{
transmitter.Open();
int count = 0;
string msg = count.ToString();
while(count < 35)
{
transmitter.Write(Encoding.UTF8.GetBytes(msg), 0, msg.Length);
msg = (++count).ToString();
Thread.Sleep(2000);
}
}
}
}
My question is: Why only two sequences of numbers are transmitted? In a logic way should be sent 35 sequences.