HSPI slave

oakie_doke
Posts: 1
Joined: Mon Dec 21, 2015 6:54 pm

HSPI slave

Postby oakie_doke » Mon Dec 21, 2015 7:28 pm

Hi,

I'm trying to run ESP8266 as spi slave device and send data to it. I use HSPI. I used source files, which I found in SPI_slave example in Unofficial Development Kit for Espressif ESP8266 in http://www.esp8266.com/viewtopic.php?f=9&t=820 (I also tested spi drivers from sdk but also with no success). After I run slave_init() function i send command, address and data from host as it is described in 8I-ESP8266__SPI-WiFi_Passthrough_1-Interrupt_Mode__EN_v0.1.pdf or 8J-ESP8266__SPIWiFi_Passthrough_2-Interrupt_Mode__EN_v1.0.pdf (for example when I want to write to module I send: command 0x02 + address 0x00 + 32 bytes of data). After I send 34 bytes I check content of SPI_W0-SPI_W7 registers, but there is still the same data as before transmission. I checked waveforms on oscilloscope, signals look properly I can't find where is problem.
I am also confused becouse in 8N-ESP8266__SPI_Reference__EN_v1.0.pdf there is different description of transmission
and settings of SPI. Clock is setted to be high in the idle state on the waveform, and packet to write data is 0x04 + 1 byte of data (to read data from slave command is 0x06 instead 0x03). Which is properly?

There is also few strange things. There is possibility to read SPI_FLASH_STATUS register using command 0x04 or 0x05 described in 8I-ESP8266__SPI-WiFi_Passthrough_1-Interrupt_Mode__EN_v0.1.pdf, but I can't find what is address of this register, it isn't defined in spi_register.h.

What is properly communication format and where is newest correct driver and documents described it?

I would be very grateful for any help.

kajtusize
Posts: 3
Joined: Fri Mar 04, 2016 11:13 pm

Re: HSPI slave

Postby kajtusize » Fri Mar 04, 2016 11:19 pm

hey,

I'm having the same troubles. Writing with the function 0x02 doesn't work, actually anything I will send on HSPI I get the SPI_TRANS_DONE interrupt, no matter if reading/writing or whatever. Also neither 0x04 nor 0x05 work. I don't really get what's in the document "8J-ESP8266__SPI-WiFi_Passthrough_2-Interrupt_Mode__EN_v1.0" on page 5 in point 2.2:

"Note: other values are used to read/write the SPI slave status register SPI_STATUS. Their communication formats are different from those of the read/write buffer, using them will cause read/write errors for the slave. So users should not use these values."

Does it mean we shouldn't use functions 0x04 and 0x05?

Any help from Espressif much appreciated!

PS. will keep posting if I'll have some progress

kajtusize
Posts: 3
Joined: Fri Mar 04, 2016 11:13 pm

Re: HSPI slave

Postby kajtusize » Mon Mar 07, 2016 3:56 pm

Hi,

I'm having similar troubles that you do. None of the functions is working, actually whatever I'll send to ESP8266 I always get SPI_TRANS_DONE interrupt. Also, in the file "8J-ESP8266__SPI-WiFi_Passthrough_2-Interrupt_Mode__EN_v1.0" there's a note:

other values are used to read/write the SPI slave status register SPI_STATUS. Their communication formats are different from those of the read/write buffer, using them will cause read/write errors for the slave. So users should not use these values.

Does it mean we can't use functions 0x04 and 0x05? Well, anyway they don't work so far!

Espressif, any help with the SPI slave example would be appreciated!!

Will keep posting in case of a progress

sarodeoa
Posts: 3
Joined: Tue Feb 16, 2016 10:18 am

Re: HSPI slave

Postby sarodeoa » Mon Mar 14, 2016 2:15 am

I'd appreciate help from the Esspressif guys as well!

ldcung
Posts: 5
Joined: Tue Jul 12, 2016 10:48 pm

Re: HSPI slave

Postby ldcung » Wed Jul 13, 2016 9:20 am

Is anyone solve this question? I am having the same trouble now. any help with it would be appreciated!!

ldcung
Posts: 5
Joined: Tue Jul 12, 2016 10:48 pm

Re: HSPI slave

Postby ldcung » Wed Jul 13, 2016 2:59 pm

Hello.I have found my fault about HSPI. The spi master and spi slave should connect like below:
CS--------CS
MOSI--------MOSI
MISO--------MISO
CLK--------CLK
but in my application,I connect master MOSI with slave MISO,and connect master MISO with slave MOSI.it is wrong.
After connect with the right way,the hspi receive data correct.

disideris
Posts: 2
Joined: Thu Jun 23, 2016 9:38 pm

Re: HSPI slave

Postby disideris » Fri Jul 15, 2016 9:18 pm

ldcung wrote:Hello.I have found my fault about HSPI. The spi master and spi slave should connect like below:
CS--------CS
MOSI--------MOSI
MISO--------MISO
CLK--------CLK
but in my application,I connect master MOSI with slave MISO,and connect master MISO with slave MOSI.it is wrong.
After connect with the right way,the hspi receive data correct.



Hi idcung.

Can you share some info about spi connection?

R u trying to connect two esp8266 or one esp and another mcu?

I am trying to connect through spi an LPXxpresso 4367 mcu as spi master and an esp8266 as slave.
The spi slave example http://www.esp8266.com/viewtopic.php?f=9&t=820 doesn't work (or i cant get it to work).

Can u share ur connection setup and the code you used?

Thanx anyway!

Who is online

Users browsing this forum: MSN [Bot] and 7 guests