SPI Mode 2 (Clock Polarity: 1, Clock Phase: 0) is not working when I am interfacing ADS1293 with ESP32 Wroom 32

42 Views Asked by At

I have interfaced the ESP-32 Wroom32E (using IDF and APIs) with ADS1293 which is a heart monitoring sensor. I have used simple SPI protocol to read the register values. My SPI protocol is working perfectly fine with all SPI modes- Mode 0,1 and 3 however, Mode 2 is NOT giving me any values of the register.

I do not know whether it's hardware problem or am I missing something.

code snippet of configuring device structure:

    spi_device_interface_config_t devcfg={
        .clock_speed_hz=10*1000*1000,           //Clock out at 10 MHz
        .mode=0,                                //SPI mode 0: CPOL:-0 and CPHA:-0
        .spics_io_num=PIN_NUM_CS,               //This field is used to specify the GPIO pin that is to be used as CS
        .queue_size=7,                          //We want to be able to queue 7 transactions at a time
    };

I have checked all the modes- 0,1,2 and 3. I am receiving the data through all the modes of SPI except mode-2.

0

There are 0 best solutions below