Skip to contentSkip to conversation

IIO: Interface for capacitance inputs (and outputs)

DISCUSSION Jonathan Cameron 2 participants 7 messages Aug 1, 2011 – Aug 3, 2011 IIO

lore
Share & tools
lore
#0 lore raw

Hi Michael / All,

We have a quite a few capacitance drivers. They are all simple and so would be easy to clean up, except for the fact that we don't have an abi for them.

So lets make one up. How about the following? Main choice is the units... Doing it with Farads leaves us with a lot of needed decimal places, but then we need a lot anyway for these so what the heck. We are going to need those types with holes in them..

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_raw
What: /sys/bus/iio/devices/iio:deviceX/out_capacitanceY_raw
What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY-capacitanceZ_raw
KernelVersion: 3.1
Contact: [email protected]
Description:
Raw (unscaled no bias removal etc) capacitance value from/to channel Y. After application of _offset and _scale, units will be Farads.

Additional entries for:

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_offset
What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_scale

With the ad7745 the capdac does seem to be available off chip. If I understand their use correctly it could just be treated as a _calibbias parameters? (the complexity being that there are two..) Naturally there is also a calibration register so this gets somewhat tricky... Is there an optimum combination for a given desire measurement range?

All comments welcom.

Jonathan

#1 lore raw
Quoted 4 lines · Jonathan Cameron

Hi Michael / All,

We have a quite a few capacitance drivers. They are all simple and so would be easy to clean up, except for the fact that we don't have an ab=

i

Quoted 3 lines

for them.

So lets make one up. How about the following? Main choice is the units=

...

Quoted 1 line

Doing it with Farads leaves us with a lot of needed decimal places, but=

then

Quoted 1 line

we need a lot anyway for these so what the heck. We are going to need =

those

Quoted 1 line

types with holes in them..

Hi Jonathan,

These devices typically feature an single digit pF input range(2..8 pF). Going with a scale in Farads is probably not going to work. What do you mean by types with holes in them?
We need something scanf() and friends can eat...
In addition we have enough scale bits before the decimal point as well. I would make the scale targeting pF of uF.

Quoted 3 lines
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_raw
What:           /sys/bus/iio/devices/iio:deviceX/out_capacitanceY_raw
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY-capaci=

tanceZ_raw

Quoted 4 lines
KernelVersion:  3.1
Contact:        [email protected]

Description:
Raw (unscaled no bias removal etc) capacitance value f=

rom/to

Quoted 1 line

channel Y. After application of _offset and _scale, un=

its will

Quoted 9 lines

be Farads.

Additional entries for:

What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_offset
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_scale

With the ad7745 the capdac does seem to be available off chip.

Why do you think the CAPDAC is off-chip on the AD7745?
The CAPDAC can be seen as a negative capacitance connected internally to the Cin pin.

Quoted 2 lines

If I understand
their use correctly it could just be treated as a _calibbias parameters=

?
Yes - it can be seen as a bias - however why do you have=20 out_capacitanceY_raw then?

Quoted 1 line

(the complexity being that there are two..)

Yes - one for each Cin(+|-) pin.
More tricky on the AD7746, since there are only two CAPDACs for two=20 Cin(+|-) pin pairs.

Quoted 2 lines

Naturally there is also a
calibration register so this gets somewhat tricky...

The calibration register typically holds the zero-scale calibration=20 coefficient.
It's automatically updated following the capacitance offset calibration. Tricky here is that there is only one on the AD7746, so the values must=20 be saved
and restored when switching between the input pairs.

Quoted 4 lines

Is there an optimum
combination for a given desire measurement range?

Yes there is - large offsets > 1 pF should be eliminated by the CAPDACs.

from the datasheet:

CAPACITIVE SYSTEM OFFSET CALIBRATION
The capacitive offset is dominated by the parasitic offset in the=20 application, such as the initial capacitance of the sensor, any=20 parasitic capacitance of tracks on the board, and the capacitance of any=20 other connections between the sensor and the CDC. Therefore, the=20 AD7745/AD7746 are not factory calibrated for capacitive offset. It is=20 the user=92s responsibility to calibrate the system capacitance offset in= =20
the application.
Any offset in the capacitance input larger than =B11 pF should first be=20 removed using the on-chip CAPDACs. The small offset within =B11 pF can=20 then be removed by using the capacitance offset calibration register. One method of adjusting the offset is to connect a zero-scale=20 capacitance to the input and execute the capacitance offset calibration=20 mode. The calibration sets the midpoint of the =B14.096 pF range (that is= ,=20
Output Code 0x800000) to that zero-scale input.
Another method would be to calculate and write the offset cali-bration=20 register value, the LSB is value 31.25 aF (4.096 pF/217).
The offset calibration register is reloaded by the default value at=20 power-on or after reset. Therefore, if the offset calibration is not=20 repeated after each system power-up, the calibration coefficient value=20 should be stored by the host controller and reloaded as part of the=20 AD7745/AD7746 setup.
On the AD7746, the register is shared by the two capacitive channels. If=20 the capacitive channels need to be offset calibrated individually, the=20 host controller software should read the AD7746 capacitive offset=20 calibration register values after performing the offset calibration on=20 individual channels and then reload the values back to the AD7746 before=20 executing a conversion on a different channel.

