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

cannot Read from TTL COM1, though WRITE works


  • Please log in to reply
2 replies to this topic

#1 luan007

luan007

    New Member

  • Members
  • Pip
  • 4 posts

Posted 25 January 2012 - 03:38 AM

Hi,

I got my netduino minis for about a week and I'm having a hard time on getting this simple program working,
it works on Netduino Plus..

The 'WriteByte(x)' is working but not 'ReadByte', and I'm pretty sure about wiring RX/TX, and my USB-TTL board has
no problem (can connect with Netduino Plus using the same code)

my mini: 4.2, debug/deploy via TTL


public static void Main()
{
            SerialPort sp = new SerialPort(SecretLabs.NETMF.Hardware.NetduinoMini.SerialPorts.COM1, 9600);
            sp.Open();
            while (true)
            {
                if (sp.BytesToRead > 0)
                {
                        sp.WriteByte((byte)sp.ReadByte());
                }
            }
}


Any reply would be helpful,

Thank you!

Mike Luan

#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 25 January 2012 - 06:58 AM

my mini: 4.2, debug/deploy via TTL

Mike,

Which COM port (on the Mini)are you using for deployment from Visual Studio? By default the Mini comes with an application deployed which allows you to select the COM port used for deployment and debugging. Have you used this to set the deployment COM port? If so, which port did you set this to?

If you selected COM1 for deployment then (if memory serves) you will not be able to use this for serial comms as well. You will have to use COM2.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 luan007

luan007

    New Member

  • Members
  • Pip
  • 4 posts

Posted 25 January 2012 - 07:26 AM

Mike,

Which COM port (on the Mini)are you using for deployment from Visual Studio? By default the Mini comes with an application deployed which allows you to select the COM port used for deployment and debugging. Have you used this to set the deployment COM port? If so, which port did you set this to?

If you selected COM1 for deployment then (if memory serves) you will not be able to use this for serial comms as well. You will have to use COM2.

Regards,
Mark



Thanks Mark! Your reply is REALLY clear and helpful! Then I'm going to use RS232 for debugging instead (I was using COM1 before and that's the problem)

But I can still sending out data using COM1 EVEN IF i set it as debugging port, I thought it's still possible to use
it when disconnected from PC, but I don't know if it can be tuned in that way..


Regards

Mike




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.