(Hookup)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
[[category:Explore M3]]
 
In this tutorial, we will look at the hardware serial ports of the Explore M3. Having four hardware serial ports is awesome isn't it? Now you can connect all of your GPS, GSM, Bluetooth, WiFi and what not, without using soft serial ports.  
 
In this tutorial, we will look at the hardware serial ports of the Explore M3. Having four hardware serial ports is awesome isn't it? Now you can connect all of your GPS, GSM, Bluetooth, WiFi and what not, without using soft serial ports.  
  
Line 5: Line 6:
 
Alright, so lets get started. I will do a simple test example now to print serial port messages and sometime later will will connect multiple serial devices.
 
Alright, so lets get started. I will do a simple test example now to print serial port messages and sometime later will will connect multiple serial devices.
 
=Hookup=
 
=Hookup=
Simply plug in the USB cable to test the virtual com port and USB to serial converter to other serial ports.
+
Simply plug in the USB cable to test the virtual com port and USB to serial converter to other serial ports. Note that transmit(Tx) should be connected to Receive(Rx) of the USB to serial converter and Rx to Tx. 
  
 
{| class="table table-striped table-hover table-condensed table-bordered"
 
{| class="table table-striped table-hover table-condensed table-bordered"

Latest revision as of 15:35, 24 May 2016

In this tutorial, we will look at the hardware serial ports of the Explore M3. Having four hardware serial ports is awesome isn't it? Now you can connect all of your GPS, GSM, Bluetooth, WiFi and what not, without using soft serial ports.

In fact Explore M3 has additional Virtual Serial COM port. The USB port not only is used to upgrade firmware but also it double up has virtual com port. That means you can send messages to the computer without additional USB to Serial chip like the CP2102 or FTDI. 0 UART main.gif Alright, so lets get started. I will do a simple test example now to print serial port messages and sometime later will will connect multiple serial devices.

Hookup

Simply plug in the USB cable to test the virtual com port and USB to serial converter to other serial ports. Note that transmit(Tx) should be connected to Receive(Rx) of the USB to serial converter and Rx to Tx.

Serial Port UART Channel Explore M3 Pin
COM 0 RX0 0
TX0 1
COM 1 RX1 6
TX1 7
COM 2 RX2 4
TX2 5
COM 3 RX3 2
TX3 3
USB Serial Plug in the USB cable

Code

//Example to test all serial ports at once.
//Explore M3 has 4 hardware serial ports and 1 USB serial.
//Serial --refers to USB Serial
//Serial0, Serial1, Serial2 and Serial3 refer to the hardware serial ports.
// Refer the pinout diagram for more details
//This example prints a string on all the serial ports, 
//you need to connect a USB to serial convertor to check messages on hardware serial ports.
 
void setup() {
  Serial.begin(9600);// refers to USB Serial, the baud rate actually has no meaning.
  Serial0.begin(9600);
  Serial1.begin(9600);
  Serial2.begin(9600);
  Serial3.begin(9600);
}
 
void loop() {
  Serial.println("Message printed on USB Serial");
  Serial0.println("Serial communcation with Serial 0");
  Serial1.println("Serial communcation with Serial 1");
  Serial2.println("Serial communcation with Serial 2");
  Serial3.println("Serial communcation with Serial 3");
}

Going further

Now, that we are happy with serial communication with Arduino. I would recommend you to dig deeper especially if you're building a product around the chip with these bare metal tutorial.

  1. Bare metal serial communication with Explore M3