- Wed Nov 23, 2016 7:30 am
#58559
Actually I am using this Serial.swap() for "clean UART". But found problem:
Problem DescriptionThis is the original post where this thing started. I want to use Serial.swap() and send-receive my application data on D15-D13 after boot-up in binary form. But after Serial.swap(), it can not send 0x00 data on UART. I have tried two sketches, which involves cases of not using and using of "Serial.swap()". I tried to send 0x00 0x01 0x02 in loop in both cases. I am using Serial.swap() after having the need of connecting other MCU on UART with ESP. I have searched this
page and this
thread. which suggest me that actually I can use this Serial.swap() which will avoid the startup dump and programming problem with UART0 and use this out of box UART0 for data communication.
HardwareHardware: ESP-12E
Core Version: 2.3.0
Settings in IDEModule: Generic ESP8266 Module (ESP-12E)
Flash Size: 4MB/1MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 80Mhz
Upload Using: SERIAL
Reset Method: nodemcu
System SetupI am using ESP-12E, a separate power supply and programing it with Serial to TTL in Arduino Eclipse Plug-in called
Sloeber. I am using
terminal.exe as my Serial Monitor. I have connected second Serial To TTL on D15-D13, for Serial.swap() UART.
Codes and Outputs are as follows:
Sketch 1 (successful)Code: Select all//The setup function is called once at startup of the sketch
void setup()
{
Serial.begin(115200);
}
// The loop function is called in an endless loop
void loop()
{
for(uint8_t i=0;i<3;i++)
{
Serial.write(i);
delay(1000);
}
}
Output at terminal.exe in HEX modeCode: Select all00 01 02 00 01 02 00 01 02 00 01 02
Sketch 2 (problem)Code: Select all//The setup function is called once at startup of the sketch
void setup()
{
Serial.begin(115200);
// Swap serial port to continue on other uart.
Serial.swap();
}
// The loop function is called in an endless loop
void loop()
{
for(uint8_t i=0;i<3;i++)
{
Serial.write(i);
delay(1000);
}
}
Output 2 in terminal.exe in Hex modeThe problem is when I use Serial.swap() it does not send the 0x00 data on UART. Am I missing something?
Original thread is
hereI have also tired Software Serial, but with the same problem and result. Original discussion I have posted
here.
I have also raised the issue with
github.
Please have a look and help.