Good day.
I am interacting between and ESP32 and an ADC (CS5523) using SPI communication. For this communication, the datsheet (CS5523 pdf, CS5523 Description, CS5523 Datasheet, CS5523 view ::: ALLDATASHEET ::: ) specifies (in page 11) that the time between the CS lowering and the SDO sending data must be a maximum of 150 [ns]. With the configuration I have, it is 1 [us]. For this I am using the Arduino incorporated library (SPI.h). My question is, how can this value be changed?, can it be changed udsing this same library?.
My code is the following:
#include <SPI.h>
#define VSPI_MISO 12
#define VSPI_MOSI 13
#define VSPI_SCLK 14
#define M_CSb 25
static const int SPI_CLK = 1000000;
SPIClass * vspi = NULL;
void setup() {
pinMode(M_CSb, INPUT_PULLUP);
vspi = new SPIClass(VSPI);
vspi->begin(VSPI_SCLK, VSPI_MISO, VSPI_MOSI, M_CSb);
Serial.begin(9600);
pinMode(M_CSb,OUTPUT);
digitalWrite(M_CSb, HIGH);
}
void loop() {
Reset(vspi);
}
void Reset(SPIClass *spi){
Serial.println("En Reset");
spi->beginTransaction(SPISettings(SPI_CLK, MSBFIRST, SPI_MODE0));
digitalWrite(M_CSb, LOW); // Select the slave device
Serial.println("Se bajo el chip select Reset");
spi->transfer(0x03); //Write to configuration register
///////// Generar reset en configuration register //////
spi->transfer(0x00);
spi->transfer(0x00);
spi->transfer(0x04);
digitalWrite(M_CSb, HIGH);
spi->endTransaction();
Serial.println("Fin Reset");
Also, this is how it looks (in the atached figure)
Thanks a lot in advance