主要内容

Serial Tx and Rx Pins

Transmitter and receiver Arduino pins for serial communication

Since R2023a

Model Configuration Pane: Hardware Implementation / Hardware board settings / Target hardware resources / Serial port properties

Description

Set the serial port transmitter and receiver pin numbers of your Arduino® board.

For every serial port, you can individually configure the baud rate and data frame configuration. However, not all Arduino boards support all serial ports. This table lists the serial ports supported by different Arduino boards. Set the Hardware board parameter in the Configuration Parameters dialog box to any one of these boards to enable the serial port.

Arduino BoardsSupported Serial Ports
Arduino Due, Arduino Mega 2560, Arduino Mega ADKSerial ports 0, 1, 2, and 3
Arduino Leonardo, Arduino MKR WiFi 1010, Arduino MKR 1000, Arduino MKR Zero, Arduino Micro, Arduino Nano 33 BLE Sense, Arduino Nano 33 IoT, Arduino Nano RP2040 Connect, Arduino Robot Control Board, Arduino Robot Motor Board, Arduino Uno R4 Minima, Arduino Uno R4 WiFiSerial ports 0 and 1
Arduino Nano 3.0, Arduino UnoSerial port 0
ESP32-WROOM (Arduino Compatible), ESP32-WROVER (Arduino Compatible), Raspberry Pi® Pico (Arduino Compatible), Raspberry Pi Pico W (Arduino Compatible)Serial ports 0, 1, and 2
Teensy 4.0 (Arduino Compatible), Teensy 4.1 (Arduino Compatible)Serial ports 0, 1, 2, 3, 4, 5, 6, 7, and 8

Settings

1 | 0–39

This table lists the Arduino boards that support configuring the Tx and Rx pins for ports 0, 1, and 2.

Supported Arduino BoardsSerial Port 0Serial Port 1Serial Port 2
 Tx PinsRx PinsTx PinsRx PinsTx PinsRx Pins
ESP32-WROOM (Arduino Compatible), ESP32-WROVER (Arduino Compatible)1 (default), 0, 2-5, 12-19, 21-23, 25-27, 32-36, 393 (default), 0-2, 4-5, 12-19, 21-23, 25-27, 32-36, 3933 (default), 0-5, 12-19, 21-23, 25-27, 32, 33, 34-36, 3932 (default), 0-5, 12-19, 21-23, 25-27, 33-36, 3917 (default), 0-5, 12-16, 19, 21-23, 25-27, 32-36, 3916 (default), 0-5, 12-15, 17, 19, 21-23, 25-27, 32-36, 39
Raspberry Pi Pico (Arduino Compatible), Raspberry Pi Pico W (Arduino Compatible)USBUSB0 (default), 12, 161 (default), 13, 178 (default), 49 (default), 5

Programmatic Use

No programmatic use is available.

Version History

Introduced in R2023a