Quoted 8 lines

All comments welcom.

Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--=20
Greetings,
Michael

--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif

#2 lore raw
Quoted 4 lines · Michael Hennerich
Quoted 3 lines · Jonathan Cameron

Hi Michael / All,

We have a quite a few capacitance drivers. They are all simple and s=

o

Quoted 1 line
Quoted 1 line

would be easy to clean up, except for the fact that we don't have an=

abi

Quoted 3 lines
Quoted 3 lines

for them.

So lets make one up. How about the following? Main choice is the un=

its...

Quoted 1 line
Quoted 1 line

Doing it with Farads leaves us with a lot of needed decimal places, =

but then

Quoted 1 line
Quoted 1 line

we need a lot anyway for these so what the heck. We are going to ne=

ed those

Quoted 5 lines
Quoted 1 line

types with holes in them..

=20
Hi Jonathan,
=20
These devices typically feature an single digit pF input range(2..8 p=

=46).

Quoted 2 lines

Going with a scale in Farads is probably not going to work. What do you mean by types with holes in them?

IIO_VAL_INT_PLUS_FEMTO where FEMTO bit has maximum of 999999999 Thus t= here are quite a
few leading zeros.

Quoted 1 line

We need something scanf() and friends can eat...

Yup.

Quoted 1 line

In addition we have enough scale bits before the decimal point as wel=

l.
Please give an example why. Do we have a calibscale type attribute here= ?

Quoted 1 line

I would make the scale targeting pF of uF.

I thought about that but then we are back to having a fairly illogical = set of
units for the different types of devices.

Quoted 4 lines

=20
=20

Quoted 2 lines
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_raw
What:           /sys/bus/iio/devices/iio:deviceX/out_capacitanceY_ra=

w

Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY-cap=

acitanceZ_raw

Quoted 4 lines
Quoted 4 lines
KernelVersion:  3.1
Contact:        [email protected]

Description:
Raw (unscaled no bias removal etc) capacitance valu=

e from/to

Quoted 1 line
Quoted 1 line

channel Y. After application of _offset and _scale,=

units will

Quoted 5 lines
Quoted 5 lines

be Farads.

Additional entries for:

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_off=

set

Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_sca=

le

Quoted 6 lines
Quoted 3 lines

With the ad7745 the capdac does seem to be available off chip.

Why do you think the CAPDAC is off-chip on the AD7745?
The CAPDAC can be seen as a negative capacitance connected internally to the Cin pin.

Oops. That was meant to be doesn't not does... Sorry for the confusion.

Quoted 3 lines

=20

Quoted 2 lines

If I understand
their use correctly it could just be treated as a _calibbias paramet=

ers?

Quoted 1 line

Yes - it can be seen as a bias - however why do you have out_capacita=

nceY_raw then?
:) Because I hadn't looked at the datasheet properly when I wrote that = bit and forgot
to go back and edit it. This really wasn't my most coherent email ever= =2E Google isn't
feeding me any digital to capacitance devices so looks like the output = side of things
is irrelevant.

Quoted 3 lines
Quoted 1 line

(the complexity being that there are two..)

Yes - one for each Cin(+|-) pin.
More tricky on the AD7746, since there are only two CAPDACs for two C=

in(+|-) pin pairs.
As you state below that you tend to save and restore the zero offset, c= an we not do the
same with the capdac values? If so they can be treated from a userspac= e point of view
as completely independent.=20

Quoted 4 lines

=20

Quoted 2 lines

Naturally there is also a
calibration register so this gets somewhat tricky...

The calibration register typically holds the zero-scale calibration c=

oefficient.

Quoted 1 line

It's automatically updated following the capacitance offset calibrati=

on.

Quoted 1 line

Tricky here is that there is only one on the AD7746, so the values mu=

st be saved

Quoted 7 lines

and restored when switching between the input pairs. =20

Quoted 4 lines

Is there an optimum
combination for a given desire measurement range?

Yes there is - large offsets > 1 pF should be eliminated by the CAPDA=

Cs.
=46air enough. So what is the conclusion for what interface elements w= e
actually need to control this?

Quoted 22 lines

