Searching \ for '[PIC] periodic ADC sampling' 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: 'periodic ADC sampling'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] periodic ADC sampling'
2006\01\23@184618 by Marcel Birthelmer

picon face
Hi all,
I tried googling and searching the piclist for some reference implementation
of using the periodic sampling feature of the ADC on a 16F648A, but I
couldn't find anything. Has anyone used this feature successfully?
Thanks.
- Marcel

2006\01\23@202037 by Jinx

face picon face
> ADC on a 16F648A

Hi Marcel, the 648A doesn't have ADC (the 627/628/648 have
analogue comparators) - have you confused it with another chip ?

Also, not aware of "periodic sampling". Not on any PIC I've used
anyway. Presumably you mean this is some automatic feature of the
PIC. Wouldn't have thought this generally the sort of thing you'd
want the PIC in control of

2006\01\23@203452 by Marcel Birthelmer

picon face
Yes, my mistake. I meant the 16F88 . There is a way of triggering the A/D
capture via the CCP module (
http://ww1.microchip.com/downloads/en/devicedoc/30487b.pdf

On 1/23/06, Jinx <spam_OUTjoecolquittTakeThisOuTspamclear.net.nz> wrote:
{Quote hidden}

> -

2006\01\23@203644 by Marcel Birthelmer

picon face
On 1/23/06, Marcel Birthelmer <.....marcelb.listsKILLspamspam@spam@gmail.com> wrote:
>
> Yes, my mistake. I meant the 16F88 . There is a way of triggering the A/D
> capture via the CCP module (http://ww1.microchip.com/downloads/en/devicedoc/30487b.pdf
>
>
> Sorry, message sent prematurely. In the link, it's section 12.7, "Use of
the CCP Trigger". However, this seems like one of those things that's
wrought with land mines and tripwire, so I'd like to take a look at a
working implementation, if anyone has one available.
Thanks,
- Marcel

2006\01\23@215510 by Jinx
face picon face
> In the link, it's section 12.7, "Use of the CCP Trigger"

Ah, I see it now

> working implementation, if anyone has one available.

I"ve never tried that combined feature so can't help, sorry. I'm
sure if you isolated the modules just to try it out, it would work
OK. Then you could build on it

Mchip have several pdfs for CCP and A2D but they all seem
to pre-date the F88, so don't know if you'll find an app note
for this somewhere

2006\01\23@220211 by Marcel Birthelmer

picon face
My evil master plan is to use an ADC pin as my sole input for 6-7 buttons
(using a sufficiently-different resistor in series with each button) and
then sampling the ADC value every few msecs (automatically) to see which
button is being pushed. Of course, if someone has a better way of doing this
(while still only using one pin) I'm all ears.
- Marcel

On 1/23/06, Jinx <joecolquittspamKILLspamclear.net.nz> wrote:
{Quote hidden}

> -

2006\01\23@235124 by Jinx

face picon face


> My evil master plan is to use an ADC pin as my sole input
> for 6-7 buttons (using a sufficiently-different resistor in series
> with each button) and then sampling the ADC value every
> few msecs

In reality Batman may difficultise things with contact bounce.
Still worth a go though - you never know till you try. Let us
know if it works eh ?

2006\01\24@060212 by Gerhard Fiedler

picon face
Jinx wrote:

>> My evil master plan is to use an ADC pin as my sole input for 6-7
>> buttons (using a sufficiently-different resistor in series with each
>> button) and then sampling the ADC value every few msecs
>
> In reality Batman may difficultise things with contact bounce. Still
> worth a go though - you never know till you try. Let us know if it works
> eh ?

I've done something like this with 4 buttons. Sampling every few ms allows
for sufficient debouncing. I didn't use the special trigger feature though.

Actually, I never used any of the special trigger features. Anybody has? Or
are they just too exotic?

Gerhard

2006\01\24@064522 by olin piclist

face picon face
Marcel Birthelmer wrote:
> I tried googling and searching the piclist for some reference
> implementation of using the periodic sampling feature of the ADC on a
> 16F648A, but I couldn't find anything. Has anyone used this feature
> successfully?

Read the manual.  The 16F648A has no A/D.

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

2006\01\24@065728 by olin piclist

face picon face
Marcel Birthelmer wrote:
> Sorry, message sent prematurely. In the link, it's section 12.7, "Use
> of
> the CCP Trigger". However, this seems like one of those things that's
> wrought with land mines and tripwire,

Why?  I've found it to work just like the manual says it does.

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

2006\01\24@072048 by olin piclist

face picon face
Jinx wrote:
> In reality Batman may difficultise things with contact bounce.
> Still worth a go though - you never know till you try. Let us
> know if it works eh ?

You also have to worry about the value looking like one key press while
slewing between two others.  I would run the A/D readings thru a 3 pole or
so low pass filter with a 90% step resonse of about 25mS, then not consider
a new button state valid until the input and output of the filter are within
some tolerance for a few 10s of mS.


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

2006\01\24@074410 by olin piclist

face picon face
Gerhard Fiedler wrote:
> Actually, I never used any of the special trigger features. Anybody
> has? Or are they just too exotic?

Yes.  Certainly not.

There are generally two ways to do PIC 16 periodic A/D sampling when the
period needs to be controlled well.  One is to start a new conversion in a
timer interrupt, then use the A/D interrupt when the conversion is done.
The A/D interrupt routine selects the new channel, and the timer interrupt
comes long enough later to ensure sufficient acqusition time.  I think of
that as the normal case since it doesn't use any additional hardware
considering you probably have a timer 2 clock tick interrupt anyway.

The other way is to use the special event trigger of a CCP module.  This
starts the A/D conversion automatically so you only need a single interrupt
per A/D reading.  Usually CCP modules are too valuable to dedicate to this,
but sometimes you need either the higher speed or low jitter A/D sampling.
The A/D interrupt then doubles as the clock tick interrupt.

On some newer 18F parts, you can set a fixed acquisition time delay from
when the GO bit is set.  It does the acquisition first, then the conversion
automatically and you get a single event when it's done.  The 30F A/Ds are
even more flexible.


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

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