3-Wire-SPI on ESP32-WROOM-32UE

nirvik
Posts: 3
Joined: Tue Nov 29, 2022 11:48 am

3-Wire-SPI on ESP32-WROOM-32UE

Postby nirvik » Fri Oct 13, 2023 10:43 am

How to perform 3-Wire-SPI communication on ESP32-WROOM-32UE ? We're using AD7091R sensor.

mikemoy
Posts: 626
Joined: Fri Jan 12, 2018 9:10 pm

Re: 3-Wire-SPI on ESP32-WROOM-32UE

Postby mikemoy » Sat Oct 14, 2023 7:32 am

Just dont use the 4'th wire

bidrohini
Posts: 202
Joined: Thu Oct 27, 2022 12:55 pm

Re: 3-Wire-SPI on ESP32-WROOM-32UE

Postby bidrohini » Sat Oct 14, 2023 10:13 am

Unfortunately, very less number of contents are available in this topic. I could only find this.
https://electronics.stackexchange.com/q ... i-to-esp32

username
Posts: 532
Joined: Thu May 03, 2018 1:18 pm

Re: 3-Wire-SPI on ESP32-WROOM-32UE

Postby username » Sat Oct 14, 2023 9:42 pm

When you initialise your SPI bus. just set the MOSI to -1.

Code: Select all

    // spi_bus_config_t
	buscfg.sclk_io_num = PIN_NUM_CLK; 		// GPIO pin for Spi CLocK signal, or -1 if not used.
	buscfg.mosi_io_num = -1; 					// GPIO pin for Master Out Slave In (=spi_d) signal, or -1 if not used.
	buscfg.miso_io_num = PIN_NUM_MISO; 		// GPIO pin for Master In Slave Out (=spi_q) signal, or -1 if not used.O
	buscfg.quadwp_io_num = -1; 				// GPIO pin for WP (Write Protect) signal which is used as D2 in 4-bit 		 
        communication modes, or -1 if not used.
	buscfg.quadhd_io_num = -1; 				// GPIO pin for HD (HolD) signal which is used as D3 in 4-bit communication 
        modes, or -1 if not used.
	buscfg.max_transfer_sz = 0; // Maximum transfer size, in bytes. Defaults to 4094 if 0.
    ESP_ERROR_CHECK(spi_bus_initialize(HSPI_HOST, &buscfg, 1));

Who is online

Users browsing this forum: Assasinsareus, Bing [Bot] and 112 guests