=20
from the datasheet:
=20
CAPACITIVE SYSTEM OFFSET CALIBRATION The capacitive offset is dominated by the parasitic offset in the application, such as the initial capacitance of the sensor, any parasitic capacitance of tracks on the board, and the capacitance of any other connections between the sensor and the CDC. Therefore, the AD7745/AD7746 are not factory calibrated for capacitive offset. It is the user=92s responsibility to calibrate the system capacitance offset in the application. Any offset in the capacitance input larger than =B11 pF should first be removed using the on-chip CAPDACs. The small offset within =B11 pF can then be removed by using the capacitance offset calibration register. One method of adjusting the offset is to connect a zero-scale capacitance to the input and execute the capacitance offset calibration mode. The calibration sets the midpoint of the =B14.096 pF range (that is, Output Code 0x800000) to that zero-scale input. Another method would be to calculate and write the offset cali-bration register value, the LSB is value 31.25 aF (4.096 pF/217). The offset calibration register is reloaded by the default value at power-on or after reset. Therefore, if the offset calibration is not repeated after each system power-up, the

Quoted 12 lines

calibration coefficient value should be stored by the host controller and reloaded as part of the AD7745/AD7746 setup. On the AD7746, the register is shared by the two capacitive channels. If the capacitive channels need to be offset calibrated individually, the host controller software should read the AD7746 capacitive offset calibration register values after performing the offset calibration on individual channels and then reload the values back to the AD7746 before executing a conversion on a different channel.

Quoted 4 lines

All comments welcom.
Jonathan
--=20
To unsubscribe from this list: send the line "unsubscribe linux-iio"=

in

Quoted 5 lines
Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

=20
=20

#3 lore raw
Quoted 6 lines · Jonathan Cameron
Quoted 5 lines · Michael Hennerich
Quoted 4 lines · Jonathan Cameron

Hi Michael / All,

We have a quite a few capacitance drivers. They are all simple and so would be easy to clean up, except for the fact that we don't have an =

abi

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

for them.

So lets make one up. How about the following? Main choice is the uni=

ts...

Quoted 1 line
Quoted 1 line
Quoted 1 line

Doing it with Farads leaves us with a lot of needed decimal places, b=

ut then

Quoted 1 line
Quoted 1 line
Quoted 1 line

we need a lot anyway for these so what the heck. We are going to nee=

d those

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

types with holes in them..

Hi Jonathan,

These devices typically feature an single digit pF input range(2..8 pF=

).

Quoted 3 lines
Quoted 2 lines

Going with a scale in Farads is probably not going to work. What do you mean by types with holes in them?

IIO_VAL_INT_PLUS_FEMTO where FEMTO bit has maximum of 999999999 Thus t=

here are quite a

Quoted 1 line

few leading zeros.

The part has a full range of +/- 4.096pf and it is a 24-bit converter. We like to store the conversion result as 3-byte direct readings from=20 the device result register.

Thus the Farad scale would need to be
8.192E-12 / 2^24 =3D 4.8828125E-19 =3D 0.00000000000000000048828125.

I don't think this makes any sense?

Quoted 3 lines
Quoted 1 line

We need something scanf() and friends can eat...

Yup.

Quoted 1 line

In addition we have enough scale bits before the decimal point as well=

.

Quoted 1 line

Please give an example why. Do we have a calibscale type attribute here=

?
I don't understand, why calibscale would matter here?

But sure we have a in_capacitanceY_scale.
If we say the in_capacitanceY_scale targets pF.

Then we still need enough fractional digits, due to the 24-bit nature of=20 the device.

Now not talking about this part, maybe something that can measure ranges=20 up to 1mF
- which is quite a huge capacitance.
If the scale targets pF, then we actually use the pre-decimal point=20 positions we have.

Quoted 2 lines
Quoted 1 line

I would make the scale targeting pF of uF.

I thought about that but then we are back to having a fairly illogical =

set of

Quoted 1 line

units for the different types of devices.

That's in the nature of these units.
1V, 1A is pretty common 1F is not.
Either move to an floating point exponential notation, or balance the=20 scale somewhere in the middle.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_raw
What:           /sys/bus/iio/devices/iio:deviceX/out_capacitanceY_raw
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY-capa=

citanceZ_raw

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
KernelVersion:  3.1
Contact:        [email protected]

Description:
Raw (unscaled no bias removal etc) capacitance valu=

e from/to

Quoted 1 line
Quoted 1 line
Quoted 1 line

channel Y. After application of _offset and _scale,=

units will

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

be Farads.

Additional entries for:

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_offs=

et

Quoted 1 line
Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_scal=

e

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

With the ad7745 the capdac does seem to be available off chip.

Why do you think the CAPDAC is off-chip on the AD7745?
The CAPDAC can be seen as a negative capacitance connected internally to the Cin pin.

Oops. That was meant to be doesn't not does... Sorry for the confusion.

Quoted 2 lines
Quoted 2 lines

If I understand
their use correctly it could just be treated as a _calibbias paramete=

rs?

Quoted 1 line
Quoted 1 line

Yes - it can be seen as a bias - however why do you have out_capacitan=

ceY_raw then?

Quoted 1 line

:) Because I hadn't looked at the datasheet properly when I wrote that =

bit and forgot

Quoted 1 line

to go back and edit it. This really wasn't my most coherent email ever=

. Google isn't

Quoted 1 line

feeding me any digital to capacitance devices so looks like the output =

side of things

Quoted 4 lines

is irrelevant.

Quoted 3 lines
Quoted 1 line

(the complexity being that there are two..)

Yes - one for each Cin(+|-) pin.
More tricky on the AD7746, since there are only two CAPDACs for two Ci=

n(+|-) pin pairs.

Quoted 1 line

As you state below that you tend to save and restore the zero offset, c=

an we not do the

Quoted 1 line

same with the capdac values? If so they can be treated from a userspac=

e point of view

Quoted 1 line

as completely independent.

Sure

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

Naturally there is also a
calibration register so this gets somewhat tricky...

The calibration register typically holds the zero-scale calibration co=

efficient.

Quoted 1 line
Quoted 1 line

It's automatically updated following the capacitance offset calibratio=

n.

Quoted 1 line
Quoted 1 line

Tricky here is that there is only one on the AD7746, so the values mus=

t be saved

Quoted 7 lines
Quoted 7 lines

and restored when switching between the input pairs.

Quoted 4 lines

Is there an optimum
combination for a given desire measurement range?

Yes there is - large offsets> 1 pF should be eliminated by the CAPDAC=

s.

Quoted 2 lines

Fair enough. So what is the conclusion for what interface elements we actually need to control this?

Let me think about this a bit more.

Quoted 29 lines
Quoted 29 lines

from the datasheet:

CAPACITIVE SYSTEM OFFSET CALIBRATION The capacitive offset is dominated by the parasitic offset in the application, such as the initial capacitance of the sensor, any parasitic capacitance of tracks on the board, and the capacitance of any other connections between the sensor and the CDC. Therefore, the AD7745/AD7746 are not factory calibrated for capacitive offset. It is the user=92s responsibility to calibrate the system capacitance offset in the application. Any offset in the capacitance input larger than =B11 pF should first be removed using the on-chip CAPDACs. The small offset within =B11 pF can then be removed by using the capacitance offset calibration register. One method of adjusting the offset is to connect a zero-scale capacitance to the input and execute the capacitance offset calibration mode. The calibration sets the midpoint of the =B14.096 pF range (that is, Output Code 0x800000) to that zero-scale input. Another method would be to calculate and write the offset cali-bration register value, the LSB is value 31.25 aF (4.096 pF/217). The offset calibration register is reloaded by the default value at power-on or after reset. Therefore, if the offset calibration is not repeated after each system power-up, the calibration coefficient value should be stored by the host controller and reloaded as part of the AD7745/AD7746 setup. On the AD7746, the register is shared by the two capacitive channels. If the capacitive channels need to be offset calibrated individually, the host controller software should read the AD7746 capacitive offset calibration register values after performing the offset calibration on individual channels and then reload the values back to the AD7746 before executing a conversion on a different channel.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

All comments welcom.
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" =

in

Quoted 9 lines
Quoted 4 lines
Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--=20
Greetings,
Michael

--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif

#4 lore raw
Quoted 6 lines · Michael Hennerich
Quoted 5 lines · Jonathan Cameron
Quoted 4 lines · Michael Hennerich
Quoted 3 lines · Jonathan Cameron

Hi Michael / All,

We have a quite a few capacitance drivers. They are all simple and=

so

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

would be easy to clean up, except for the fact that we don't have =

an abi

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

for them.

So lets make one up. How about the following? Main choice is the =

units...

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Doing it with Farads leaves us with a lot of needed decimal places=

, but then

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

we need a lot anyway for these so what the heck. We are going to =

need those

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

types with holes in them..

Hi Jonathan,

These devices typically feature an single digit pF input range(2..8=

pF).

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

Going with a scale in Farads is probably not going to work. What do you mean by types with holes in them?

IIO_VAL_INT_PLUS_FEMTO where FEMTO bit has maximum of 999999999 Thu=

s there are quite a

Quoted 2 lines
Quoted 1 line

few leading zeros.

The part has a full range of +/- 4.096pf and it is a 24-bit converter=

=2E

Quoted 1 line

We like to store the conversion result as 3-byte direct readings from=

the device result register.

Quoted 5 lines

=20
Thus the Farad scale would need to be
8.192E-12 / 2^24 =3D 4.8828125E-19 =3D 0.00000000000000000048828125. =20
I don't think this makes any sense?

It's certainly uggly.

Quoted 4 lines

=20

Quoted 3 lines
Quoted 1 line

We need something scanf() and friends can eat...

Yup.

Quoted 1 line

In addition we have enough scale bits before the decimal point as w=

