Closed
Description
Description:
Serial.end()
should free the serial pins and leave the user the ability to do digitalWrite()
on them, but it doesn't work. Instead to drive the TX pin to a LOW state i need to reset the board.
I tested the code below with the following cores:
- last stable release from platformio
- master branch
- master + HardwareSerial bugfix & improvement #3713
I also made three logic analyzer captures: la.zip
An example from one of these, as you can see it shows that the pin is driven low only once (after upload of the code or reset)
Sketch:
#include <Arduino.h>
HardwareSerial ser(2);
#define TX_PIN 17
void setup(){}
void loop()
{
pinMode(TX_PIN, OUTPUT);
delay(10);
digitalWrite(TX_PIN, HIGH);
delay(50);
digitalWrite(TX_PIN, LOW);
delay(300);
digitalWrite(TX_PIN, HIGH);
delay(50);
ser.begin(9600);
delay(10);
for (uint8_t n = 1; n < 5; n++)
{
ser.write(n);
delay(10);
}
ser.end();
delay(300);
}
NOTE: looks like that the problem was here before #3713 and #3664