15 - Comunicacións serial na era do USB

Volver ao curso

Prepara a RBM33G porque che vai facer falta.

USB host and devices
USB host and devices

A USB host is the machine that controls the connection and provides power (like a computer or smartphone). A USB device is what connects to the host to send or receive data (like a keyboard, flash drive, or printer).

What is a serial connection

A serial connection is a method of sending data between two devices, one bit at a time, through a single wire. It uses a TX pin to send data and an RX pin to receive data.

The speed of the connection is measured in bps, or bits per second (9800 bps, 115200 bps… way slower than typical USB).

Geoffrey M. Brown
Geoffrey M. Brown

Data is transmitted in binary, meaning it is sent as a series of “1s” and “0s”. To represent text or symbols, devices often use ASCII, which is a standard way of converting letters and characters into binary.

7 bit ASCII. If you need “accent marks” (á, é, í, ó, ú) or “ñ”, there is the 8 bit Extended ASCII
7 bit ASCII. If you need “accent marks” (á, é, í, ó, ú) or “ñ”, there is the 8 bit Extended ASCII

This type of connection is simple and widely used in electronics and communication. It is WAY OLDER than USB.

Some USB peripherals, like microcontrollers and 3D printers, use simple serial connections over USB. This is known as a “virtual COM port.”

There is a clear equivalence: DTE functions as the USB host, while the DCE acts as the USB device.
There is a clear equivalence: DTE functions as the USB host, while the DCE acts as the USB device.

Las conexiones serial se consideran off-line, pero suponen igualmente un problema de ciberseguridad.

Tipos de portos serie:

Parámetros:

Diferencias entre varios sistemas:

Chip convertidor RS232 a TTL/UART/FTDI: MAX3232

Typical connection diagram

Create the G-CODE in a PC, send it to the printer on-the-fly. The PC must remain connected during the printing process:

Create the G-CODE in a PC, copy it to a flash drive, connect the flash drive to the printer:

Portos serie na Raspberry Pi

Raspberry Pi Zero. Porto serial TTL
Raspberry Pi Zero. Porto serial TTL

Podes:

Portos serie nun PC calquera

O máis probable é que non traia ningún (aparte do USB, ou que teña un RS-232 en conector DB-9

Distingues entre protocolo e conector? RS-232, dupont, USB, RJ-45…?

Convertedor USB a RS232
Convertedor USB a RS232
Convertedor RS-232 a serial TTL
Convertedor RS-232 a serial TTL

Portos serie nun router

Serial en RJ-45. Por que????? Pois non, non é ethernet, é RS-232

Cable serial RS-232 (conector DB9) a serial RS232 (conector RJ45)
Cable serial RS-232 (conector DB9) a serial RS232 (conector RJ45)

Portos serie en MCU (Microcontroladores)

Modem 4G IoT con conexión serial TTL
Modem 4G IoT con conexión serial TTL
Conexión entre ESP32 (TTL) e modem IoT (TTL) mediante unión directa
Conexión entre ESP32 (TTL) e modem IoT (TTL) mediante unión directa

Portos serie nas controladoras de voo Pixhawk

Contan con ata 5 portos TTL/UART en conectores USB e JST (dupont).

No utilizan ASCII (texto plano), senón que usan un linguaxe propio coñecido como MAVLINK.

Busca “Tx” e “Rx”. Verás que se usa UART para moitas cousas, incluida a comunicación co GPS externo.
Busca “Tx” e “Rx”. Verás que se usa UART para moitas cousas, incluida a comunicación co GPS externo.

A comunicación se fai entre a emisora e o dron. Como non pode haber cable, úsase unha parella de radios de telemetría:

Ambos nodos son intercambiables e contan con TTL e USB
Ambos nodos son intercambiables e contan con TTL e USB

Deste xeito, calquera equipo con porto serie pode ser un mando de dron: unha tablet Android, un PC con gamepad…

Control por tablet a través de radio de telemetría
Control por tablet a través de radio de telemetría

Portos serie na RBM33G

Tes dous portos serial:

Modos:

Esta placa é moi útil para deixala “plantada” en dispositivos que perdan a conectividade con facilidade.

Adaptadores de TTL/UART a RS232

O chip MAX3232 permite converter entre estes dous sistemas:

Sniffer serial

Este xoguete se intercala entre host e device para escoitar o que falan entre eles:

S485 RS422 RS232 TTL puerto serie ostener escucha monitoreo grabadora (“ISOLATION”)

https://es.aliexpress.com/item/1005005100289999.html

Apps

Prácticas

Pregunta ao profesor cal debes facer:


Volver ao curso