marcel-licence / esp32_basic_synth

ESP32 based simple synthesizer project
GNU General Public License v3.0
245 stars 38 forks source link

ADC not seen, no changes in audio or serial output #27

Closed Slider2732 closed 3 years ago

Slider2732 commented 3 years ago

As hinted at in a previous issue (and thank you for that prompt attention), the ADC pots are unfortunately not recognised. Output through the DAC is only a non changing, but nice and mellow organ sound. Enabling the debug output doesn't produce any changes in the serial output, just the initial values are shown. Equipment is: ESP32 Dev, 4067 16 channel Multiplexer, Max 98357A I2S DAC

The following lines were needed in the ADC section for the esp32_basic_synth to compile -

define analogSetCycles

define adcStart

define adcEnd

define adcBusy

The multiplexer does work, on the synth circuit, when tested with the code here: https://gtsdtech.wordpress.com/2018/01/15/esp32-working-with-74hc4067-16-channel-mux-demux/ I changed the pins to be the ones in the esp32basic synth and all was fine, a couple of test LED's flashed as their channels were stepped through.

Have tried various changes, but decided to drop them and ask what may be happening. Thanks for any insight :)

tiretrak commented 3 years ago

try this schematic 1

tiretrak commented 3 years ago

pots

Slider2732 commented 3 years ago

A very useful diagram for others too, thanks tiretrak. That's how my own is wired up, and 8 ADC_INPUTS is correct. After checking all soldering, a test was to disconnect all 8 pots and try just one, with its own GND/Multiplexer/Vcc connections... no change.

Am wondering now if the need to add the includes in the adc section is where I've messed up, though the synth code wouldn't compile without them. Will try another same type multiplexer, just in case something happened to the other.

tiretrak commented 3 years ago

After checking all soldering, a test was to disconnect all 8 pots and try just one, with its own GND/Multiplexer/Vcc connections... no change. all potentiometers must be connected.

tiretrak commented 3 years ago

try connecting one potentiometer C0 or C1 or C2. when cutoff is at minimum, the sound is very quiet

marcel-licence commented 3 years ago

Thanks a lot for the picture. I did also some testing on the DOIT ESP32 DEVKIT. I got it now working. Actually the code works only with the older library: esp32\1.0.4. I hope I find some time to prepare an update for 1.0.6 soon. I commited my changes but changed also the PIN's because I am preparing something new and had some conflicts otherwise.

The PIN settings are now also in the config.h. I will try to put all personal settings into the config file and the rest in the other files to make it easier to work with.

The cutoff at minimum will cut off all frequencies above. So it is normal that you the sound will disappear.

marcel-licence commented 3 years ago

For just trying the ADC without multiplexer you could also set ADC_INPUTS to 1. In addition to that set also ADC_TO_MIDI_LOOKUP_SIZE to 1.

And finally in z_config.ino let only one value inside of the lookup table:

struct adc_to_midi_s adcToMidiLookUp[ADC_TO_MIDI_LOOKUP_SIZE] = { {0, 0x10}, };

Slider2732 commented 3 years ago

Ah OK, good clarification.

I downgraded to 1.04 and gained functionality immediately with the latest commit! The code compiles fine without the #includes.

Update: Only pot 4 worked and showed on the serial output. Changed the ADC pins in the audio kit section...for how mine is wired and all now works perfectly.

define ADC_INPUTS 8

define ADC_MUL_S0_PIN 23 // 33

define ADC_MUL_S1_PIN 18 // 32

define ADC_MUL_S2_PIN 14 // 13

define ADC_MUL_SIG_PIN 12

endif / ESP32_AUDIO_KIT /

Great troubleshooting, thanks guys :)