-->
Page 1 of 1

ESP-WROOM-02 SPI with pic

PostPosted: Mon Dec 26, 2016 3:33 am
by Loureirp
Hello all,

Someone knows example of conecting PIC+ESP-WROOM-02 using SPI?

Thanks

Re: ESP-WROOM-02 SPI with pic

PostPosted: Mon Dec 26, 2016 10:59 pm
by mrburnette
SPI is a 'master' / 'slave' implementation:
https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

This ESP8266 thread may assist:
http://www.esp8266.com/viewtopic.php?f=13&t=669

If you were thinking of ESP8266 in SPI slave, read this:
https://github.com/esp8266/Arduino/issues/2134

You are on-your-own with PIC

Ray

Re: ESP-WROOM-02 SPI with pic

PostPosted: Tue Dec 27, 2016 10:18 am
by picstart
SPI has 4 modes so the mode must match with the PIC. PIC's can be 3.3v as are the esp's but some PIC's are 5v so voltage matters.
SPI has a frequency so they need to match
The PIC can be both a master and a slave. The esp is somewhat easier to use as a master so I'd make the esp the master.
Often it is best to use the PIC interrupts to receive data via an ISR from your esp.
So with 4 wires including gnd and a chip select it should be straight forward at least if you have experience with using PIC's.
PIC's are almost indestructible but the esp is fragile relative to voltages applied to it's pins 5v on an esp 3.3v pin usually leads to failure whereas a PIC with its diode protection
on every pin will survive all kinds of abuse. Using the PIC to coddle the GPIO's of the esp8266 will make for added robustness.