Searching \ for 'ADC multiplexing' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/io/atod.htm?key=adc
Search entire site for: 'ADC multiplexing'.

Truncated match.
PICList Thread
'ADC multiplexing'
1999\07\31@202043 by Stewart Pye

flavicon
face
Hi...

I need 14 analog inputs on a 16F877. My original plan was to use a 4051
analog mux one one of the analog inputs. After using one for a DAC I'm
having second thaughts...

To get it fast enough Vdd needs to be 12V, then you need open collector
buffers to interface the address lines. Any ideas for a better approach?
Serial AtoD maybe. The application is a midi controller. The voltage is
read off 14 pots. If it has changed the value is output the serial port. So
it has to be fast enough to track multiple knobs moving simultaneously.

Thanks,
Stewart Pye.

1999\07\31@204945 by Jeff Barlow

flavicon
face
How about replacing the pots with rotary encoders?



-----Original Message-----
From: pic microcontroller discussion list
[spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU]On Behalf Of Stewart Pye
Sent: Saturday, July 31, 1999 5:23 PM
To: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
Subject: ADC multiplexing


Hi...

I need 14 analog inputs on a 16F877. My original plan was to use a 4051
analog mux one one of the analog inputs. After using one for a DAC I'm
having second thaughts...

To get it fast enough Vdd needs to be 12V, then you need open collector
buffers to interface the address lines. Any ideas for a better approach?
Serial AtoD maybe. The application is a midi controller. The voltage is
read off 14 pots. If it has changed the value is output the serial port. So
it has to be fast enough to track multiple knobs moving simultaneously.

Thanks,
Stewart Pye.

1999\07\31@215948 by Peter van Hoof

flavicon
face
switch the voltage to the pots and connect the taps with a diode all
together to one pin, you only need one analog input

Peter

> {Original Message removed}

1999\07\31@224141 by paulb

flavicon
face
Stewart Pye wrote:

> I need 14 analog inputs on a 16F877.
...
> To get it fast enough Vdd needs to be 12V,
...
> The application is a midi controller.

 I don't get it?  "To get it fast enough", but it's a MIDI controller?
How fast do you want.  14 pots strobed 50 times per second gives you 700
measurements per second or about 1.3 *milli*seconds per measurement.

 AFAIK, the outright maximum  setup time of the ADC is about 20 µs, and
this chip has a UART, so interleaving ADC acquisition (read one value,
set multiplexer for next) and MIDI sending (300 µs per character) should
be dead simple.

 Have I missed something here?
--
 Cheers,
       Paul B.


'ADC multiplexing'
1999\08\01@073805 by Stewart Pye
flavicon
face
At 12:40 PM 1/08/99 +1000, Paul B. Webster VK2BZC wrote:
>  I don't get it?  "To get it fast enough", but it's a MIDI controller?
>How fast do you want.  14 pots strobed 50 times per second gives you 700
>measurements per second or about 1.3 *milli*seconds per measurement.
>
>  AFAIK, the outright maximum  setup time of the ADC is about 20 µs, and
>this chip has a UART, so interleaving ADC acquisition (read one value,
>set multiplexer for next) and MIDI sending (300 µs per character) should
>be dead simple.
>
>  Have I missed something here?

Actually yes, but it's my fault, I left something out. It also has to merge
incoming midi data......

Not really a problem because the serial input will generate an interrupt.
Rechecking the 4051 datasheet, it doesn't seem too bad afterall, maybe I'll
give it a go. I just thaught there may be a better way to do it.

Regards,
Stewart Pye

1999\08\01@075259 by Stewart Pye

flavicon
face
At 09:57 PM 31/07/99 -0400, Peter van Hoof wrote:
>switch the voltage to the pots and connect the taps with a diode all
>together to one pin, you only need one analog input
>Peter


