Chat here is you are connecting ESP-xx type modules to existing AVR based Arduino

Moderator: igrr

User avatar
By RatTrap85
#84462 I have an ESP12 with an independent 3v3 power supply connected to a 3v3 MoteinoMega board but cannot get the serial communications to work. It behaves as if the baud rate is incorrect. At 74880 I get what appears to be a boot log from the ESP device. Data sheet and AT command manual says that the default Serial communications standard is as follows:

Baud: 115200
Data bits: 8
Stop Bits: 1
Parity: 0
Flow Control: 3

That's all correctly set.

Per the online tutorials I have made the following connections and signal choices.
GPIO0 is pulled HIGH
GPI02 is pulled HIGH
GPIO15 is pulled LOW
RST is pulled HIGH
CH_PD is pulled HIGH

The code I am trying is.
Code: Select all#define CH_PD         12    //  PD4
#define GPIO2         13    //  PD5
#define GPIO15        14    //  PD6
#define GPIO0         15    //  PD7
#define WIFI_RST   16    //  PC0/SCL


uint32_t baudRates[] = {300,1200,2400,4800,9600,19200,38400,57600,74880,115200,230400,250000,500000,1000000};
void setup() {
  pinMode(GPIO2,OUTPUT);
  digitalWrite(GPIO2,HIGH);
  pinMode(GPIO0,OUTPUT);
  digitalWrite(GPIO0,HIGH);
  pinMode(WIFI_RST,OUTPUT);
  digitalWrite(WIFI_RST,HIGH);
  pinMode(GPIO15,OUTPUT);
  digitalWrite(GPIO15,LOW);

  Serial.begin(1000000);
  Serial1.begin(74880);

  delay(1000);
  pinMode(CH_PD,OUTPUT);
  digitalWrite(CH_PD,HIGH);

  Serial.println("Starting");
}

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


My output at a baud rate of 74880 is
Starting

ets Jan 8 2013,rst cause:1, boot mode:(3,7)

load 0x40100000, len 1856, room 16
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
SPI Speed : 40MHz
SPI Mode : DIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000

rf cal sector: 1017
rf[112] : 00
rf[113] : 00
rf[114] : 01

SDK ver: 1.5.4.1(39cb9a32) compiled @ Jul 1 2016 20:04:35
phy ver: 972, pp ver: 10.1

⸮⸮h⸮h⸮ip⸮$x⸮⸮⸮,⸮q(Ѫ8⸮⸮jtN⸮



My output at all other baud rate is complete gibberish.


There must be something simple I am missing. Can someone please tell me what I am missing. All of my esp modules are doing the same thing.
User avatar
By QuickFix
#84479 You say in the subject that it's solved, but you forgot to include the solution. :idea:

[EDIT]
Ah, I see you did a cross-post and added a solution in the other thread, always nice.