analogRead provokes noise on the output

jbax

Member
Greetings, and thanks for the wonderfull teensies !

I have an issue on a product I'm developping.
My project is an audio effect with 1 input and two outputs using a teensy 4.0 and the sgtl5000.
The user has controls on the effects via several push buttons and 5 potentiometers which are hooked on A0,A1,A2, A3, A8
The project is working perfectly except for a noise issue : continuous digital noise int both of the audio outputs, even when the software send complete silence on the DAC outputs.
The cause of the noise are calls to analogRead.
The analog inputs are read continuously in a loop :

- read analog inputs
- read digital inputs
- update effect parameters and get outputs
- update digital outs (few leds)
- wait 5ms

the issue persists if I remove all code except analog reads, playing with the delay confirms the issue (with 1sec delay I hear a clic every second on the output)

We are 2 people working on this project, I handle the software part and my associate the hardware design.
They are analog gain stages pre-ADC and post-DAC.

I searched extensively the forum and google for leads and found theses interesting threads :
https://forum.pjrc.com/threads/69717-High-gain-audio-amp-picks-up-noise-from-analogRead
https://forum.pjrc.com/threads/25553-analogRead-and-audio
https://forum.pjrc.com/threads/63641-audio-input-output-noise

decreasing ADC bit depth, ADC sampling frequency, or even not using the analog inputs is not something we can do unfortunately.

So now the question :
- Could someone confirm that the issue is on the hardware side, I understand that triggering an analog read provokes a current draw from the Teensy which is causing the clics but my analysis may be incomplete.
--> if not, what could I do in software to remove/reduce this noise ? (once again compromising the depth, or sampling rate of analog reads is not feasible without compromising the whole project)
- Is there something that could be done / checked in hardware to reduce/remove this noise, that's not mentioned in the above threads ?

I didn't post any code as i don't expect a solution for my use case, and I don't think there is an issue in the code, but I'm rather expecting a list of checks that I'll give to the person in charge of the electronics (and to be sure I've not omitted anything on the software side of things) and I don't have access to the schematic. Once again, i don't expect someone to do the debugging for us :) but rather leads / ideas/ hypothesis of things we may have overlooked.

Thanks a lot.

JBAX
 
From the linked threads, this one is something you can try in software: https://forum.pjrc.com/threads/6971...rom-analogRead?p=303208&viewfull=1#post303208

You could read 1 of 5 inputs each interrupt, save the results and have the loop code use the values when needed.

As a side note, it seems really strange to me that the software guy/gal on a project does not have access to the schematics. But anyway, high impedance nodes will pick up noise easier than low impedance.
 
Thanks for taking the time to answer.

From the linked threads, this one is something you can try in software: https://forum.pjrc.com/threads/6971...rom-analogRead?p=303208&viewfull=1#post303208
You could read 1 of 5 inputs each interrupt, save the results and have the loop code use the values when needed.

Yes I will try that, don't know why I overlooked it when reading it the first time. I'll report the results here.

As a side note, it seems really strange to me that the software guy/gal on a project does not have access to the schematics. But anyway, high impedance nodes will pick up noise easier than low impedance.
Technically I have access to the schematics but I can't share them here and I don't fully understand them. Thanks for the comment on impedance.

On the meantime the hardware guy butchered a prototype to refactor the ground connections which reduced the noise quite significantly. I will nevertheless try to make it inaudible with the aforementioned solution and keep you updated.

JBAX
 
Greetings, I never thought about replying, late is better than never !
The solution we used (apart from the hardware revisions who lowered the noise) was to increase the sample rate of the ADC to make the noise utrasonic and inaudible.
 
Back
Top