Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By costo
#22172 I use Arduino IDE 1.6.5 and have ESP-add-on version 1.6.4-673g8cd3697 installed (copied in the hardware folder).
I want to read the 3,3 volt so I added this code:

Code: Select allextern "C" {     
  #include "user_interface.h"
  uint16 readvdd33(void);
}

and made :

void readVdd()
{
  char buf[6];                                  // temporary buffer
  float  vdd = readvdd33()/1000.0;
  dtostrf( vdd, 1 ,3, buf);                     // convert float to string
  sendStrXY(buf,7,10);                         // print string on OLED
}


I call readVdd() in setup() and it perfectly prints the string on the display, so far so good but only in setup().

When I do this in the loop then the ESP resets most of the time with message: wdt reset ... etc .... etc
no difference if I ommit the dtostrf() and sendStrXY() functions, the vdd = readvdd33()/1000.0 make the ESP crash.

Is this a feature ;) or is this not (yet) fully implemented in the ESP add-on ?
User avatar
By costo
#22361 It's weird but I'm not able anymore to reproduce this phenomenon. 2 days ago ESP crashed all the time with this readVdd33() call inside the loop() , whichever sketch I used. Today nothing is wrong and I can use the vdd33 call without any pain.
I was thinking it was my setup, I was using a I2C OLED and I2C master/slave communication when the ESP crashed. So today I tried different ESP's, the 07 and the 01 versions and all sort of I2C setups. All works fine , the symptoms have disappeared overnight, after my PC was powerless for a day.

Have checked the powersupply but that must be fine with a 5V/3.3V breadboard PSU print and plenty of capacitors on the powerrails of the breadboard.
Resetpin of the ESP has a 10nF directly soldered from the RST_pin to the metal case, it is very stable and never resets spontaneous.
Hopefully it never happens again.
User avatar
By Eyal
#22403 With the LUA firmware I get this crash whenever I readvdd33() a few times.
I just do not do it (I read once). This uses SDK 0.9.5 and I am waiting for a v1 series LUA release to see if the problem goes away.