ESP8266 Developer Zone The Official ESP8266 Forum 2017-08-22T20:27:57+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=85 2017-08-22T20:27:57+08:00 2017-08-22T20:27:57+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=15275#p15275 <![CDATA[Re: SPI register and demo]]>

I wrote my own hspi slave driver for esp-open-rtos and notice one important thing.
Its very important how the data are send to esp, so I create such table for all of you who struggle with this topic:

Code:

/*-----------------------------------------------------------------------------------------------------------------------------\
|  Command name | Status bit set in registry | First request                        | Second request                           |
|------------------------------------------------------------------------------------------------------------------------------|
|  write status |   SPI_SLAVE0_WR_STA_DONE   | 0x01 + status (2bytes, 8 bits/word)  | None                                     |
|------------------------------------------------------------------------------------------------------------------------------|
|  write data   |   SPI_SLAVE0_WR_BUF_DONE   | 0x02 + 0x00   (2bytes, 8 bits/word)  | 32 bytes of data (32bytes, 32 bits/word) |
|------------------------------------------------------------------------------------------------------------------------------|
|  read data    |   SPI_SLAVE0_RD_BUF_DONE   | 0x03 + 0x00   (2bytes, 8 bits/word)  | 32 bytes of data (32bytes, 8 bits/word)  |
|------------------------------------------------------------------------------------------------------------------------------|
|  read status  |   SPI_SLAVE0_RD_STA_DONE   | 0x04 + 0x00   (2bytes, 8 bits/word)  | None                                     |
\------------------------------------------------------------------------------------------------------------------------------*/

Statistics: Posted by hetii — Tue Aug 22, 2017 8:27 pm


]]>
2016-10-13T11:31:46+08:00 2016-10-13T11:31:46+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=10144#p10144 <![CDATA[Re: SPI register and demo]]>
For a start, you could read the Getting Started Guide from here:
http://www.espressif.com/en/products/ha ... /resources

Then try compiling some example program... steps would be something like this:
For nonOS SDK:
http://iot-bits.com/articles/building-e ... k-v-2-0-0/
For RTOS SDK:
http://iot-bits.com/articles/building-e ... -rtos-sdk/

If you follow the Getting Started Guide and use the Lubuntu environment, you can get started in justa day as the toolchain is already available there. Next, to write your own programs, refer to the SDK API documentations which outline all the functions available to you. It is easy! :)

Statistics: Posted by Guest — Thu Oct 13, 2016 11:31 am


]]>
2016-09-19T14:22:35+08:00 2016-09-19T14:22:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=9862#p9862 <![CDATA[Re: SPI register and demo]]>
To use esp which development environmet should be better ? Can you give me any link to set up ? Ayn tutorial ?


// Configure MUX to allow HSPI
WRITE_PERI_REG(PERIPHS_IO_MUX, 0x105);

// SCK, MOSI, MISO and CS
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, 2);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, 2);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, 2);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, 2);


Also how can you learn this ? Where can I find documantation about these ?

Statistics: Posted by xPhyiscs — Mon Sep 19, 2016 2:22 pm


]]>
2016-09-19T11:02:56+08:00 2016-09-19T11:02:56+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=9859#p9859 <![CDATA[Re: SPI register and demo]]> I personally am not familiar with the Arduino IDE + ESP8266 so I cannot help with this directly. But there might be libraries that get the job done. :)

Statistics: Posted by Guest — Mon Sep 19, 2016 11:02 am


]]>
2016-09-19T00:19:22+08:00 2016-09-19T00:19:22+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=9858#p9858 <![CDATA[Re: SPI register and demo]]>
I am using arduino ide. With arduino ide, there is no possibility to use SPI ?

Statistics: Posted by xPhyiscs — Mon Sep 19, 2016 12:19 am


]]>
2016-09-17T20:33:20+08:00 2016-09-17T20:33:20+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=9844#p9844 <![CDATA[Re: SPI register and demo]]>
If you are using the Espressif nonOS or RTOS SDK to write your application, please use the following to set the GPIO to act as HSPI interface pins:

// Configure MUX to allow HSPI
WRITE_PERI_REG(PERIPHS_IO_MUX, 0x105);

// SCK, MOSI, MISO and CS
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, 2);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, 2);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, 2);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, 2);

Not writing the correct value to the IO_MUX will cause problems like this in most cases.

Statistics: Posted by Guest — Sat Sep 17, 2016 8:33 pm


]]>
2016-09-16T16:55:20+08:00 2016-09-16T16:55:20+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=9838#p9838 <![CDATA[Re: SPI register and demo]]>
I have some unanswered questions, which I could not find anything on the internet, about esp8266 , I want to use spi port of esp8266. Before it I check with probe the clock pin, there are huge noisy data or ı do not understand what it is ! I never see such a clock signal before. image is the below from the scope
SCR03.PNG
SCR04.PNG


I do not try the code you give above, If I try it , it will work ?

I work with nodemcu esp8266 , there is no problem like that , when I take the board there is no clock signal so I can simply use the spi port of the board?

I need information about spi port of the esp8266 what you produce. My knowledge just in limitation that it is connected to flash chip to get data !

Thanks for help..

Statistics: Posted by xPhyiscs — Fri Sep 16, 2016 4:55 pm


]]>
2016-09-12T19:50:09+08:00 2016-09-12T19:50:09+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=9791#p9791 <![CDATA[Re: SPI register and demo]]> Statistics: Posted by scargill — Mon Sep 12, 2016 7:50 pm


]]>
2016-07-13T09:58:58+08:00 2016-07-13T09:58:58+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=7932#p7932 <![CDATA[Re: SPI register and demo]]> Statistics: Posted by ldcung — Wed Jul 13, 2016 9:58 am


]]>
2016-03-07T16:08:25+08:00 2016-03-07T16:08:25+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=6007#p6007 <![CDATA[Re: SPI register and demo]]> viewtopic.php?f=7&t=1540&p=5113
The functions 0x04 and 0x05 are not working, actually I didn't succeed with any function! Any possible update/help!
Thanks!

Statistics: Posted by kajtusize — Mon Mar 07, 2016 4:08 pm


]]>
2014-12-18T21:38:22+08:00 2014-12-18T21:38:22+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=291#p291 <![CDATA[Re: SPI register and demo]]> Statistics: Posted by bjpirt — Thu Dec 18, 2014 9:38 pm


]]>
2014-12-18T16:35:00+08:00 2014-12-18T16:35:00+08:00 https://bbs.espressif.com:443/viewtopic.php?t=85&p=290#p290 <![CDATA[SPI register and demo]]>
Slave mode and master mode .

Raise your question here ,we will update this topic gradually.

Statistics: Posted by costaud — Thu Dec 18, 2014 4:35 pm


]]>