Analog and Digital through one socket - AGND OK?

Status
Not open for further replies.

speed12

Member
First - and very important! - thing; I am NOT looking to have Analog and Digital through one socket at the same time - I just couldn't think of a better wording for the title!

I am currently building a MIDI controller using a Teensy 3.2. One of the 'features' I am looking to add is a 1/4" jack that could take input either from an external 2 button controller or from an external expression pedal. The idea is that the program would usually be set up to read one or the other (haven't decided which yet) but if a button on the main controller is held down on startup it switches to the other instead.

What I would like to know is:
- The external expression pedal won't be enormously high resolution - all readings will be converted to 0-127 MIDI once 'inside' - is it sill best to use AGND for this connection?
- In order to switch between digital and analog readings is it OK to use AGND with the input pin set to DIGITAL_READ? If that setting were active there would be no other analog readings happening; so AGND would only ever be used only for analog or only for digital, not a mix of both. As AGND and GND are, I believe, tied together internally with a ferrite and some other bits I think this is OK but wanted to confirm.

Cheers!
 
You should probably use GND if the signal could be digital.

GND works fine for both analog and digital.

AGND is meant for analog only. If you have "noisy digital stuff", AGND can work better than GND to keep the sensitive analog signals separated from the currents flowing through the ground wires. But it most other circumstances, AGND works about the same as GND for analog signals.

The reverse is not true. AGND is not good for digital, because of the ferrite bead. GND is the general all-purpose pin to use if you'll have both types of signals.
 
Hi,
Could you use an ADC input for both, and just use a threshold in your code for the digital input?
 
You should probably use GND if the signal could be digital.

GND works fine for both analog and digital.

AGND is meant for analog only. If you have "noisy digital stuff", AGND can work better than GND to keep the sensitive analog signals separated from the currents flowing through the ground wires. But it most other circumstances, AGND works about the same as GND for analog signals.

The reverse is not true. AGND is not good for digital, because of the ferrite bead. GND is the general all-purpose pin to use if you'll have both types of signals.

Ah cool, that makes sense - thanks for the explanation.

Could you use an ADC input for both, and just use a threshold in your code for the digital input?

Yep, good shout, that would work as well.

I'll give both (using GND for the analog expression signal, and reading the button as an analog signal) and see which looks best; I think both will work well but good to now know a bit more about AGND.

Cheers!
 
Status
Not open for further replies.
Back
Top