0

Being clear I'm not talking about How to flash ESP8266 using arduino. I want to ask how can I use atmega328p as flash with esp8266 (instead of that 8 pin small chip on ESP-01) so that I can burn Webserver code on Atmega328p and it simply works with esp8266?

Thanks in advance.

  • No. No you cannot. – Majenko Oct 26 at 6:59
  • Can I ask why? And if I need a webserver should I upload a code to Esp8266 seperatly and make atmega328p and esp8266 communicate via TX RX? – Prabhjeet Singh Oct 26 at 7:06
  • 1
    To do it you would need 1) a high speed (40mhz or better) spi slave interface, 2) hundreds of kB or even multiple mb of flash, 3) firmware to emulate a flash chip. The Arduino doesn't have 1 or 2 and writing 3 would be a chore. – Majenko Oct 26 at 7:34
  • To make a web server either install the at firmware on the esp and follow the examples or program the esp directly and use whatever communication method you feel is appropriate to talk to an Arduino if you really feel you need to have an Arduino at all. – Majenko Oct 26 at 7:35
  • why emulate the flash if every esp8266 module has the flash to which you can upload over the esp8266? – Juraj Oct 26 at 8:27
2

It can't be done (also, why would you think that would ever be a good idea?!)

The 8 pin chip on the ESP-01 is a 512kB SPI flash that runs at (at least) 40MHz. So to emulate that you would need:

  • More than 512kB of flash,
  • A slave SPI interface that can operate at a minimum of 40MHz, and
  • The knowledge, time and energy to write the firmware to emulate an SPI flash chip

The first two are certainly beyond an ATMega328P with 32kB flash and an 8MHz maximum speed SPI interface. The third is probably beyond you since you have to ask the question in the first place (which shows a certain lack of knowledge on what it is you are proposing).

There are plenty of examples for creating a web server using an ESP8266 using either the standard AT firmware or by directly programming the ESP8266's flash chip through the ESP8266's built-in UART bootloader. Personally I find the use of AT firmware clumsy at best and prefer to always program my ESP8266's directly. If you feel the need to also add an ATMega328P into the mix for some reason then the communication protocol that you use between them is entirely up to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.