Analyzing UART signals

Updated on 23 September 2022
dev board Arduino UNO
tool Saleae Logic Analyzer
This tutorial is more than 1 year old. If the steps below do not work, then please check the latest versions and the documentations of the individual tools used.

Code

Download code logic-analyzer-uart.ino
void setup() {
  Serial.begin(9600);
  delay(1000);
}

void loop() {
  Serial.println("hello");
  delay(2000);
}

Makefile

BOARD?=arduino:avr:uno
PORT?=/dev/cu.usbmodem14*

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright *.ino

all:
	arduino-cli compile --fqbn $(BOARD) ./

flash:
	arduino-cli upload -p $(PORT) --fqbn $(BOARD) ./

clean:
	rm -f .*.hex
	rm -f .*.elf

Schematic

Wire up the hardware accordingly

Analyzing UART signals schematic

Description

View the decoded asynchronous serial signal from the graph produced by Saleae.

Capture the signal in Saleae:

Add asynchronous serial to decode the captured signal:

References

Watch