how to increase the sampling speed of esp32 with external ADC #10837
VasikaranS25
started this conversation in
Question - Community Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on Configuring the External ADC to ESP32 with but the maximum sampling frequency I can reach is 25khz I need to sample at 96khz how to increase sampling rate because I just reading SPI data and I use the Following Code
#include <SPI.h>
static const int spiClk = 8000000; // 1 MHz
//uninitialized pointers to SPI objects
SPIClass *vspi = NULL;
uint16_t data = 0;
uint16_t receivedData;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
vspi = new SPIClass(VSPI);
vspi->begin();
pinMode(SS, OUTPUT);
digitalWrite(SS, HIGH);
vspi->beginTransaction(SPISettings(spiClk, MSBFIRST, SPI_MODE0));
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(SS,LOW); //pull SS slow to prep other end for transfer
receivedData = vspi->transfer16(data);
digitalWrite(SS,HIGH);
Serial.println(receivedData, DEC);
//delay(1);
}
Beta Was this translation helpful? Give feedback.
All reactions