Searching \ for '[PIC] ADC high current, no voltage' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/ios.htm?key=adc
Search entire site for: 'ADC high current, no voltage'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] ADC high current, no voltage'
2006\01\26@004940 by Jake Brownson

picon face
I'm trying to use the ADC on my PIC18F4525. it works great if I hook
up the voltage source from my school's lab. However, if I attach the
adc to the middle of a pot I get very little voltage. Also if I attach
an accelerometer with built in amplification the voltage coming out of
the accel drops way down. If I disconnect from the PIC and measure
voltage, there is plenty. I'm thinking it has something to do w/ the
impedance of the voltage source, so I put a 1k resistor in series,
same results. What am I doing wrong? I can't find any sites that
discuss this specific issue.

Thanks,

~Jake B

2006\01\26@012216 by Jinx

face picon face
> I'm thinking it has something to do w/ the impedance of the
> voltage source, so I put a 1k resistor in series, same results.
> What am I doing wrong ?

Hi Jake, putting the resistor in series is just making it worse.
The impedance needs to go down

For the 18F you need a source impedance of 5k, which would
be a 2k5 pot

However, you can use higher value pots and a longer sampling
time, but you then might have to take the PIC's internal leakage
into consideration

I'm a little surprised at the voltage drop-off with the accelerometer,
but you didn't provide specifics so it might not have a low enough
impedance anyway. An op-amp output is more than low enough
(less than low enough ?) to drive an ADC i/p

You have the PIC set up correctly ?

As for sites that disccuss this, you really need only look for an
op amp circuit that suits your application. A non-inverting
buffer would do it, maybe gain to give you the best range, that
sort of thing

2006\01\26@052837 by Michael Rigby-Jones

picon face


>-----Original Message-----
>From: spam_OUTpiclist-bouncesTakeThisOuTspammit.edu [.....piclist-bouncesKILLspamspam@spam@mit.edu]
>Sent: 26 January 2006 05:50
>To: piclistspamKILLspammit.edu
>Subject: [PIC] ADC high current, no voltage
>
>
>I'm trying to use the ADC on my PIC18F4525. it works great if
>I hook up the voltage source from my school's lab. However, if
>I attach the adc to the middle of a pot I get very little
>voltage. Also if I attach an accelerometer with built in
>amplification the voltage coming out of the accel drops way
>down. If I disconnect from the PIC and measure voltage, there
>is plenty. I'm thinking it has something to do w/ the
>impedance of the voltage source, so I put a 1k resistor in
>series, same results. What am I doing wrong? I can't find any
>sites that discuss this specific issue.

Sounds like you don't have the TRIS register for the A/D port set up correctly and the pin is being driven low.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

2006\01\26@072104 by olin piclist

face picon face
Jinx wrote:
> For the 18F you need a source impedance of 5k, which would
> be a 2k5 pot

You can use up to a 20Kohm pot and still have the wiper impedence not exceed
5Kohms if the ends are driven with voltage sources.


******************************************************************
Embed Inc, Littleton Massachusetts, (978) 742-9014.  #1 PIC
consultant in 2004 program year.  http://www.embedinc.com/products

2006\01\26@095057 by Jake Brownson

picon face
Thanks for all of your responces, this is probably what it is... I am
setting up the ADC as follows

       ADCON0 = 0;
       ADCON1 = 0b00001110;
       ADCON2 = 0b10111010;
       ADCON0bits.ADON = 0b1; /* A->D on */

       PIE1bits.ADIE = 0b1; /* Enable Int */

> Sounds like you don't have the TRIS register for the A/D port set up correctly and the pin is being driven low.

I thought that if I set AN0 to an analog input that disabled all the
digital circuitry and I wouldn't need to worry about TRIS... perhaps I
misunderstood and will check that out in lab today.

Here's some more details on the Accel:
http://www.star-micronics.co.jp/eng/products/sensor/se01.htm

Thanks,

~Jake B

On 1/26/06, Michael Rigby-Jones <.....Michael.Rigby-JonesKILLspamspam.....bookham.com> wrote:
>
>
> >{Original Message removed}

2006\01\26@105341 by Alan B. Pearce

face picon face
>I thought that if I set AN0 to an analog input that
>disabled all the digital circuitry and I wouldn't need
>to worry about TRIS... perhaps I misunderstood and
>will check that out in lab today.

I have a feeling you need to set the appropriate pins up as inputs - but
check the data sheet.

2006\01\26@110527 by Michael Rigby-Jones

picon face


{Quote hidden}

Nope, the datasheets I've read are very clear on this point.  To use a pin as an analog input, you must set it's TRIS bit to make it an input.  All ADCON1 does is switch off the pins digital input buffer to stop it drawing current when the input voltage is mid rail.  You can actually use a pin as an analog input even if it isn't configured as such in ADCON1, though the PIC may draw rather more supply current.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

2006\01\26@161124 by Jake Brownson

picon face
> Nope, the datasheets I've read are very clear on this point.  To use a pin as an analog input, you must set it's TRIS bit to make it an input.  All ADCON1 does is switch off the pins digital input buffer to stop it drawing current when the input voltage is mid rail.  You can actually use a pin as an analog input even if it isn't configured as such in ADCON1, though the PIC may draw rather more supply current.

yup, that was it... I think I was focusing too much on the tAD stuff
that I missed that, thanks for pointing it out, works great now.  I
think I misunderstood that last part to mean it would completely
deactivate the digital parts.

~Jake B

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...