How to set different voltage references for ADC0 and ADC1?

Status
Not open for further replies.

wayfaerer

New member
Hi! I am using a Teensy 3.2 by itself, without the audio board, and I am working on a guitar pedal. I am using the Audio Library GUI tool.

The default behavior of the Audio Library GUI is to use the Teensy's internal 1.2V reference. I am OK with that for my guitar signal. However, I don't see a way to send 1.2V to any pots, and I think the preferred approach would be to send them the 3.3V supply voltage anyway.

From this thread (second post) I can see which of the two ADCs control which analog input pins.

It seems to me the ideal solution would be to set one ADC to use the internal 1.2V reference and use that for the guitar, and the other ADC to the 3.3V reference and use that for the pots. However I have no idea how to do this. Here is my code:

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

AudioInputAnalog adc1(A4); // Note: A4 is on ADC0
AudioFilterStateVariable filter1;
AudioOutputAnalog dac1;
AudioConnection patchCord1(adc1, 0, filter1, 0);
AudioConnection patchCord2(filter1, 0, dac1, 0);

void setup() {
  AudioMemory(12);
  pinMode(A15, INPUT); // For reading the pot. Note this is on ADC1 and the guitar input is on ADC0.
  // How to set voltage reference to Vcc for ADC1 only???
}

void loop() {
  // analogRead() should be OK here because A15 is on a different ADC than the guitar input
  filter1.frequency(analogRead(A15); // Set frequency based on the pot
}

As far as I know there is only the function
Code:
analogReference()
but this changes the setting for both ADCs.
 
Well that's just embarrassing. I tried searching, but must have missed it due to the ambiguous title.

Thanks!
 
Status
Not open for further replies.
Back
Top