I need help in writing a program base on C to measure the voltage entering the PIC.
How do I go about to write the program and convert the analog signal to a digital.
Thanks in advance for the help...
Armer175
Joined: 13 Jan 2009 Posts: 12
Posted: Thu Mar 12, 2009 7:20 am
You need to search around the forum and then post a program you at least attempted to start by yourself. I know there are plenty of examples of A2D too.
From what I found here most of the people here don't like it when it seems like you want them to write the code for you. Just my advice for the future.
Good Luck!
dem
Joined: 12 Mar 2009 Posts: 2
Posted: Thu Mar 12, 2009 7:32 am
Thanks for the tip. My bad.
Actually I got another question. As I am dealing with leakage current here and there is a positive and neagative voltage, I was wondering do I need an additional hardware to manipulate the reference level into the positive region or the PIC can be programmed to do so.
John P
Joined: 17 Sep 2003 Posts: 331
Posted: Thu Mar 12, 2009 8:29 am
You'll never be able to measure a negative voltage directly. Yes, you must convert it to somewhere within the power supply range of the PIC. That probably means an op-amp circuit. Possibly you could do it with a passive network (i.e. resistors).
If "measure the voltage entering the PIC" means measuring the PIC's power supply voltage, then I'm afraid that's another thing you can't do directly. What you'd need to do would be to use some very precise voltage standard as a reference for your A/D measurements.
Details of the hardware features of the processor are on the Microchip website.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum