Questions tagged [uart]

A UART is a Universal Asynchronous Receiver/Transmitter. This refers to the "hardware" serial port in the processor. Use this tag for questions about hardware serial.

Most Arduinos have one or more UART ports. The smaller Arduinos (such as the Uno) have one UART port. Larger Arduinos (such as the Mega2560) have multiple UART ports.

The UART takes a serial stream of bits and assembles it into a byte, effectively turning serial data into parallel data (and vice-versa for sending). Generally speaking the Arduino UARTs are used for implementing the HardwareSerial class, of which an instance called Serial (and possibly Serial1, Serial2, etc.) is available on many boards.

The UART has a send and receive buffer, so it can be sending and receiving simultaneously, while the main program code can be doing something else.

The UART can generate interrupts if desired, for events like:

  • Transmit buffer empty (so more data can be sent)
  • Receive buffer filled (so the last-received byte can be retrieved)

Some of the smaller chips (such as the ATtiny85) have a USI (Universal Serial Interface) instead of a UART.

Related tags:

Also see UART: Wikipedia

249 questions
14
votes
1 answer

What's the difference between all the Software Serial Libraries? Which one is Arduino Nano compatible?

There are so many Software Serial Libraries, what are the differences between them? And which one I can use with my Arduino Nano? For my Arduino Nano I need one Hardware Serial Port and one Software Serial port at a baud rate of 115200. On which…
William Roy
  • 515
  • 4
  • 10
  • 22
14
votes
1 answer

Mysterious RX pulses on UART connect on OS X Arduino Due

Arduino IDE 1.6.8, Arduino Due, Mac OS 10.11.3 I am seeing eight mysterious pulses on the RX line when I connect to the serial port using multiple client libraries (Python, JavaScript as well as the built-in Serial Monitor in the IDE). About 78-79us…
Blake Ramsdell
  • 241
  • 1
  • 2
11
votes
1 answer

How can I communicate Raspberry Pi and Arduino (in both ways) using a 10-15m distance wires?

I am starting a personal project of home automation and I have a raspberry pi and an arduino Uno board. I want communicate raspberry pi and my arduino where my raspberry should be able to write and read signals to and from arduino. The distance…
thiagoh
  • 211
  • 1
  • 4
7
votes
2 answers

ESP8266 Programming using ESP-01 to USB converter

I am new to ESP8266. To ease out the task of programming esp8266, I bought this: ESP-01 ESP8266 Programmer CH340G Chip USB WiFi Wireless UART GPIO0 Adapter. Configured Arduino Interface to run AT commands in the serial monitor. I flashed ESP8266…
Arjun Sunil Kumar
  • 209
  • 1
  • 4
  • 12
6
votes
2 answers

When it comes to UART to RS485 communication, what is the difference between the 'MAX485' and the 'HW-0519' module?

I recently found this model with the ID 'HW-0519' on it. It can be found online (HW-0519 in Aliexpress) and is sold for the purpose of converting UART to RS485 communication using Arduino devices. The MAX485 module (MAX485 in Banggood) is the more…
C Vith
  • 133
  • 1
  • 7
6
votes
3 answers

Arduino Hardware serial library with rts/cts flow control support

Does there exist (any user developed etc.) version of the Hardware UART serial library that has support for RTS/CTS based flow control? More interested in the Tx side (Arduino sends data, while the peripheral can back-pressure). The library should…
O.K.
  • 209
  • 1
  • 2
  • 8
6
votes
3 answers

Super slow serial (UART) communication on Arduino

I am using this device for my Arduino that connects to the OBD-II port of my car to get various information such as speed, rpm, etc. I am using this for a digital Nixie tube speedometer using the smart Nixie tube from a Kickstarter project. I pass…
evan.stoddard
  • 183
  • 1
  • 6
5
votes
1 answer

How to work with non-traditional UART baud rates

I am trying, unsuccessfully to communicate, using my Arduino Nano, with a custom device at a baud rate of 800 kbit/s. The Arduino code look like this: void setup() { // Put your setup code here, to run once: Serial.begin(800000); } void loop()…
user28282
  • 55
  • 1
  • 5
4
votes
4 answers

Bi-directional UART communication on single data wire, possible?

The nano is inside of the house, and the pro mini is outside of the house. I want to send/receive text between them. The communication will be always nano sending text to mini, and then mini sending text to pro in response. There will be no case…
Damn Vegetables
  • 357
  • 1
  • 3
  • 9
4
votes
2 answers

Is it possible to extract a hex file via UART from an Arduino?

Right now I am tinkering on my 3D printer that has an Arduino mega as a brain. I need to update the Marlin firmware but in case of an error I want to create an backup of the firmware. And because it is assembled using a shield on top have no access…
Coder_fox
  • 686
  • 7
  • 14
4
votes
1 answer

Code to use an Arduino Mega 2560 to transfer UART <-> USB to debug an other Microcontroller

I have the following circuit and want to use the Arduino Mega 2560 as an debugger for an other Microcontroller. So I am looking for the code to redirect the UART input from "P17 (RX2)" to the serial USB and the data coming from the serial USB to…
kimliv
  • 561
  • 1
  • 4
  • 17
4
votes
1 answer

Can Arduino Leonardo use USB port and RX TX serial pins at the same time?

Can I use the TX/RX on pins 0, 1 (to a serial slave device) while also having the USB port dedicated PC communication?
101
  • 215
  • 3
  • 11
4
votes
1 answer

What USB to UART chip provides highest data rates with Arduino boards?

Checking out online stores for a USB/TTL adapter, I came across a wide range of products, and I'm having a hard time selecting the one which would achieve the highest data rate. I was comparing datasheets of the chips I have seen so far, to…
Dmitry Grigoryev
  • 1,288
  • 11
  • 31
4
votes
1 answer

I2C to UART bridge as breakout or in DIP package

For a project, I need to connect more than one device to an Arduino through a serial port with hardware flow control (RTS/CTS). Sparkfun used to make breakout boards for the SC16IS750, but this product is discontinued and I can't find any place to…
jarnbjo
  • 328
  • 3
  • 10
3
votes
1 answer

ESP send string to Arduino

I'm trying to send a string from an ESP32 to an Arduino. I'm using a level shifter, where the Uno is now the Mega (since I couldn't get the Uno to work). RX0 is now RX1, connected to UART2 of ESP32. // Master sender ESP32 #include…
Adamelli
  • 93
  • 9
1
2 3
16 17