Thread (1 message) 1 message, 1 author, 2015-05-13

Re: [PATCH 0/2] iio: ti_am335x_adc: Add optional DT properties for tscadc

From: Vignesh R <hidden>
Date: 2015-05-13 07:41:45

Hi Hannes,

On Wednesday 29 April 2015 10:36 AM, Hannes Petermaier wrote:
Hi Vignesh,

any comments on this ?
I didn't hear anything last 2 weeks from you.
Apologies...  For some reason my mail client classified your reply mails
as junk, hence I never look into it.

I agree that making SEL_INM_SWC_3_0, SEL_RFM_SWC_1_0 and SEL_RFP_SWC_2_0
configurable is good to have. But I don't think I will be able to work
on it anytime sooner.

Regards
Vignesh
best regards,
Hannes

----- Forwarded by Hannes Petermaier/Eggelsberg/AT/B&R on 29.04.2015 07:03 
-----
quoted
From: Hannes Petermaier/Eggelsberg/AT/B&R
To: Vignesh R <redacted>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dmitry Torokhov 
[off-list ref], 
quoted
fcooper-l0cyMroinI0@public.gmane.org, Kumar Gala [off-list ref], Ian Campbell<ijc
+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>, Jan Kardell [off-list ref], 
Johannes 
quoted
Pointner [off-list ref], Hartmut Knaack 
[off-list ref], Karol Wrona [off-list ref], Lars-Peter Clausen 
quoted
[off-list ref], linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, 
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, 
quoted
Mark Rutland [off-list ref], Pawel Moll [off-list ref], 
Peter 
quoted
Meerwald [off-list ref], Rob Herring [off-list ref]
Date: 15.04.2015 07:33
Subject: Re: [PATCH 0/2] iio: ti_am335x_adc: Add optional DT properties 
for tscadc
quoted
quoted
Hi Hannes,
Hi Vignesh,
thanks for answer.
quoted
quoted
quoted
would it be possible to add some more channel-specific settings ?

It would be nice to have allmost full control to the STEPCONFIGx 
register.
quoted
At least we need to write the bits

SEL_RFM_SWC_1_0
SEL_INM_SWC_3_0 
SEL_RFP_SWC_2_0 

In the current mainline version only (SEL_INP_SWC_3_0) is written.
So for the other bits "0" is value is used, for my point of view 
this is 
quoted
quoted
quoted
not correct.
quoted
For example if we want to read a value from AIN5 the negative pin 
from 
quoted
quoted
quoted
adc is 
quoted
muxed allways to AIN0.
Sorry... I didn't understand what you meant by"AIN5 is muxed always 
with
quoted
quoted
AIN0"?
Have a look to the TRM (spruh73k.pdf) Page 1740 / Figure 12-2. 
Functional Block Diagram.
quoted
There you can see that the ADC-cell which has two inputs, one positive 
and onenegative.
quoted
Also there are two reference inputs, one positive - one negative.

All this "pins" are muxed, because only one channel per time can be 
sampled.
quoted
This muxes are controlled through the STEPCONFIGx registers.

If you want for example take some measurement from AIN5 the driver muxes 
the 
quoted
positive input from the ADC to AIN5 by setting the bits for SEL_INP<3:0> 
- this is ok.
quoted
But the bits for SEL_INM<3:0> are still 'zero'. 
In summary this results in following mux-setting (regarding page 1771 in 
TRM):
quoted
positive-reference muxed to   VDDA
negative-reference muxed to   VSSA
positive-input muxed to       AIN5
negative-input muxed to       AIN0

From this setup we run into 2 problems:
- the negative input terminal is muxed maybe to wrong potential
In much cases we have a single-ended signal so this setup looks good at 
first,
quoted
because the "Diff_CNTRL" bit is also false. 
In fact there is an influence to the reading if the negative 
input-terminal 
quoted
isn't setup correctly (to VSSA or REFN). 
Maybe i interpret the "Diff_CNTRL" not correctly, there is no detailed 
description within the TRM - maybe some of your workmates can explain 
you the 
quoted
functionality of this bit.

- reference is allways taken from VDDA/VSSA
For a precision measurement you dont't use in normal case the 
analog-supply.
quoted
This rail brings noise, drift - all things whicht we don't need for 
accurate 
quoted
measurement.
quoted
quoted
quoted
In fact i can readout heavy jitter even if AIN5 is connected to 
ground - 
quoted
quoted
quoted
after
quoted
setting up negative adc pin within code (to use REFN)  the readout 
value 
quoted
quoted
quoted
is 0 
quoted
as expected without nameable jitter.
If i short AIN0 also to ground, jitter is also eliminated.
Hmmm... nobody has reported such behavior before. ADC support for
am335x-evm/beaglebone has been there for quite long time, but nobody
reported any jitter on AIN5 line. I think this may be specific to
your setup. Can you provide more info with regard to your setup?
Which kernel? Is it am335x-evm or beaglebone or a custom board?
Maybe nobody does some precision measurement with beaglebone.
For operating some touchscreen or readout a potentiometer for evaluation 
quoted
purpose it is still good enough.

Kernel is current mainline, 4.0
Board is some custom board of my company.
But all this parameters shouldn't have some influence to the case.
quoted
quoted
quoted
Maybe this is also some fault of TI SoC ... in normal case somebody 
quoted
quoted
quoted
could 
quoted
expect, that negative adc pin is equal even the Diff_CNTRL bit 
isn't set 
quoted
quoted
quoted
- but
quoted
in practice it isn't.

Also actually it isn't possible to make some accurate measurement 
due to 
quoted
quoted
quoted
the 
quoted
fact that allways VDDA_ADC is used as positive reference.

So it would be nice to have control around this bits.
Whats your opinion around that?
Sorry, I am not yet clear on your bug/use-case.

Please comment inline while replying on mailing list
okay so ?
quoted
Regards
Vignesh
best regards,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help