Searching \ for '[PIC]: ADC configured as digital IO' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=adc
Search entire site for: 'ADC configured as digital IO'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: ADC configured as digital IO'
2004\04\02@114650 by Eisermann, Phil [Ridg/CO]

flavicon
face
Hi all,

       I have a question on the ADC module that
I'm hoping someone can answer. I am not sure I am
understanding the datasheet correctly, or maybe it
is somewhat ambiguous.

       The brief version is that I am reviewing an
existing project written by someone else in CCS. The
PIC is a 16F819. AN0, AN1, AN2, AN3 are connected to
analog signals measuring voltages, current,
temperature, etc.

       However, in this application ADCON1 configures
PORTA as digital IO (ADCON1 = 0b10000110), and TRISA
configures PORTA as inputs (TRISA = 0b00111111).

       Now, the datasheet DS39598C says in section 11.3
that "Pins configures as digital inputs will convert an
analog input. Analog levels on a digitally configured
input will not affect conversion accuracy" To me, that
says even though its a digital input, the ADC will still
work correctly. That seems plain enough.

       But then it goes on to say "analog levels on any
pin that is configured as digital input (including the
AN4:AN0 pins), may cause the input buffer to consume
current out of the device specification" Which sounds
like a bad thing to me. Does the datasheet specify
anywhere under what conditions this happens? Or do I
have to look elsewhere?

       It sounds to me like Microchip is effectively
saying "yes, it will work, but don't do that". Can
anyone comment? Has anyone on the list used the ADC
module this way? I'm not seeing any good reason to
configure the ADC module this way in light of the
warning on the datasheet, but I could be missing
something.

Thanks for any feedback.

Phil Eisermann
Electronics Engineer
Ridge Tool Co
(440)329-4680

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\04\02@115525 by Bob Blick

face picon face
>         It sounds to me like Microchip is effectively
> saying "yes, it will work, but don't do that". Can
> anyone comment? Has anyone on the list used the ADC
> module this way? I'm not seeing any good reason to
> configure the ADC module this way in light of the
> warning on the datasheet, but I could be missing
> something.

Hi Phil,

The only reason I can think of would be if you had some transducer that
you needed to alternately drive and then sense, and although you had
enough time to modify the TRIS register, you didn't have enough time to
alter the ADCON register.

I have never seen any spec(it would be a hard thing to define) on the
effects on the PIC's input buffer with a non-logic signal. Definitely it
becomes more of an issue at higher supply voltage.

Cheerful regards,

Bob

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\04\02@174309 by Eisermann, Phil [Ridg/CO]

flavicon
face
pic microcontroller discussion list wrote:
>>         It sounds to me like Microchip is effectively
>> saying "yes, it will work, but don't do that". Can
>> anyone comment?
>
> The only reason I can think of would be if you had some transducer
> that you needed to alternately drive and then sense, and although you
> had enough time to modify the TRIS register, you didn't have enough
> time to alter the ADCON register.

Thanks for the feedback. At least I'm not alone in missing the purpose.

>
> I have never seen any spec(it would be a hard thing to define) on the
> effects on the PIC's input buffer with a non-logic signal.

that's what I was thinking; although I couldn't see any reason for the
buffer to draw excessive current unless the analog voltage went above
Vdd or below Vss. Figures 5-2 through 5-4 show the analog module
always connected, and the inputs TTL buffered. Since it's only a
block diagram, there may be something I am missing.



--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\04\03@035400 by Jan-Erik Soderholm

face picon face
Eisermann, Phil [Ridg/CO] wrote :

> pic microcontroller discussion list wrote:
>
> > I have never seen any spec(it would be a hard thing to
> > define) on the effects on the PIC's input buffer with a
> > non-logic signal.
>
> that's what I was thinking; although I couldn't see any reason for the
> buffer to draw excessive current unless the analog voltage went above
> Vdd or below Vss.

Hi.
(This could just as well be EE: topic... :-) )

In the world of CMOS digital logic, any voltage level near the middle of
"1" and "0" could be a problem. The internal buffer gats into a "unknown"
state and might very well draw a lot more current then you'd expected.

This is the same reason why you, in general, should not left input-
pins unconnected. That is, if they don't have some internal pull-up
or something like that, in which case it's just fine to let them float.

So the simple answer is, don't put analog levels on a pin
configured for digital I/O. Note that a "Schmitt Trigger" input pin
probably handles analog signals a bit better...


