Pages: 1 [2]   Go Down
Author Topic: Analog Cross-talk within atmega  (Read 2173 times)
0 Members and 1 Guest are viewing this topic.
Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34725
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley
« Last Edit: February 03, 2013, 06:49:02 am by jtw11 » Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 51
Posts: 1729
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

0
Offline Offline
Shannon Member
****
Karma: 221
Posts: 12710
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

[ I won't respond to messages, use the forum please ]

Offline Offline
Full Member
***
Karma: 0
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34725
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2927
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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".
Logged

Pages: 1 [2]   Go Up
Jump to: