Previous in Forum: How to send the output of a sensor to another place using internet protocol?   Next in Forum: SN3525an testing circuit
Close
Close
Close
2 comments
Rate Comments: Nested
Anonymous Poster

Analog to Digital Conversion By Pic Microcontroller

02/21/2009 10:53 AM

I want to know how a Pic Microcontroller can be used for analog to digital conversion ???? can u give some code in C or Assembly language...

urgent

Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru
United Kingdom - Member - Olde Member!! Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jul 2006
Location: Dunstable, England
Posts: 2821
Good Answers: 45
#1

Re: Analog to Digital Conversion By Pic Microcontroller

02/21/2009 4:01 PM

Assuming you don't use a PIC micro with an A to D built in and you're not after great accuracy.

The simplest way would be to use an I/O pin with a capacitor and resistor on it and time the charge onto the capacitor to change state, then changing the I port to an output port discharge the capacitor and repeat....

Use a simple lookup table to convert from an exponential voltage related to charge to a linear V vs charge and its done!!!

__________________
A little knowledge is a dangerous thing - Googling is far worse!
Reply Score 1 for Good Answer
Guru
Hobbies - Musician - Engineering Fields - Chemical Engineering - New Member Engineering Fields - Control Engineering - New Member Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jan 2007
Location: Moses Lake, WA, USA, Thulcandra - The Silent Planet (C.S. Lewis)
Posts: 4216
Good Answers: 194
#2

Re: Analog to Digital Conversion By Pic Microcontroller

02/21/2009 9:02 PM

Guest,

There are many PICs that have analog inputs already. Seeing that PICs are relatively cheap, I would purchase one of these. Most are 10-bit.

Mike

BTW, GA Electroman!

__________________
"Reason is not automatic. Those who deny it cannot be conquered by it. Do not count on them. Leave them alone." - Ayn Rand
Reply
Reply to Forum Thread 2 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!

Previous in Forum: How to send the output of a sensor to another place using internet protocol?   Next in Forum: SN3525an testing circuit

Advertisement