Maker Pro
Maker Pro

Piggybacking ADCs

Hi all,
I am in the process of designing various controls for car audio. One
of them involves reading an analogue line. Currently the line I need
to read is pulled high via a 10K resistor and read directly into a
microprocessor. The line is switched to ground via various resistance
values to determine button presses. What I need to do is also read
this line into another microprocessor at the same time.

My problem at the moment, if I connect the pin directly to the second
micro, is that when buttons are pressed, the value is correct while
the button is held but when released the voltage takes time to return
to 5v, during which time the first micro reads different values,
resulting in wrong outputs.

My initial thought was that the second ADC was loading the line beyond
what the pullup resistor could provide, and changed it to a 5K. This
still results in the same symptoms, all of the time a button press
resulting in less than a milliamp current.

Can anyone shed some light on the matter?

Regards
Big Valven
 
Well, this has been a waste of time...

Not to mention the spam and crap all over this site... this is a
disgusting example of a discussion system.
 
W

Winfield

Well, this has been a waste of time...

Not to mention the spam and crap all over this site...
this is a disgusting example of a discussion system.

Strange, I didn't see your post of Dec 3rd, perhaps
others didn't either. As you know usenet is not a
privately-run network, and it is therefore vulnerable
to misuse. But despite this, many of us still prefer
it to various privately-operated discussion systems.
Thankfully it's not usually as bad as it has gotten
to be lately.

WRT your question, asking about the rate of return
to +5 after release of a pulldown switch, we have to
ask, how much capacitance is on that shared line?
How slow is the risetime you observe, and does this
match your high-Z oscilloscope-probe observations?
 
F

Fred Bloggs

Well, this has been a waste of time...

Not to mention the spam and crap all over this site... this is a
disgusting example of a discussion system.

When your question is full of vague descriptions like:"My problem at the
moment, if I connect the pin directly to the second micro, is that when
buttons are pressed, the value is correct while the button is held but
when released the voltage takes time to return to 5v, during which time
the first micro reads different values, resulting in wrong outputs...,"
no one is going to bother trying to answer because we can only guess
what you're working with. The fact that you describe what is possibly
the ADC input of a micro as a "pin" and the voltage takes "time" to do
this or that is a "disgusting example" of attempting to ask a question...
 
J

John Fields

Hi all,
I am in the process of designing various controls for car audio. One
of them involves reading an analogue line. Currently the line I need
to read is pulled high via a 10K resistor and read directly into a
microprocessor. The line is switched to ground via various resistance
values to determine button presses.
What I need to do is also read
this line into another microprocessor at the same time.

My problem at the moment, if I connect the pin directly to the second
micro, is that when buttons are pressed, the value is correct while
the button is held but when released the voltage takes time to return
to 5v, during which time the first micro reads different values,
resulting in wrong outputs.

---
If this is what you're doing, then switch bounce is going to eat you
alive: (View in Courier)


Vcc>----------+
|R1
[10K] µC1
| +-----+
+----+----|ADCIN|
| | +-----+
[R2] |
___ | | µC2
+--O O--+ | +-----+
| S1 | +----|ADCIN|
| [R3] +-----+
| ___ |
+--O O--+
| S2 |
| [R4]
| ___ |
+--O O--+
. S3 .
. [Rn]
. ___ .
GND---+--O O--+
Sn
---
My initial thought was that the second ADC was loading the line beyond
what the pullup resistor could provide, and changed it to a 5K. This
still results in the same symptoms, all of the time a button press
resulting in less than a milliamp current.

---
I doubt whether that's the problem, but if it is it's easily
remedied like this:

Vcc>----------+----------+
|R1 |
[10K] |
| | µC1
+----+----|+\ +-----+
| | | >--+--|ADCIN|
[R2] | +-|-/U1A| +-----+
___ | | | LM358|
+--O O--+ | +-------+
| | |
| [R2] | µC2
| ___ | +----|+\ +-----+
+--O O--+ | >--+--|ADCIN|
| | +-|-/U2B| +-----+
| [R2] | | |
| ___ | +--|----+
+--O O--+ |
. . |
. [Rn] |
. ___ . |
+--O O--+ |
| |
GND---+------------------+
---

Can anyone shed some light on the matter?

---
Maybe...

How are you starting your A to D conversion and how are you
determinin whether a button is pressed or not.

I don't mean _which_ button was pressed, that's easy enough, but how
are you determining whether _any_ button has been pressed? Perhaps
a change in the ADC input voltage from the rest state?
 
M

Michael A. Terrell

Well, this has been a waste of time...

Not to mention the spam and crap all over this site... this is a
disgusting example of a discussion system.



It isn't a 'site', it is 'Usenet' that you are accessing through
'Google Groups' piss poor HTML portal to Usenet.

Ironically, most of 'the spam and crap' you are complaing about is
posted by 'Google Groups' users, like yourself.


--
Service to my country? Been there, Done that, and I've got my DD214 to
prove it.
Member of DAV #85.

Michael A. Terrell
Central Florida
 
J

John Fields

Hi all,
I am in the process of designing various controls for car audio. One
of them involves reading an analogue line. Currently the line I need
to read is pulled high via a 10K resistor and read directly into a
microprocessor. The line is switched to ground via various resistance
values to determine button presses.
What I need to do is also read
this line into another microprocessor at the same time.

My problem at the moment, if I connect the pin directly to the second
micro, is that when buttons are pressed, the value is correct while
the button is held but when released the voltage takes time to return
to 5v, during which time the first micro reads different values,
resulting in wrong outputs.

---
If this is what you're doing, then switch bounce is going to eat you
alive: (View in Courier)


Vcc>----------+
|R1
[10K] µC1
| +-----+
+----+----|ADCIN|
| | +-----+
[R2] |
___ | | µC2
+--O O--+ | +-----+
| S1 | +----|ADCIN|
| [R3] +-----+
| ___ |
+--O O--+
| S2 |
| [R4]
| ___ |
+--O O--+
. S3 .
. [Rn]
. ___ .
GND---+--O O--+
Sn
---
My initial thought was that the second ADC was loading the line beyond
what the pullup resistor could provide, and changed it to a 5K. This
still results in the same symptoms, all of the time a button press
resulting in less than a milliamp current.

---
I doubt whether that's the problem, but if it is it's easily
remedied like this:

Vcc>----------+----------+
|R1 |
[10K] |
| | µC1
+----+----|+\ +-----+
| | | >--+--|ADCIN|
[R2] | +-|-/U1A| +-----+
___ | | | LM358|
+--O O--+ | +-------+
| | |
| [R2] | µC2
| ___ | +----|+\ +-----+
+--O O--+ | >--+--|ADCIN|
| | +-|-/U2B| +-----+
| [R2] | | |
| ___ | +--|----+
+--O O--+ |
. . |
. [Rn] |
. ___ . |
+--O O--+ |
| |
GND---+------------------+

---
Aarghhh!!!

Should be:

..Vcc>----------+----------+
.. |R1 |
.. [10K] |
.. | | µC1
.. +----+----|+\ +-----+
.. | | | >--+--|ADCIN|
.. [R2] | +-|-/U1A| +-----+
.. ___ | | | LM358|
.. +--O O--+ | +-------+
.. | S1 | |
.. | [R3] | µC2
.. | ___ | +----|+\ +-----+
.. +--O O--+ | >--+--|ADCIN|
.. | S2 | +-|-/U1B| +-----+
.. | [R4] | | |
.. | ___ | +--|----+
.. +--O O--+ |
.. . S3 . |
.. . [Rn] |
.. . ___ . |
.. +--O O--+ |
.. | Sn |
..GND---+------------------+
 
Top