Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to add support for ADC when that option is not available in uC

titusece

Newbie
Joined
Sep 20, 2022
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
43
Hello,
I have a requirement to read analog voltage from Microprocessor LINEIN pin (Line Input for audio jack)
As i.MX8 doesn't have ADC i would like make use LINEIN pin to send analog voltage (0 to 3.3) and want to get as digital value by reading codec registers.
Is it possible ? sharing any insights would be great.
Thanks for the help.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
22,492
Helped
4,643
Reputation
9,302
Reaction score
4,941
Trophy points
1,393
Activity points
148,610
Hi,

I would start with reading the datassheet.

You did not say whether you did. Please do so. Tell us what you understand and tell us what is unclear.

Klaus
 

titusece

Newbie
Joined
Sep 20, 2022
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
43
Thanks for your replies.
Actually most of the microprocessor doesn't have support for ADC interfaces like microcontroller does.
These uC does have CODEC on it to do audio input/output processing to connect Line Input & Output for headphone jack connections, and not for just ADC/DAC purpose. but CODEC will make use of ADC & DAC to achieve the audio thing.
Now my question is that whether we can achieve to read analog voltage level from this interface or not.
Thanks again.

1663701344771.png


Ex: One of external audio codec:
1663701454035.png
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
22,492
Helped
4,643
Reputation
9,302
Reaction score
4,941
Trophy points
1,393
Activity points
148,610
Hi,
A CODEC includes an ADC... besides MUX, DAC and more.
Since there an ADC... use it.

You gave no requirements.
So I don't know what to recommend.

Klaus
 

titusece

Newbie
Joined
Sep 20, 2022
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
43
The IMX8 shows it as having 2 12 bit ADC s -


Note there are a number of methods for an ADC less processor to easily manage an
external ADC solution, from single slope to SAR and beyond.


Regards, Dana.
Thanks Dana. I am using i.MX8M Mini SOC and unable to see ADC in there.
 

titusece

Newbie
Joined
Sep 20, 2022
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
43
Hi,
A CODEC includes an ADC... besides MUX, DAC and more.
Since there an ADC... use it.

You gave no requirements.
So I don't know what to recommend.

Klaus
Thanks Klaus.
My requirement is that my SOC doesn't have a ADC on it but it has audio interface to connect external i2c+i2s based CODEC, so am thinking of using LINEIN pin of CODEC to feed the voltage and read CODEC register to get the digital value of my analog voltage.
Hope you get it. :)
Thank you.
 

danadakk

Advanced Member level 5
Joined
Mar 26, 2018
Messages
1,966
Helped
304
Reputation
624
Reaction score
436
Trophy points
83
Activity points
8,775
in the IMX8MMRM.pdf manual there is no reference to codec of to LINEIN pin ?

And you need to establish if the codec in any part can handle DC as an legit
input for measurement.

Super simple methods of doing A/D conversion, look at

https://archive.org/details/bitsavers_nationaldabook_39221290 pages 2-60 and 2-212



Regards, Dana.
 

dick_freebird

Advanced Member level 5
Joined
Mar 4, 2008
Messages
7,913
Helped
2,234
Reputation
4,477
Reaction score
2,211
Trophy points
1,393
Location
USA
Activity points
63,399
There's a lot of serial-interface ADCs out there (your mention
of I2C?) that might do the job.

I don't believe CODECs are necessarily hardware or including
the ADCs that turn audio / video into bit streams. I have a copy
of a video viewer that's pretty helpless until you download a
package of various CODECs (therefore an existence proof
that a CODEC "can" be software-only). Of course a standalone
CODEC hard product might well incorporate more of the signal
chain, if the end application values this integration.
 

titusece

Newbie
Joined
Sep 20, 2022
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
43
Thanks Dana for your reference and really helpful.
Can you also pls suggest available low cost SPI/I2C based ADC or simple Op-amp based ?
My requirement is that would like to measure voltage of Rechargeable Lithium-ion Polymer Battery 3.7V

1664301669631.png


There's a lot of serial-interface ADCs out there (your mention
of I2C?) that might do the job.

I don't believe CODECs are necessarily hardware or including
the ADCs that turn audio / video into bit streams. I have a copy
of a video viewer that's pretty helpless until you download a
package of various CODECs (therefore an existence proof
that a CODEC "can" be software-only). Of course a standalone
CODEC hard product might well incorporate more of the signal
chain, if the end application values this integration.

Thanks for your response.
 
Last edited by a moderator:

danadakk

Advanced Member level 5
Joined
Mar 26, 2018
Messages
1,966
Helped
304
Reputation
624
Reaction score
436
Trophy points
83
Activity points
8,775
If you look at page 2-60 in my prior link this is pretty much all you
need (ignore the xtal, the COP becomes you IMX) :

1664315063294.png


A comparator, preferably RR single supply, and a RC network, and an internal
PWM. And some code. You ramop the PWM duty cycle which ramps DC level out
of the RC LPF, until comparator trips. More effective is do a binary search algorithm,
like used in a SAR, to do the conversion.

Its not precise, but monitoring a battery V does not need high precision.

Or go to digikey.com, do a search for an 8 or 10 bit A/D with reference, 8 pins,
I2C or SPI or One Wire, plenty of offerings.

Regards, Dana.
 
Last edited:

barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
5,789
Helped
1,162
Reputation
2,336
Reaction score
1,255
Trophy points
1,393
Location
California, USA
Activity points
31,534
Another way to do this (with the same circuit) is to just set the output high and count how long it takes to trip the comparator. It's, again, not too accurate, but you haven't said what you need for accuracy.

But, if it was me, I'd go with a serial ADC. Same space as an opamp and way more accurate.
 

danadakk

Advanced Member level 5
Joined
Mar 26, 2018
Messages
1,966
Helped
304
Reputation
624
Reaction score
436
Trophy points
83
Activity points
8,775
Another way to do this (with the same circuit) is to just set the output high and count how long it takes to trip the comparator. It's, again, not too accurate, but you haven't said what you need for accuracy.

But, if it was me, I'd go with a serial ADC. Same space as an opamp and way more accurate.
2-212 has a RC exponential converter with just R and C -

https://archive.org/details/bitsavers_nationaldabook_39221290 pages 2-60 and 2-212


Regards, Dana.
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top