What I've been describing IS in the Arduino IDE. Once you install either the Arduino "MBed OS rp2040" or the Philhower core.
how do I set up the UARTS and serial port in the Arduino IDE as I do with standard Arduino devices
The same way, possibly with the addition of that UART statement, if you're using the Arduino Mbed core type.
Here; this demo sketch works with either core. Tested, and everything!
/*
* Demonstration of using multiple Serial Ports on RPi Pico board.
* By default when using the Arduino Cores:
* Serial is a virtual Serial port operating over the USB
* Serial1 is tied to UART0 on pins 1 and 2
* Serial2 may need creating, and is UART1 on pins 8&9
*/
#ifdef ARDUINO_ARCH_MBED_RP2040
// For the Arduino MBedOS Core, we must create Serial2
UART Serial2(8, 9, NC, NC);
#else
// For the Earl Philhower core ( https://github.com/earlephilhower )
// Serial2 is already defined.
#endif
void setup() {
Serial.begin(9600);
Serial1.begin(115200);
Serial2.begin(115200);
while (!Serial)
; // Serial is via USB; wait for enumeration
}
void loop() {
Serial.println("This is port \"Serial\"");
Serial1.println("1111111111111\r\nThis is port \"Serial1\"");
Serial2.println("2222222222222\r\nThis is port \"Serial2\"");
if (Serial1.read() > 0) { // read and discard data from UART0
Serial.println("Input detected on UART0");
}
if (Serial2.read() > 0) { // read and discard data from UART1
Serial.println("Input on UART1");
}
delay(2000);
}