Cannot control the default CS0 pin on VSPI.
Posted: Tue Jul 16, 2019 9:58 pm
I am trying to interface with an external 16bit ADC. I need to enable CS0 pin 5, 12 uSec before transferring data. So I need the pin to stay default low, go high to start the conversion, and then go low to acquire data. The default operation is to stay high until ~1uSec before a transfer starts.
The operation I need is:
But the CS pin just stays high.
The simple solution is to use another pin, but I am using every pin on the board and cannot afford a unused pin.
Is there some other controls for the CS pin or a way to disable it and give me manual control?
The operation I need is:
Code: Select all
while(samplesAcquired < numSmpls) {
digitalWrite(5,HIGH);
ets_delay_us(CNVRT_TIME);// Spec Sheet says we need 8.8uSec to convert
digitalWrite(5,LOW);
SPI_GetUInt16(&this->ads8866Data);//Apply bias here so that signal is ready for window
glbAcqBuff.intArray[samplesAcquired] = ads8866Data;
ets_delay_us(ticksPerSample);
samplesAcquired++;
}
//in VSPI_init()
devcfg.spics_io_num = -1;//=PIN_NUM_CS; Disable CS0 in VSPI //CS pin
//In board setup Enable CS as GPIO
pinMode(pinNum, INPUT);
digitalWrite((gpio_num_t)pinNum,LOW);
The simple solution is to use another pin, but I am using every pin on the board and cannot afford a unused pin.
Is there some other controls for the CS pin or a way to disable it and give me manual control?