> Figures 5-2 through 5-4 show the analog module
> always connected, and the inputs TTL buffered. Since it's only a
> block diagram, there may be something I am missing.

Yes, I'd expected to find something that completly shut down
the digital input buffer when in ADC mode...

Jan-Erik.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\04\04@122340 by Mike Hord

picon face
>I have never seen any spec(it would be a hard thing to define) on the
>effects on the PIC's input buffer with a non-logic signal. Definitely it
>becomes more of an issue at higher supply voltage.

I distinctly recall a warning in (probably) the 16F87x datasheet saying
"analog voltage levels on digital inputs can cause outside spec currents
to flow".  That fits nicely with the concept of "crowbar current", where
CMOS circuits have a nasty range in the middle where you have a very
low impedance Rds for both devices at the same time.

Mike H.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar   get it now!
http://toolbar.msn.com/go/onm00200415ave/direct/01/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2004\04\05@030757 by hael Rigby-Jones

picon face
{Quote hidden}

The PIC is based on a CMOS process.  If an input or output is forced to
hover around the midpoint of the supply rails, both of the complimentry
devices will be in partial conduction and thus current draw will be higher.
This is one of the main reasons that higher clock speeds cause the current
consumption to rise so much.

Microchip is saying "yes it will work, but don't expect to meet the supply
current specifications we state".  This will not damage the PIC as the
currents involved are not large, but it may be concern in e.g. a low power
circuit where battery life is a concern.

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.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to
.....postmasterKILLspamspam.....bookham.com.

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu

2004\04\05@041152 by Alan B. Pearce

face picon face
>>>         It sounds to me like Microchip is effectively
>>> saying "yes, it will work, but don't do that". Can
>>> anyone comment?
>>
>> The only reason I can think of would be if you had some transducer
>> that you needed to alternately drive and then sense, and although you
>> had enough time to modify the TRIS register, you didn't have enough
>> time to alter the ADCON register.
>
>Thanks for the feedback. At least I'm not alone in missing the purpose.

I think that you have got sidetracked.

It obviously has to be possible to use the inputs in analogue mode to allow
the ADC to work. However it is known that the ADC hardware does produce a
reasonable increase in current draw. A portion of this current draw may be
the digital input buffer running in analogue mode.

However I think that what the Microchip document is endeavouring to warn
against is the possibility of having the ADC hardware turned off to minimise
the current draw of the PIC, but still having an analogue voltage on the
input that is between the logic 0 and logic 1 states. This will cause the
input buffer to draw current, resulting in a higher than expected power
supply current draw. This could affect the running time of a battery powered
project for example.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspam_OUTmitvma.mit.edu

2004\04\06@010507 by Bob Ammerman

picon face
When a PIC input is configured as an analog input, then the digital input
buffer is disconnected from the pin and held at ground. This will result in
the digital input reading zero, no matter what voltage is on the pin, and it
also avoids the issue of excessive (more than data sheet) current draw
caused by 'shoot through' in the digital input buffer.

OTOH, if you configure a pin to be both an AD input and a digital output,
then the AD will convert the digital output voltage. This could be a useful
way of checking for shorts or other problems on the pin.

Bob Ammerman
RAm Systems

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\04\06@043917 by Spehro Pefhany

picon face
At 01:00 AM 4/6/2004 -0400, you wrote:
>When a PIC input is configured as an analog input, then the digital input
>buffer is disconnected from the pin and held at ground. This will result in
>the digital input reading zero, no matter what voltage is on the pin, and it
>also avoids the issue of excessive (more than data sheet) current draw
>caused by 'shoot through' in the digital input buffer.
>
>OTOH, if you configure a pin to be both an AD input and a digital output,
>then the AD will convert the digital output voltage. This could be a useful
>way of checking for shorts or other problems on the pin.

Cool. So, if I look at PIC16F87XA, if the output pin is sourcing current
and we measure 4V (with 5V Vdd), we know the current (within 3 sigmas) is
between about 10mA and 17mA (13mA typ.)

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
@spam@speffKILLspamspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\04\06@152633 by Harold Hallikainen

face picon face
Another place this might be useful is on the reference input to the A/D.
Say you want to read a pot, but you don't want to be dumping power into
the pot all the time (especially when the system sleeps). Drive the high
end of the pot with RA3 configured BOTH as a digital output AND as the
reference input of the A/D.

Harold


{Quote hidden}

--
FCC Rules Online at http://www.hallikainen.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

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