Using ESP's SPI port in Mega2560+Wifi R3

I need to use SPI port of ESP8266 that is integrated into the Mega2560+Wifi R3 board.

But ESP pins that are available to use are these:
image

That doesn't include the required pins: GPIO13(MOSI) GPIO14(SCK) GPIO15(SS)
Does it mean that I can not use SPI port of the integrated ESP chip?
Thanks in advance...

Yes i think it does. The board you have is intended to be used a a Mega + WiFi, where the WiFi doesn't impact flash & RAM on the main board. The idea is that you use SPI on the Mega.

1 Like

Thank you so much for your prompt response.
Considering ESP8266's clock (160MHz) it would be perfect if I could use its SPI instead of Mega's SPI...
Now I have to transfer Network LOG data to Mega so that it stores them in SD card :face_with_thermometer:.
I wish someone could give me a piece of advice how to connect my SD to integrated ESP chip.

Maybe the board you have, is not ideal for the project you have in mind. What are the total requirements you have ? Do you need that many pins ?

1 Like

This project is a digital translator between two devices and making it possible to monitor the status using WiFi connection and storing the log of WiFi connected devices on SD card. So my requirements are:
4 Serial Ports on main processor:
2 for continuous communication with 2 external devices
1 for communication with WiFi chip
1 for debugging

on WiFi chip:
Communication with SD module
Communication with DS Clock module

Right now I'm thinking to use Mega + External Wemos Mini instead of MEGA+WiFi R3!

Is there a software SPI implementation that would work on the ESP8266 that you could use with the GPIO pins available on that header?

1 Like

Thanks, but searching the idea wasn't so fruitful...

What is the amount of data that you want to log ? Could you use SPIFFS / LitteFS ? what is the size of you esp8266's flash ?

Would work, a teensy + ESP-01 might work as well.

Googled and

My result as well.

1 Like

I am even thinking you might be able to get away with an ESP32 or even a nodeMCU, you say you need 4 Serial ports, but for what ? What are you connecting to and at what speed ?

Debugging can be done via the webpage or swSerial, so there is just the 2 external devices. If 1 can make do with swSerial or maybe they could share the main port.

Can't you just use NTP time ?

1 Like

Deva_Rishi
What is the amount of data that you want to log ? Could you use SPIFFS / LitteFS ? what is the size of you esp8266's flash ?

Log data might get quite big! maybe around 1GB. But if in dead end I'll consider your idea of using SPIFFS.

Deva_Rishi
Would work, a teensy + ESP-01 might work as well.

Yep, but most available and cost efficient one fore me right now is Wemos D1 Mini.

Deva_Rishi
What are you connecting to and at what speed ?

Devices are:
UI panel of an Inverter (Inverted TTL) Baud Rate: 2400
Inverter (RS485) Baud Rate: 9600.
ESP32? I looked it up. Considering it has 3 Hardware Serial ports it might be a all in one solution for my project! Am I right?

Deva_Rishi
Can't you just use NTP time ?

Unfortunately I can not rely on always-on network due to harsh low-tech environment.

Well at those rates swSerial is always an option, Do you have enough pins to do the whole thing on the Wemos, otherwise just use a nodeMCU. UART0 for the inverter. UART1 TX for debug (oh yeah there is an extra UART TX available) swSerial, well at 2400bps you hardly need to even use an existing library, that is just so slow, you can write functions based on pin interrupts for RX and timer interrupts for TX yourself.

Yes but as stated, i think you can get away with something cheaper.

Are you storing only the data you actually need ? 1GB of relevant data is really quite a lot.

1 Like

Invaluable info :ok_hand:

I'm moving from Mega+WiFi R3, so even using ESP32 is quite economical. Besides, using ESP32 I can even make Bluetooth connection possible that is potentially an interesting feature.

Yep, Beside WiFi connection history, history of executed commands (issued either by Control Panel or WiFi) can get quite big and is necessary.

And again I really appreciate your comments and am very thankful.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.