ell.

Quoted 1 line
Quoted 1 line

Please give an example why. Do we have a calibscale type attribute h=

ere?

Quoted 1 line

I don't understand, why calibscale would matter here?

Because it's the only item I can think of where a value of=20 0.99999999999999999999999999999999999992 would make sense and that's th= e one
nasty case that requires a 'lot' of digits to represent currently).

Quoted 5 lines

=20
But sure we have a in_capacitanceY_scale.
If we say the in_capacitanceY_scale targets pF.
=20
Then we still need enough fractional digits, due to the 24-bit nature=

of the device.
Sure, it's a large number of digits. I'm increasingly wondering if we m= ove everything to
64 bit just to give us the space. This stuff is all ready relatively sl= owly anyway.

Quoted 2 lines

=20
Now not talking about this part, maybe something that can measure ran=

ges up to 1mF

Quoted 2 lines

- which is quite a huge capacitance.
If the scale targets pF, then we actually use the pre-decimal point p=

ositions we have.
=46air point and using that we can go up to very large capacitances if = there is ever the need.

Quoted 4 lines

=20
=20

Quoted 2 lines
Quoted 1 line

I would make the scale targeting pF of uF.

I thought about that but then we are back to having a fairly illogic=

al set of

Quoted 3 lines
Quoted 1 line

units for the different types of devices.

That's in the nature of these units. 1V, 1A is pretty common 1F is not.

I know, but despite that it would be nice to be consistent.

Quoted 1 line

Either move to an floating point exponential notation, or balance the=

scale somewhere in the middle.
We could do the exponential notation I suppose.

Maybe picofarads is the right option.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_r=

aw

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/out_capacitanceY_=

raw

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY-c=

apacitanceZ_raw

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
KernelVersion:  3.1
Contact:        [email protected]

Description:
Raw (unscaled no bias removal etc) capacitance v=

alue from/to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

channel Y. After application of _offset and _sca=

le, units will

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

be Farads.

Additional entries for:

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_o=

ffset

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_s=

cale

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

With the ad7745 the capdac does seem to be available off chip.

Why do you think the CAPDAC is off-chip on the AD7745? The CAPDAC can be seen as a negative capacitance connected internal=

ly

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

to the Cin pin.

Oops. That was meant to be doesn't not does... Sorry for the confusi=

on.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

If I understand
their use correctly it could just be treated as a _calibbias param=

eters?

Quoted 1 line
Quoted 1 line
Quoted 1 line

Yes - it can be seen as a bias - however why do you have out_capaci=

tanceY_raw then?

Quoted 1 line
Quoted 1 line

:) Because I hadn't looked at the datasheet properly when I wrote th=

at bit and forgot

Quoted 1 line
Quoted 1 line

to go back and edit it. This really wasn't my most coherent email e=

ver. Google isn't

Quoted 1 line
Quoted 1 line

feeding me any digital to capacitance devices so looks like the outp=

ut side of things

Quoted 4 lines
Quoted 4 lines

is irrelevant.

Quoted 3 lines
Quoted 1 line

(the complexity being that there are two..)

Yes - one for each Cin(+|-) pin.
More tricky on the AD7746, since there are only two CAPDACs for two=

Cin(+|-) pin pairs.

Quoted 1 line
Quoted 1 line

As you state below that you tend to save and restore the zero offset=

, can we not do the

Quoted 1 line
Quoted 1 line

same with the capdac values? If so they can be treated from a users=

pace point of view

Quoted 5 lines
Quoted 1 line

as completely independent.

Sure

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

Naturally there is also a
calibration register so this gets somewhat tricky...

The calibration register typically holds the zero-scale calibration=

coefficient.

Quoted 1 line
Quoted 1 line
Quoted 1 line

It's automatically updated following the capacitance offset calibra=

tion.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Tricky here is that there is only one on the AD7746, so the values =

must be saved

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

and restored when switching between the input pairs.

Quoted 4 lines

Is there an optimum
combination for a given desire measurement range?

Yes there is - large offsets> 1 pF should be eliminated by the CAP=

DACs.

Quoted 1 line
Quoted 1 line

Fair enough. So what is the conclusion for what interface elements =

we

Quoted 2 lines
Quoted 1 line

actually need to control this?

Let me think about this a bit more.

Will do.

Quoted 8 lines

=20

Quoted 7 lines
Quoted 7 lines

from the datasheet:

CAPACITIVE SYSTEM OFFSET CALIBRATION The capacitive offset is dominated by the parasitic offset in the application, such as the initial capacitance of the sensor, any parasitic capacitance of tracks on the board, and the capacitance of any other connections between the sensor and the CDC. Therefore, the AD7745/AD7746 are no=

t

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

factory calibrated for capacitive offset. It is the user=92s responsibility to calibrate the system capacitance offset in the application. Any offset in the capacitance input larger than =B11 p=

