Serial port communication with Intel Edison

When we have a manual robot, we need to control it. So, to control it we need some mode of communication. This is attained by using serial port communication. In Intel Edison, we have three serial ports; let's call it Serialx, where x stands for 1 or 2. These serial ports can be accessed by the Arduino IDE:

  •  Serial:
    • Name: Multi-gadget, firmware programming, serial console, or OTG port
    • Location: USB-micro connector near the center of the Arduino breakout board
    • ArduinoSWname: Serial
    • Linuxname: /dev/ttyGS0

This port allows us to program Intel Edison and is also the default port for the Arduino IDE. In the Arduino breakout board, this is activated when the toggle switch or SW1 is towards the OTG port and away from the USB slot.

  • Serial1:
    • Name: UART1, the general-purpose TTL-level port (Arduino shield compatibility)
    • Location: Pins 0 (RX) and 1 (TX) on the Arduino shield interface headers.
    • ArduinoSWname: Serial1
    • Linuxname: /dev/ttyMFD1

This port is the pin numbers 0 and 1, which are used as Rx and Tx. This port is used for the remote control of Edison over an RF network or any external Bluetooth device.

  •  Serial2:
    • Name: UART2, Linux kernel debug, or debug spew port
    • Location: USB-micro connector near the edge of the Arduino board
    • ArduinoSWname: Serial2
    • Linuxname: /dev/ttyMFD2

This is one of the most useful ports whose communication baud rate is 115200. This is usually the port that is accessed through the PuTTY console and is used to isolate boot problems. When the Serial2 object is created and initialized with Serial2.begin(), the kernel's access to the port is removed and the Arduino sketch is given control until Serial2.end() is invoked.

  • Virtual ports:
    • Name: VCP or virtual communications port (appears only when the Serial-over-USB device is connected)
    • Location: Big type A USB port nearest the Arduino power connector
    • ArduinoSWname: Not supported by default
    • Linuxname: /dev/ttyACMx or /dev/ttyUSBx

This is the USB port of your Intel Edison's Arduino breakout board. The switch must be towards the USB port for enabling the device. Multiple USB devices can be connected using a USB hub.

Consider the following example of code:

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.println("Hi, Reporting in from Intel Edison");
delay(500);
}

This will just print Hi, Reporting in from Intel Edison in the serial monitor. From the code, it's evident that Serial has been used, which is the default one.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.76.237