ADCS not working on 4.1 - What am i doing wrong?

donperryjm

Well-known member
If i change this to the mono audio design scheme, it works, sound is passed to the USB
However, using this in stereo doesn't work on the 4.1

This same code works on the 3.5

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include <avr/wdt.h>
#include "SerialCom.h"
#include "settings.h"
#include "RunningAverage.h"
#include "Spark.h"
#include "quickPWM.h"

// GUItool: begin automatically generated code
AudioInputAnalogStereo   adcs1(A2, A3);       //xy=151,366.0000047683716
AudioFilterBiquad        biquad1R;       //xy=399,397
AudioFilterBiquad        biquad1L;       //xy=406,284
AudioAmplifier           amp1L;          //xy=568,266
AudioAmplifier           amp1R;          //xy=578,386
AudioAnalyzePeak         peakR;          //xy=660,654
AudioOutputUSB           usb2;           //xy=814,349
AudioAnalyzePeak         peakL;          //xy=818,114
AudioConnection          patchCord1(adcs1, 0, biquad1L, 0);
AudioConnection          patchCord2(adcs1, 1, biquad1R, 0);
AudioConnection          patchCord3(biquad1R, amp1R);
AudioConnection          patchCord4(biquad1L, amp1L);
AudioConnection          patchCord5(amp1L, peakL);
AudioConnection          patchCord6(amp1L, 0, usb2, 0);
AudioConnection          patchCord7(amp1R, peakR);
AudioConnection          patchCord8(amp1R, 0, usb2, 1);
// GUItool: end automatically generated code

AudioOutputI2S2           unused_but_needed_output;

RunningAverage myRa_RPM(12);

 
void setup()
{
 
	AudioMemory(12);
 

	for (int i = 0; i < 4; i++) {
		//startup light
		digitalWrite(13, !digitalRead(13));
		delay(100);
	}

	amp1L.gain(55.2);  //used to be 30
	amp1R.gain(85.2);  //used to be 30
	
	float filterboost = (1.0); 
	biquad1L.setHighpass(0, 5000, filterboost);  
	biquad1L.setLowpass(1, 8000, filterboost); 
	biquad1R.setHighpass(0, 5000, filterboost);  
	biquad1R.setLowpass(1, 8000, filterboost);  
	 
}
 

 
void loop()
{

	return;
}
 
AudioInputAnalogStereo doesn't work on Teensy 4.

AudioInputAnalog in 1.56 sort of works. The newer code on github (not yet in any release) is much better.
 
Ok. That explains it. I got away with using opamp on the 4.1 Analog input (mono)
But the stereo I see won't work.
I guess that means the the external audio i2s Adc will be needed.
 
AudioInputAnalogStereo doesn't work on Teensy 4.

AudioInputAnalog in 1.56 sort of works. The newer code on github (not yet in any release) is much better.
Hey Paul, has this changed, or is AudioInputAnalogStereo not going to be ported over to Teensy 4?

Doing some testing now and I'm noticing that if I initialize two AudioInputAnalog connections to AnalyzeRMS, I get heartbeat-like pulses of noise coming in through the first channel. Initializing just one connection does not cause this. Could using the second ADC for the second connection solve this issue?

Screenshot 2023-12-11 at 10.31.37 PM.jpg
 
Last edited:
Back
Top