Serial Communication

In Short:

Compulsory
Part - I Basics of Serial Programming. Hardware Serial Port
  1. View the YouTube video for 32 minutes
  2. 2. Solve the assignment and go home.


Optional (Compulsory for II'nd and III'rd Year students)
Part - II Basics of Software Serial Port. Making my own Serial Transmit function.
Part - III Using the Arduino's Software Serial Library


In Detail:



Once you are done with Part-I proceed further.

Part - II Basics of Software Serial Port. Making my own Serial Transmit function.


If you connect an Oscilloscope (with appropriate configuration) to pin 13 (LED_BUILTIN), what type of output waveform you will notice? With this code:

 // the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(100);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}
 
 
 

  1. Many companies manufactures USB to Serial converter ICs
    Some examples are:
    CH340 from the company WCH
    CP2012 from the company Silicon Labs
    FT232 from the company Fututure Technology Devices International Ltd.

    Just like CH340 is a USB to Serial Converter IC, The FT232 is another IC for the same purpose made by another company.
  2. Download and install FT232R driver from the official web site
    Another Tutorial
    If you have problems with FTDI driver and want to use an older version then scroll down to bottom of this web-page.
  3. Connect GND pin of Arduino to the GND-pin of FT232 USB to Serial module
    FTDI Module
  4. Connect pin 13 of Arduino (acting as Tx) to the RX-pin of FT232 USB to Serial module
  5. Study and execute the code: soft_serial_tx_only.ino
  6. See the output in Terminal.exe
    [Use this old Terminal20100630 version only, it is stable and bug free no scrolling errors]
    8N1 9600 and correct com port settings
    Brays_Terminal





Part - III Using the Arduino's Software Serial Library



Go to https://www.arduino.cc/reference/en/libraries/ and look for SoftwareSerial - for serial communication on any digital pins.

Click on SoftwareSerial and study the reference page.
Try Some example.

FAQ:

Q1 What is 8N1
8 data bits, No parity, 1 stop bit

Q2 What are Serial Monitor or Serial Terminal softwares other than Arduino's inbuild ?
Bray's terminal
Hyper Terminal
minicom for Linux


Q3 What are the various Escape sequences in Serial Terminal ?



Q4 What are the various Colour codes in Serial Terminal ?


Q5 What is loop back testing ?
Connect Tx to Rx
what is send is what you receive



Q6 What is NULL Modem ?



Q7 What is Hand-shaking ?











If you need an older version of the FTDI FT232 driver the click here
Please unzip (extract it before using it)