SPI register and demo

costaud
Posts: 138
Joined: Fri Oct 24, 2014 7:40 pm

SPI register and demo

Postby costaud » Thu Dec 18, 2014 4:35 pm

This is a demo of "how to use esp8266 (h)spi port"

Slave mode and master mode .

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

SPI_CODE_141204.rar
(22.83 KiB) Downloaded 5535 times

bjpirt
Posts: 15
Joined: Sun Nov 09, 2014 4:15 pm

Re: SPI register and demo

Postby bjpirt » Thu Dec 18, 2014 9:38 pm

@Costaud Many thanks for posting this. Will have a play with it and post back here with any questions

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

Re: SPI register and demo

Postby kajtusize » Mon Mar 07, 2016 4:08 pm

I've been struggling with SPI slave, almost same story as here 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!

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

Re: SPI register and demo

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

Do you have solved this question? I am having the same trouble now.Any help or suggestion with it would be appreciated!!

scargill
Posts: 70
Joined: Sun Nov 02, 2014 8:09 pm

Re: SPI register and demo

Postby scargill » Mon Sep 12, 2016 7:50 pm

Am I missing something - this seems to be about a specific driver and I'm not seeing how the SPI master reads anything??

xPhyiscs
Posts: 3
Joined: Fri Sep 16, 2016 4:49 pm

Re: SPI register and demo

Postby xPhyiscs » Fri Sep 16, 2016 4:55 pm

Hey !

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
SCR03.PNG (9.51 KiB) Viewed 25547 times
SCR04.PNG
SCR04.PNG (9.24 KiB) Viewed 25547 times


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..

pratik

Re: SPI register and demo

Postby pratik » Sat Sep 17, 2016 8:33 pm

Hello,

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.

xPhyiscs
Posts: 3
Joined: Fri Sep 16, 2016 4:49 pm

Re: SPI register and demo

Postby xPhyiscs » Mon Sep 19, 2016 12:19 am

Hey thanks for answer.

I am using arduino ide. With arduino ide, there is no possibility to use SPI ?

pratik

Re: SPI register and demo

Postby pratik » Mon Sep 19, 2016 11:02 am

It is definitely possible, provided you code things right. Be it Arduino or any other interface - in the end it comes down to writing the proper values to the appropriate registers.
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. :)

xPhyiscs
Posts: 3
Joined: Fri Sep 16, 2016 4:49 pm

Re: SPI register and demo

Postby xPhyiscs » Mon Sep 19, 2016 2:22 pm

Actually I am not fan of arduino ide.

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 ?

Who is online

Users browsing this forum: No registered users and 14 guests