Got my feet wet with an Arduino a couple of weeks back and then discovered the esp8266 (by accident) and am now totally hooked.
I use the Arduino IDE with the add-on for esp8266 development.
Works like a dream. Kudos to all those involved.
But......
Why does the add-on for esp8266 use so much memory?
Compiling a barebone sketch for an Arduino Uno:
Compiling the same sketch for a Sparkfun esp8266 WiFi Shield:
And when I ran some code on my esp8266 to show memory use at runtime another thing caught my eye:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println();
Serial.println("Flash memory: "+String(ESP.getFlashChipSize())+" Bytes.");
Serial.println("Free heap memory: "+String(ESP.getFreeHeap())+" Bytes.");
Serial.println("Chip speed: "+String(ESP.getFlashChipSpeed())+" Hz.");
}
void loop() {
// put your main code here, to run repeatedly:
while( 1==1) {
delay(10);
}
}
Outputs this:
Flash memory: 524288 Bytes.
Free heap memory: 46080 Bytes.
Chip speed: 40000000 Hz.
So my Sparkfun WiFi Shield is running at 40Mhz?
I thought these chips ran at 80Mhz or 160Mhz, according to the datasheet.
And in the Arduino IDE there are only options for 80/160Mhz for this board.
Also, 500KB of mem, of which only 46KB are free?
What's up with that?
Am I confusing Flash and RAM or EEPROM here?
Please enlighten me!