=46

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

should first be removed using the on-chip CAPDACs. The small offset within =B11 pF can then be removed by using the capacitance offset calibration register. One method of adjusting the offset is to connect a zero-scale capacitance to the input and execute the capacitance offset calibration mode. The calibration sets the midpoint of the =B14.096 pF range (that is, Output Code 0x800000) t=

o

Quoted 1 line
Quoted 1 line
Quoted 1 line

that zero-scale input. Another method would be to calculate and wri=

te

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

the offset cali-bration register value, the LSB is value 31.25 aF (4.096 pF/217). The offset calibration register is reloaded by the default value at power-on or after reset. Therefore, if the offset calibration is not repeated after each system power-up, the calibration coefficient value should be stored by the host controll=

er

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

and reloaded as part of the AD7745/AD7746 setup. On the AD7746, the register is shared by the two capacitive channels. If the capacitiv=

e

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

channels need to be offset calibrated individually, the host controller software should read the AD7746 capacitive offset calibration register values after performing the offset calibration on individual channels and then reload the values back to the AD774=

6

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

before executing a conversion on a different channel.

Quoted 4 lines

All comments welcom.
Jonathan
--=20
To unsubscribe from this list: send the line "unsubscribe linux-ii=

o" in

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--=20
To unsubscribe from this list: send the line "unsubscribe linux-iio"=

in

Quoted 5 lines
Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

=20
=20

#5 lore raw
Quoted 7 lines · Jonathan Cameron
Quoted 6 lines · Michael Hennerich
Quoted 5 lines · Jonathan Cameron
Quoted 4 lines · Michael Hennerich
Quoted 3 lines · Jonathan Cameron

Hi Michael / All,

We have a quite a few capacitance drivers. They are all simple and =

so

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

would be easy to clean up, except for the fact that we don't have a=

n abi

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

for them.

So lets make one up. How about the following? Main choice is the u=

nits...

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Doing it with Farads leaves us with a lot of needed decimal places,=

but then

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

we need a lot anyway for these so what the heck. We are going to n=

eed those

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

types with holes in them..

Hi Jonathan,

These devices typically feature an single digit pF input range(2..8 =

pF).

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

Going with a scale in Farads is probably not going to work. What do you mean by types with holes in them?

IIO_VAL_INT_PLUS_FEMTO where FEMTO bit has maximum of 999999999 Thus=

there are quite a

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

few leading zeros.

The part has a full range of +/- 4.096pf and it is a 24-bit converter. We like to store the conversion result as 3-byte direct readings from =

the device result register.

Quoted 9 lines
Quoted 5 lines

Thus the Farad scale would need to be
8.192E-12 / 2^24 =3D 4.8828125E-19 =3D 0.00000000000000000048828125.

I don't think this makes any sense?

It's certainly uggly.

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

We need something scanf() and friends can eat...

Yup.

Quoted 1 line

In addition we have enough scale bits before the decimal point as we=

ll.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Please give an example why. Do we have a calibscale type attribute he=

re?

Quoted 3 lines
Quoted 1 line

I don't understand, why calibscale would matter here?

Because it's the only item I can think of where a value of 0.99999999999999999999999999999999999992 would make sense and that's th=

e one

Quoted 5 lines

nasty case that requires a 'lot' of digits to represent currently).

Quoted 4 lines

But sure we have a in_capacitanceY_scale.
If we say the in_capacitanceY_scale targets pF.

Then we still need enough fractional digits, due to the 24-bit nature =

of the device.

Quoted 1 line

Sure, it's a large number of digits. I'm increasingly wondering if we m=

ove everything to

Quoted 1 line

64 bit just to give us the space. This stuff is all ready relatively sl=

owly anyway.

Quoted 1 line
Quoted 1 line

Now not talking about this part, maybe something that can measure rang=

es up to 1mF

Quoted 2 lines
Quoted 2 lines

- which is quite a huge capacitance.
If the scale targets pF, then we actually use the pre-decimal point po=

sitions we have.

Quoted 1 line

Fair point and using that we can go up to very large capacitances if th=

ere is ever the need.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

I would make the scale targeting pF of uF.

I thought about that but then we are back to having a fairly illogica=

l set of

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

units for the different types of devices.

That's in the nature of these units.
1V, 1A is pretty common 1F is not.

I know, but despite that it would be nice to be consistent.

Quoted 1 line

Either move to an floating point exponential notation, or balance the =

scale somewhere in the middle.

Quoted 4 lines

We could do the exponential notation I suppose.

Maybe picofarads is the right option.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_ra=

w

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/out_capacitanceY_r=

aw

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY-ca=

pacitanceZ_raw

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
KernelVersion:  3.1
Contact:        [email protected]

Description:
Raw (unscaled no bias removal etc) capacitance v=

alue from/to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