Sounds like a good idea but... Switch the voltage with what? A
multiplexer/decoder, shift register.. If it was a digital device, wouldn't
the output voltage vary slightly between devices, and not be quite Vdd? And
you'd lose 0.6V accross the diode. Since I only need 7bits of resolution, I
could limit the range to 2.5V but I'm worried that variations in the diode
drop and switch could cause problems.

regards,
Stewart.

>> {Original Message removed}

1999\08\01@075712 by Stewart Pye

flavicon
face
At 05:47 PM 31/07/99 -0700, Jeff Barlow wrote:
>How about replacing the pots with rotary encoders?


I'd like to but I haven't seen any at a comparable price. I only want about
200 pieces to start with.

Stewart.

1999\08\01@095048 by paulb

flavicon
face
Stewart Pye wrote:

> It also has to merge incoming midi data......
> Not really a problem because the serial input will generate an
> interrupt.

 No, the interrupt would be the problem.

> Rechecking the 4051 datasheet, it doesn't seem too bad afterall, maybe
> I'll give it a go. I just thought there may be a better way to do it.

 My suggestions are:

1} Although the chip has interrupts, don't use interrupts unless you
*need* interrupts.  Interrupts on the PIC are very difficult and slow
you down(!).

2} Merging Midi data is tricky, requires an *output* buffer.  When you
detect an incoming MIDI command, as soon as you recognize it, you start
copying it into the output buffer until you come to the end of it, then
you go back to processing pot values.

3} Use a counter to step through the pot values, one at a time, in a
routine which reads one pot value then sets up the next read.  This
routine is called in alternation with the main loop that outputs
characters from the output buffer and listens for incoming MIDI data.

4} You probably want the pot values buffered so that they can be read
even whilst you are occupied passing MIDI data through directly.  You
also may need a "previous" value or a "changed" flag bit for each value,
depending on how urgently you wish to signal them.  It may be adequate
to just read a value, check for incoming serial data and if not, wait
for the conversion then go back and check the next value, assembling a
"change" command in the output buffer for any pot value that is
different from previous.

 Overall, it will probably work fine with "previous" values and not
buffers.  Midi data passing through takes precedence over the ADC scan,
but when the scan picks up again, the pot data may be different again.
No scanning whilst anything is coming in or anything is in the output
buffer.

5} It seems a little more symmetrical if you were to use two 4051
multiplexers feeding two analogue inputs and ignore the others.  Makes
selection of inputs much simpler too.
--
 Cheers,
       Paul B.

1999\08\01@151833 by Harold Hallikainen

picon face
       This should be no problem.  I have a product (the TechMaster at
http://www.dovesystems.com) that reads 24 pots and simultaneously
transmits and receives a 250 kbps datastream on a 16c74 running on a 16
MHz clock.  In that application, all the pots are 10K and between ground
and +5V.  These drive 3 4051's.  Instead of driving the output enable
pins of the 4051's and using a single A/D input, I used 3 A/D inputs,
each driven by a 4051.
       Works real well, and very few parts!

Harold


On Sun, 1 Aug 1999 10:22:30 +1000 Stewart Pye <stewspamKILLspamUQ.NET.AU> writes:
{Quote hidden}

___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

1999\08\02@003757 by Thomas Brandon

flavicon
picon face
I am investigating a very similar project. I'll prob. use a 16F84 and have
probably 32 knobs but the basics are the same. I would be interested to know
how the MIDI merge goes as I was considering adding such a function (or at
least have MIDI in for Sysex config. dumps).
The main problem I can see is dealing with too much data overflowing the
system.
How do you mean merge?
I would suggest that simply merging your data into the incoming MIDI data
with no logic could create problems. Particularly in relation to sysex
dumps. I think you would certainly have to watch for sysex dumps and cease
your MIDI out when a sysex dump was in progress.

I would be most interested to know how it all fits together.
Tom.
----- Original Message -----
Subject: Re: ADC multiplexing
Stewart Pye wrote:
> I need 14 analog inputs on a 16F877.
> The application is a midi controller.
> It also has to merge incoming midi data......

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