Skip to content

Latest commit

 

History

History

serial_to_serial

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Communication between 2 UART interfaces

This example demonstrates how 2 UART interfaces can communicate in a bi-directionnal way.

You need at least 2 UART interfaces on your board to test it :

  • UART0: connected to a PC USB port (serial debug interface).
  • UART1: can be connected to any type of serial device (Bluetooth, Serial to USB, etc).

Both UARTs are initialized using a baudrate of 9600.

3 concepts of RIOT are illustrated here:

Hardware setup

This application has been tested with a bluetooth 42N based board from Sparkfun. It also works with a HC-05 bluetooth module but requires the pins to be adapted.

  • Arduino Due

  • Arduino Mega

  • Samr21-xpro : use EXT1 pins. RX pin is PA23 and TX is PA22. (Note that RX of BT module goes to TX pin on the board, and vice versa)
  • mbed_lpc1768 : RX pin is n°9 and TX is n°10. (Note that RX of BT module goes to TX pin on the board, and vice versa)

Using this application

  1. Ensure you followed the prerequisites first
  2. Follow the setup displayed above and plug the board to an USB port of your computer
  3. Build and flash:
$ cd ~/work/i2c_temperature
$ make RIOTBASE=~/work/RIOT BOARD=arduino-due flash
  1. Start a serial terminal application on your PC (assuming the board is visible on /dev/ttyACM0)
$ gtkterm -p /dev/ttyACM0 -s 9600 -b 8 -e
  1. Now you can communicate to the other serial Bluetooth interface (using rfcomm on Linux or
  2. bluetooth terminal application on an Android phone)
  3. You can also skip the bluetooth setup hell by using an USB to serial board between the PC and the second UART interface.