channel Y. After application of _offset and _sca=

le, units will

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

be Farads.

Additional entries for:

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_of=

fset

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_sc=

ale

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

With the ad7745 the capdac does seem to be available off chip.

Why do you think the CAPDAC is off-chip on the AD7745?
The CAPDAC can be seen as a negative capacitance connected internall=

y

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

to the Cin pin.

Oops. That was meant to be doesn't not does... Sorry for the confusio=

n.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

If I understand
their use correctly it could just be treated as a _calibbias parame=

ters?

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Yes - it can be seen as a bias - however why do you have out_capacit=

anceY_raw then?

Quoted 1 line
Quoted 1 line
Quoted 1 line

:) Because I hadn't looked at the datasheet properly when I wrote tha=

t bit and forgot

Quoted 1 line
Quoted 1 line
Quoted 1 line

to go back and edit it. This really wasn't my most coherent email ev=

er. Google isn't

Quoted 1 line
Quoted 1 line
Quoted 1 line

feeding me any digital to capacitance devices so looks like the outpu=

t side of things

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

is irrelevant.

Quoted 3 lines
Quoted 1 line

(the complexity being that there are two..)

Yes - one for each Cin(+|-) pin.
More tricky on the AD7746, since there are only two CAPDACs for two =

Cin(+|-) pin pairs.

Quoted 1 line
Quoted 1 line
Quoted 1 line

As you state below that you tend to save and restore the zero offset,=

can we not do the

Quoted 1 line
Quoted 1 line
Quoted 1 line

same with the capdac values? If so they can be treated from a usersp=

ace point of view

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

as completely independent.

Sure

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

Naturally there is also a
calibration register so this gets somewhat tricky...

The calibration register typically holds the zero-scale calibration =

coefficient.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

It's automatically updated following the capacitance offset calibrat=

ion.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Tricky here is that there is only one on the AD7746, so the values m=

ust be saved

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

and restored when switching between the input pairs.

Quoted 4 lines

Is there an optimum
combination for a given desire measurement range?

Yes there is - large offsets> 1 pF should be eliminated by the CAP=

DACs.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Fair enough. So what is the conclusion for what interface elements w=

e

Quoted 3 lines
Quoted 2 lines
Quoted 1 line

actually need to control this?

Let me think about this a bit more.

Will do.

Hi Jonathan,

I don't think it's practical or fits the typical use case to just have=20 _calibbias handling both.
How about following -

The cap offset calibration register maps to _calibbias and handles the=20 small calibration offsets.
We also need a do calibrate attribute...

For the larger CAPDAC offsets, we introduce in_capacitanceY_bias. in_capacitanceY_offset would be nicer, but we already use it for other=20 purposes.

Thoughts?

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

from the datasheet:

CAPACITIVE SYSTEM OFFSET CALIBRATION The capacitive offset is dominated by the parasitic offset in the application, such as the initial capacitance of the sensor, any parasitic capacitance of tracks on the board, and the capacitance of any other connections between the sensor and the CDC. Therefore, the AD7745/AD7746 are not factory calibrated for capacitive offset. It is the user=92s responsibility to calibrate the system capacitance offset in the application. Any offset in the capacitance input larger than =B11 pF should first be removed using the on-chip CAPDACs. The small offset within =B11 pF can then be removed by using the capacitance offset calibration register. One method of adjusting the offset is to connect a zero-scale capacitance to the input and execute the capacitance offset calibration mode. The calibration sets the midpoint of the =B14.096 pF range (that is, Output Code 0x800000) to that zero-scale input. Another method would be to calculate and writ=

e

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

the offset cali-bration register value, the LSB is value 31.25 aF (4.096 pF/217). The offset calibration register is reloaded by the default value at power-on or after reset. Therefore, if the offset calibration is not repeated after each system power-up, the calibration coefficient value should be stored by the host controlle=

r

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

and reloaded as part of the AD7745/AD7746 setup. On the AD7746, the register is shared by the two capacitive channels. If the capacitive channels need to be offset calibrated individually, the host controller software should read the AD7746 capacitive offset calibration register values after performing the offset calibration on individual channels and then reload the values back to the AD7746 before executing a conversion on a different channel.

Quoted 4 lines

All comments welcom.
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-iio=

" in

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" =

in

Quoted 9 lines
Quoted 4 lines
Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--=20
Greetings,
Michael

--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif

#6 lore raw
Quoted 111 lines
Quoted 101 lines
Quoted 18 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Hi Michael / All,

We have a quite a few capacitance drivers. They are all simple and so would be easy to clean up, except for the fact that we don't have an abi for them.

So lets make one up. How about the following? Main choice is the units... Doing it with Farads leaves us with a lot of needed decimal places, but then we need a lot anyway for these so what the heck. We are going to need those types with holes in them..

Quoted 7 lines
Quoted 5 lines

