Go Down

Topic: Arduino Leonardo as TTL/Serial (to program ESP8266) (Read 454 times) previous topic - next topic

d3vCr0w

HI everybody, I'm new in this forum and this is my first post, I hope you can help me.

 
After some hours of googling, I haven't been able to find information or documentation on how to use an Arduino Leonardo as TTL / Serial, almost all the information is regarding the UNO and I believe that this is so trivial, that people don't hesitate to do the same thing for the Leonardo, but since I'm a beginner this is not trivial for me and I'm a bit confused.

I'm trying to program an ESP8266 (01) wifi module, I watched some youtube videos, wired everything and after a couple of tries and installing libraries from github I wasn't able to get it working. The basic examples of esp8266 core library seemed to upload successfully but I wasn't able to find anything in the serial monitor, I'm not sure if that code uploaded to the ESP8266 or to the Leonardo itself. I tried changing the baud rate and the other option in the left but nothing worked, i was not getting anything from the serial connection, tried AT command, and no response.

Can somebody explain to me (or even ELI5 if possible) how to setup my Arduino Leonardo as a TTL interface for programming other devices, especially the ESP8266 wifi module, I've seen some people connecting RESET pin to GNDon their UNOs but I'm not sure if that procedure applies for the Leonardo as well.

Thanks for your reply

Robin2

You can't use a Leonardo as USB-TTL in the same way that you can with an Uno or Mega because the Rx and Tx from the PC are not broken out onto accessible pins. On a Leonardo pins 0 and 1 represent Serial1 which is second HardwareSerial port.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

PieterP

You can just send all data from the hardware UART straight to the USB COM and vice versa. You can even use it to program the ESP.

Code: [Select]
void setup() {
  Serial.begin(115200);
  Serial1.begin(115200);
}

void loop() {
  while(Serial.available()){
    Serial1.write(Serial.read());
  }
  while(Serial1.available()){
    Serial.write(Serial1.read());
  }
}


Pieter

Robin2

You can just send all data from the hardware UART straight to the USB COM and vice versa. You can even use it to program the ESP.
Interesting. I was not sure if that would be satisfactory for programming.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up