I have an interesting problem: For a project, I need to use 5 UART ports and ethernet (for mqtt). On a custom pcb I wired my serial connections like this:
UART2_RX: PD_6
UART2_TX: PD_5
UART4_RX: PC_11
UART4_TX: PC_10
UART5_RX: PD_2
UART5_TX: PC_12
UART6_RX: PG_9
UART6_TX: PG_14
UART7_RX: PE_7
UART7_TX: PE_8
Using this very basic code, the port on (PG9, PG14) works:
Code: Select all
#include <DFRobotDFPlayerMini.h>
HardwareSerial Serial1(PG9,PG14);
DFRobotDFPlayerMini mp3Player1;
void setup() {
Serial1.begin(9600);
delay(500);
mp3Player1.begin(Serial1);
delay(500);
mp3Player1.play(1);
}
void loop() {
}
Code: Select all
#include <DFRobotDFPlayerMini.h>
#include <LwIP.h>
#include <STM32Ethernet.h>
HardwareSerial Serial1(PG9,PG14);
DFRobotDFPlayerMini mp3Player1;
byte mac[] = {0xDA,0x30,0xDE,0xEE,0xDE,0xEC};
IPAddress ip(192, 168, 178, 177);
IPAddress gateway(192,168,178,1);
IPAddress subnet(255,255,255,0);
EthernetClient ethClient;
void setup() {
Ethernet.begin(mac, ip);
delay(500);
Serial1.begin(9600);
delay(500);
mp3Player1.begin(Serial1);
delay(500);
mp3Player1.play(1);
}
void loop() {
}