Hi Jonathan,

These devices typically feature an single digit pF input range(2..8 pF). Going with a scale in Farads is probably not going to work. What do you mean by types with holes in them?

IIO_VAL_INT_PLUS_FEMTO where FEMTO bit has maximum of 999999999 Thus there are quite a few leading zeros.

Quoted 7 lines

The part has a full range of +/- 4.096pf and it is a 24-bit converter.
We like to store the conversion result as 3-byte direct readings from the device result register.

Thus the Farad scale would need to be
8.192E-12 / 2^24 = 4.8828125E-19 = 0.00000000000000000048828125.

I don't think this makes any sense?

It's certainly uggly.

Quoted 5 lines
Quoted 4 lines
Quoted 1 line

We need something scanf() and friends can eat...

Yup.

Quoted 1 line

In addition we have enough scale bits before the decimal point as well.

Please give an example why. Do we have a calibscale type attribute here?

I don't understand, why calibscale would matter here?

Because it's the only item I can think of where a value of 0.99999999999999999999999999999999999992 would make sense and that's the one nasty case that requires a 'lot' of digits to represent currently).

Quoted 4 lines

But sure we have a in_capacitanceY_scale.
If we say the in_capacitanceY_scale targets pF.

Then we still need enough fractional digits, due to the 24-bit nature of the device.

Sure, it's a large number of digits. I'm increasingly wondering if we move everything to 64 bit just to give us the space. This stuff is all ready relatively slowly anyway.

Quoted 3 lines

Now not talking about this part, maybe something that can measure ranges up to 1mF
- which is quite a huge capacitance.
If the scale targets pF, then we actually use the pre-decimal point positions we have.

Fair point and using that we can go up to very large capacitances if there is ever the need.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I would make the scale targeting pF of uF.

I thought about that but then we are back to having a fairly illogical set of units for the different types of devices.

That's in the nature of these units.
1V, 1A is pretty common 1F is not.

I know, but despite that it would be nice to be consistent.

Quoted 1 line

Either move to an floating point exponential notation, or balance the scale somewhere in the middle.

We could do the exponential notation I suppose.

Maybe picofarads is the right option.

Quoted 46 lines
Quoted 28 lines
Quoted 12 lines
Quoted 12 lines
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_raw
What:           /sys/bus/iio/devices/iio:deviceX/out_capacitanceY_raw
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY-capacitanceZ_raw
KernelVersion:  3.1
Contact:        [email protected]

Description:
Raw (unscaled no bias removal etc) capacitance value from/to channel Y. After application of _offset and _scale, units will be Farads.

Additional entries for:

Quoted 8 lines
Quoted 5 lines
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_offset
What:           /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_scale

With the ad7745 the capdac does seem to be available off chip.

Why do you think the CAPDAC is off-chip on the AD7745?
The CAPDAC can be seen as a negative capacitance connected internally to the Cin pin.

Oops. That was meant to be doesn't not does... Sorry for the confusion.

Quoted 3 lines
Quoted 2 lines

If I understand
their use correctly it could just be treated as a _calibbias parameters?

Yes - it can be seen as a bias - however why do you have out_capacitanceY_raw then?

:) Because I hadn't looked at the datasheet properly when I wrote that bit and forgot to go back and edit it. This really wasn't my most coherent email ever. Google isn't feeding me any digital to capacitance devices so looks like the output side of things is irrelevant.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

(the complexity being that there are two..)

Yes - one for each Cin(+|-) pin.
More tricky on the AD7746, since there are only two CAPDACs for two Cin(+|-) pin pairs.

As you state below that you tend to save and restore the zero offset, can we not do the same with the capdac values? If so they can be treated from a userspace point of view as completely independent.

Sure

Quoted 11 lines
Quoted 11 lines
Quoted 2 lines

Naturally there is also a
calibration register so this gets somewhat tricky...

The calibration register typically holds the zero-scale calibration coefficient. It's automatically updated following the capacitance offset calibration. Tricky here is that there is only one on the AD7746, so the values must be saved and restored when switching between the input pairs.

Quoted 4 lines

Is there an optimum
combination for a given desire measurement range?

Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line

Yes there is - large offsets> 1 pF should be eliminated by the CAPDACs.

Fair enough. So what is the conclusion for what interface elements we actually need to control this?

Let me think about this a bit more.

Will do.

Hi Jonathan,

I don't think it's practical or fits the typical use case to just have _calibbias handling both. How about following -

Quoted 7 lines

The cap offset calibration register maps to _calibbias and handles the small calibration offsets. We also need a do calibrate attribute...

For the larger CAPDAC offsets, we introduce in_capacitanceY_bias. in_capacitanceY_offset would be nicer, but we already use it for other purposes.

Thoughts?

Works for me. Will need to document this very clearly to stop people mixing up _bias and _offset.