Go Down

Topic: Analog Cross-talk within atmega (Read 2400 times) previous topic - next topic

Grumpy_Mike

Quote
Ive had someone else check the circuit and pots and they're fine.

All that means is that they have failed to find the problem.
As you see from multiple people this is not the way this circuit behaves.
You need to post both a schematic and a good photograph of your setup.

N314


Quote
Ive had someone else check the circuit and pots and they're fine.

All that means is that they have failed to find the problem.
As you see from multiple people this is not the way this circuit behaves.
You need to post both a schematic and a good photograph of your setup.


The other person who checked it is an electrical engineer. We monitored voltages going in, supply, ground, and checked the pots. We spent 3 hours on it and TRUST ME... It is contained within the chip, the external circuit is good.

But Ill try to sketch a schematic next time I have a chance to look at it.


-Nick

jtw11

#17
Feb 03, 2013, 12:45 pm Last Edit: Feb 03, 2013, 12:49 pm by jtw11 Reason: 1
Quote
A0 and A2 must be grounded... and that's not all I need to read A0 and A2


I don't quite follow this statement, I didn't think these were the pins you were reading? I thought you were reading 1 and 3? You haven't connected the ground pin of each pot to A0 and A2 respectively have you, with the other pin going to 5v?

I find it strange that you think you've found an issue with the microcontroller, with such a simple circuit... Like you say, post up the schematic - there must be something wrong. :)

MAS3

Quote from: jtw11

I didn't think these were the pins you were reading? I thought you were reading 1 and 3?


This behaviour and why this seems to work, has been explained.
Reading those inputs that are grounded, clears the sample capacitor.
OP says however he has to read the ones which are grounded, and then read the ones he actually wants to read.
That suggests he's reading A0, A2, A1, A3 in that order.
If that is actually true, the previous explanation doesn't make sense, but if the order is A0, A1, A2, A3 is read, it absolutely makes sense.

There seems to be nothing to keep OP from trying this by changing the sketch to read A0, A1, A0, A3.
If that also works, OP will know that clearing the capacitor is needed.
Or waiting for it to have discharged on its own.
By the way, i have seen comments in the examples, telling that you have to wait a bit between 2 consecutive analog reads, this thread explained me why.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

MarkT

One possibility is that the microcontroller is damaged - has this been ruled out?
[ I won't respond to messages, use the forum please ]

N314

Quote
but if the order is A0, A1, A2, A3 is read, it absolutely makes sense.


I am read in A0, A1, A2, A3.

Quote
One possibility is that the microcontroller is damaged - has this been ruled out?


Tried it on an Uno and  a Mega... Same exact problem on each.

I think I just have to read a grounded pin between each real read, so today ill try grounding a A15, and then reading that between each actual reading. To my understanding that should work....?


-Nick

dc42

Your observations do not tally with your description of the circuit. So the circuit is not as we understand it from your description.

One of the first things I suggest you do is measure your pots with a multimeter and make sure they really are 10K from end to end.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Grumpy_Mike

Quote
Tried it on an Uno and  a Mega... Same exact problem on each.

That means you are making exactly the same mistake on both systems.

If you want help to discover what that mistake it then you need to cooperate, we need to see your code, your schematic and a photo of your setup.

oric_dan


Your observations do not tally with your description of the circuit. So the circuit is not as we understand it from your description.

One of the first things I suggest you do is measure your pots with a multimeter and make sure they really are 10K from end to end.

It'a always what they don't tell us that makes the difference. I love it when the answer comes
back as "Oops".

Go Up