-->
Page 13 of 16

Re: SPI Slave with Arduino libs ?

PostPosted: Sat Nov 19, 2016 4:56 pm
by Vicne
romuye wrote:I am trying to use STM32 microcontroller as master and ESP8266 as slave for SPI communication.
But unable to get it working...
Following is my console for ESP8266 output

Could you give some information about the code you used ?
Does it work between Arduino and ESP8266 ?
Kind regards,

Vicne

Re: SPI Slave with Arduino libs ?

PostPosted: Sun Nov 20, 2016 7:03 am
by romuye
Q: Could you give some information about the code you used ?
A:

1) Used following code for master ( STM32 )
http://grauonline.de/wordpress/?page_id=1004

2) Used following code for slave ( ESP8266 )
https://github.com/esp8266/Arduino/blob/master/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino

Q2: Does it work between Arduino and ESP8266 ?
A: Since i do not have Arduino now, was unable to test.

Thanks,

Re: SPI Slave with Arduino libs ?

PostPosted: Fri Nov 25, 2016 4:25 am
by Maomao23
Ooops... Looks that Ishould have read the entire thread before posting.

So I added the Vicne finding:
// Additional setting to have MISO change on falling edge
SPI1C2 |= 1 << SPIC2MISODM_S;

And now it's working (not 100% of the time, I will investigate more, surely because of the long wires connecting the 2 ESPs).

Thanks Vicne! (maybe we should put this line somewhere in the ESPSlave examples?)

Re: SPI Slave with Arduino libs ?

PostPosted: Sat Dec 10, 2016 12:15 pm
by Vicne
Hi, all,
I just wanted to let you know I refreshed the "SPI register description" document :

ESP8266 SPI register description 20161210.pdf

Feel free to comment if you spot mistakes or have additional information.
KR,
Vicne