Serial Won't Start After Serial.end()
Posted: Sat Mar 23, 2019 11:00 pm
I wrote program to begin serial 1, send a byte then disable serial1 and loop. If Serial1.end() is called then the TX pin will not function properly. The first time loop() runs it send the byte then stays low for about 600 microseconds and stays high after that. The TX channel stops toggling after that.
The reason I need to call Serial1.end() is because my TX pin is multiplexed and I need to use it as a general IO later.
I tried using Serial1.flush() before and after end(), but it doesn't help.
Using the ESP32 Pico with 1.0.2-rc1 version in Arduino.
Cheers
The reason I need to call Serial1.end() is because my TX pin is multiplexed and I need to use it as a general IO later.
I tried using Serial1.flush() before and after end(), but it doesn't help.
Code: Select all
#include "HardwareSerial.h"
uint8_t a= 10;
void setup() {
}
void loop() {
Serial1.begin(250000);
Serial1.write(a);
Serial1.end();
//MAKE PIN 10 GENERAL IO AND DO SOMETHING WITH digitalWrite(10,LOW) or digitalWrite(10,HIGH) HERE
delay(100);
}
Cheers