Community

Serial Port Clarification

I have a motor controller interface board I’m looking to use with the Meadow board. The basic SerialPort() in .NET is how I’m reading and writing to the port:

    // instance the serial port and open it
    _serialPort = new SerialPort()
    {
        PortName = _serialPortName,
        BaudRate = SERIALPORT_BAUD_RATE,
        Parity = Parity.None,
        DataBits = 8,
        StopBits = StopBits.One,
        WriteTimeout = 500
    };

    try
    {
        _serialPort.Open();
    }
    catch (Exception ex)
    {
        _serialPortStatus = SerialPortStatus.ERROR;
        return;
    }

I’m using the FTDI TTL-232R-3V3-WE USB-to-TTL Serial Cable currently for dev from my VS2019 PC.
In reading the I/O docs on the Meadow Board, there’s a fairly ominous warning:
Attempting to interface an RS-232 voltage level with a TTL level microcontroller will usually lead to the quick destruction of that port on the microcontroller, or even the entire microcontroller.
I am thinking that my motor controller should be able to connect directly to the Meadow board, as it too is 3.3v, but I wanted to be sure so as not to blow anything up.
I should be okay, yes?

If I have read this right, you have a 3.3V FTDI cable connected to the PC and motor controller board and everything is working fine on the PC. Assuming this is the case you should be good to use Meadow to connect to the motor controller.

Do you have a link to the motor controller board that you are using? We should be able to double check against the specification of the board.

The warning relates to the differences between RS232 and TTL serial ports. TTL serial ports use 0v for 0 and Vcc of the board for 1 (typically). RS232 can use a wide range of voltages allowing for data to be transmitted over a greater range and in electrically noisy environments.

Regards,
Mark

Perfect, thanks! The motor controller is my own hardware, which is intended to drive an isolated 0v - 4v output for speed and direction control. My intention is to power that hardware off of the 3.3v pin of Meadow, and talk to it over the COM4 channel. I thought I was in good shape, but wanted to make sure I didn’t miss something based on that warning (I get it now, I’m an old, OLD RS-232 guy from the '70’s, so +/-12v was the jam. That obviously won’t play in 3.3v land). Sounds like I’m in good shape, thanks!

Are you intending to drive the motor off of the 3.3V pin as well ?

Yes, the warning is there for the +/-12V scenario. If your hardware is strictly 0-3.3V on the serial output then you should be good.

Regards,
Mark