!
SPI_MOSI
SPI_MISO
IRQ
The ESP_IOT reference board: change the jumper MTD0 to 1 (short the 2 pins below),
GPIO0, GPIO2 random (1, x, x is the SDIO starting mode), CHIP_PD:ON (flip the switch
downward). Keep jumper J66 connected to the 2 pins on the left, and jumper J67
connected to the 2 pins on the right.
Connect the 5V power adapter to the ESP_IOT reference board and the Red Dragon demo
board. Turn on the demoboard power, download the compiled programs mentioned in
Section 2.2 to STM32 in the IAR environment. Start the STM32 program, and turn on the
ESP_IOT reference board power. the STM32 will write the starting program into the
ESP8266, and after several seconds, it will automatically run the SDIO to return to the
testing program.
3.3. ESP8266 Software Instruction
3.3.1. Protocol Principle: SDIO Line Breakage and SDIO Status Register
In the SDIO SPI compatibility mode, pin SD_DATA1 of the ESP8266 is used as the interrupt
line to send signals to the SPI host, and the signals are active low. When the ESP8266
SDIO status register is upgraded by software, the interrupt line will change from active high
to active low. The host should write in data to resume the active high through SDIO. (to be
specific, the host should write 1 into register with the address 0x30 through CMD53 or
CMD52 command in order to resume the active high of the interrupt line.)
the SDIO status register is 32 bits, it is revised by ESP8266 software, and it can be read by
the host through CMD53 or CMD52 command. The address is 0x20-0x23. The data
structure is shown as below:
struct sdio_slave_status_element
{
u32 wr_busy:1;
u32 rd_empty :1;
u32 comm_cnt :3;
u32 intr_no :3;
u32 rx_length:16;
u32 res:8;
};
To be specific:
wr_busy, bit 0: 1, write buffer of the slave is full, and the ESP8266 is processing data
•
from the host; 0, write buffer is empty, users can write data into the buffer.
Espressif
->
5
SDIO_CMD
->
3
SDIO_DAT0
->
2
SDIO_DAT1
15 86
!
/!
3. SPI Compatibility Mode User Guide
2016.05
Need help?
Do you have a question about the ESP8266 and is the answer not in the manual?
Questions and answers