Hi, I'm using R4 Minima. I know that the board has two explicit serial (UART) interfaces, USB-C and Pin0-1. However, in the data sheet of the RA4M1, the MCU has 4 x SCI.
If I could connect wires to the unused pads (it is not easy, but possible), can I get additional UART?
For example, P401(TXD1) and P402(RXD1) seem to be available.
How can I handle the UART by the software side?
Thank you very much.
The thread includes many useful information.
I would like to make another serial (UART) interface with only user code. That is, I'm looking to find a way not to touch Arduino core.
I made an Arduino clone and connect P401 and P402.
I wrote this example
#include "Serial.h"
UART _UARTw_(BSP_IO_PORT_04_PIN_01, BSP_IO_PORT_04_PIN_02);
void setup() {
Serial.begin(9600);
_UARTw_.begin(115200);
Serial.println("UART is ready.");
}
void loop() {
if (_UARTw_.available()) {
int incomingByte = _UARTw_.read();
Serial.print("UART received: ");
Serial.println(incomingByte);
}
if (Serial.available()) {
int outgoingByte = Serial.read();
_UARTw_.write(outgoingByte);
Serial.print("Sent: ");
Serial.println(outgoingByte);
}
}
However, I couldn't see the receiving message on the UART.
Should I write something else?
Thank you very much, @Delta_G . As a conclusion, there is no way to make new Serial instance with unused pins in user code without edit of Arduino core. Thank you again.