Hi
I am trying to use UART1 (IO9=U1RXD, IO10=U1TXD) on ESP32-PICO-D4. It is stated on the datasheet that only IO16,17, CMD, CLK, SD0, and SD1 cannot are used for embedded flash so I thought IO9 and IO10 would be "OK" for UART1.
When I try to use SoftwareSerial on IO9 and IO10, these pins do not perform as UART but the other pins (e.g. IO23=UnRXD, IO18=UnTXD) work perfectly.
Can I actually use IO9, 10 as UART1 on ESP32-PICO-D4?
John
Using IO10, IO9 for UART1 on ESP32-PICO-D4
Re: Using IO10, IO9 for UART1 on ESP32-PICO-D4
Correction.
After a careful wiring, I can assure that SoftwareSerial and HardwareSerial work for IO9 and IO10.
Listing below shows the code:
The same code works with too.
Thank you.
John
After a careful wiring, I can assure that SoftwareSerial and HardwareSerial work for IO9 and IO10.
Listing below shows the code:
Code: Select all
#include <HardwareSerial.h>
const byte rxPin = 9; //IO18 working too
const byte txPin = 10; //IO23 working too
void onReceiveCallback(void);
int counter = 0;
void setup() {
// put your setup code here, to run once:
Serial1.begin(57600, SERIAL_8N1, rxPin, txPin);
delay(500);
Serial1.onReceive(onReceiveCallback);
}
void loop() {
// put your main code here, to run repeatedly:
Serial1.print("HardwareSerial Hello counter : "); Serial1.println(counter++, DEC);
delay(1000);
}
///callback fcn on UART receive
void onReceiveCallback(void)
{
Serial1.println("Hardware UART callback fcn ok!");
}
Code: Select all
#include <SoftwareSerial.h>
Thank you.
John
Who is online
Users browsing this forum: Baidu [Spider] and 90 guests