-
-
Notifications
You must be signed in to change notification settings - Fork 309
External ADC + external DAC on esp32 #1525
-
I have next scheme: mic -> DAC (PCM5102A) -> esp32 -> ADC (PCM1808) -> speaker. I configure these like:
#include "Arduino.h"
#include "AudioTools.h"
I2SStream in;
I2SStream out;
StreamCopy copier(out, in);
void setup() {
Serial.begin(115200);
AudioLogger::instance().begin(Serial, AudioLogger::Info);
// ADC
auto configAdc = in.defaultConfig(RX_MODE);
configAdc.port_no = 0;
configAdc.pin_bck = 33;
configAdc.pin_ws = 32;
configAdc.pin_data = 25;
configAdc.i2s_format = I2S_STD_FORMAT;
configAdc.bits_per_sample = 32;
configAdc.channels = 2;
configAdc.sample_rate = 44100;
configAdc.is_master = true; // optional because default setting
configAdc.use_apll = false;
configAdc.pin_mck = 3;
in.begin(configAdc);
// DAC
auto configDac = out.defaultConfig(TX_MODE);
configDac.port_no = 1;
configDac.pin_bck = 14;
configDac.pin_ws = 26;
configDac.pin_data = 27;
configDac.i2s_format = I2S_STD_FORMAT;
configDac.bits_per_sample = 32;
configDac.channels = 2;
configDac.sample_rate = 44100;
configDac.is_master = true;
configDac.use_apll = false;
configDac.pin_mck = 3;
out.begin(configDac);
}
void loop() {
copier.copy();
}
After uploading there is only noise in speakers. What can be the problem?
The DAC works well with internal esp32's ADC, but after connecting external one I'm facing that problem. So, I think that the problem may be related to incorrect ADC setting. I tried to change ADC's .is_master to false, nothing happens.
Connection scheme:
Снимок экрана 2024年04月23日 111229
Beta Was this translation helpful? Give feedback.
All reactions
Just look at the provided examples: There is a one port soluton where you can share the pins and a two port solution where you would need to specify the port:
Replies: 2 comments 8 replies
-
Just look at the provided examples: There is a one port soluton where you can share the pins and a two port solution where you would need to specify the port:
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello @gurinkirill,
Did you manage to get your project working? Because I have a similar project and I don't get any sound coming out of the PCM5102 (which works fine on its own) - I think it's the PCM1808 that's causing the problem...
Many thanks in advance !
Beta Was this translation helpful? Give feedback.
All reactions
-
Maybe problem is in connection? Some esp's pins are inappropriate for i2s communication
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Thank you, I will try this connection of the jumpers !
But did you still keep the pcm1808 with the microphone ? Or do you have your microphone directly connected to the ESP's ADC ?
Beta Was this translation helpful? Give feedback.
All reactions
-
Mic out is connected to ADC input, mic voltage and ground to esp. MAX9814 (mic) out pin → PCM1808 ADC R_IN
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you so much for taking the time to help me! I'll try this when I have time.
Beta Was this translation helpful? Give feedback.
All reactions
-
If you have any more questions, you are welcome)
Beta Was this translation helpful? Give feedback.