Using SliceKit to measure 2 simultaneous voltages

Technical questions regarding the XTC tools and programming with XMOS.
Greg
New User
Posts: 3
Joined: Wed Nov 20, 2013 7:19 pm

Using SliceKit to measure 2 simultaneous voltages

Post by Greg »

I am trying to use the sliceKit to precisely measure 2 signals. Currently, I want to input the analog signals into the GPIO slice. I need 32 bit precision on each signal, so I am using one tile on the main board for each signal. I'm not sure if it would be better to input the signal to the audio slice rather than the GPIO slice. Also, can I input 2 signals on the slice and read them at the same precision or do I need to put each signal on a separate slice? I'm new to microcontrollers, so any help is appreciated.

Thanks


User avatar
TSC
Experienced Member
Posts: 111
Joined: Sun Mar 06, 2011 11:39 pm

Post by TSC »

32-bit analogue to digital (ADC) precision is far higher than what's normally possible in real life.

That would mean 2^32 or 4294967296 possible levels. If for example you were measuring a signal that has lower and upper bounds of 0 and 5 V, that would result in an analogue resolution of 1164 pV (picovolts or 10^-12 volts).

You need to decide on the actual precision you need, the accuracy you need (precision/resolution and accuracy are different things) and the maximum sample rate required.

The GPIO Slice uses an AD7995 ADC which has four input channels. Channel 0 is wired to a thermistor and the remaining three channels are accessible through a connector. I suggest you do a bit of research on ADCs (Wikipedia is not a bad place to start) and read the AD7995 datasheet to decide if it's a suitable part. If you do need a higher performance part, it wouldn't be too much trouble to design and build a custom Slice.
Greg
New User
Posts: 3
Joined: Wed Nov 20, 2013 7:19 pm

Post by Greg »

I need a minimum of 24 bit precision. Since the board only has 1,4,8,16 and 32 bit ports, I need to use a 32 bit port. How would I go about designing and custom slice?
User avatar
TSC
Experienced Member
Posts: 111
Joined: Sun Mar 06, 2011 11:39 pm

Post by TSC »

The width of the interface on the digital side of an ADC is quite independent of the resolution.

For example, the AD7995 used on the XMOS GPIO Slice has a selectable 12/10/8-bit resolution, but on the digital side, it uses a serial I2C interface which only requires two digital lines. Nearly all ADCs will use a serial interface to simplify PCB layout and minimise the number of digital I/O required, though some very fast ones (tens or hundreds of megasamples per second) do use a parallel interface.

Deciding on a suitable ADC requires at the very least decisions on resolution, accuracy, sample rate and number of channels. You've only mentioned two of those parameters. Do some research on ADCs before designing a custom Slice.

Digi-Key currently lists 14450 different ADCs.
Greg
New User
Posts: 3
Joined: Wed Nov 20, 2013 7:19 pm

Post by Greg »

We need accuracy to at least 10^-6 or 10^-7 volts. The goal of the project is to get the highest accuracy that is practical. We would like to sample at several kHz. We need the same accuracy on both of our signals. The final output of the device is the ratio of the two signals. The NAU7802KGI ADC looks like it will do what we need.

However, if I still wanted to use the GPIO slice, is it possible to set the range of the ADC such that I get the desired accuracy. We are measuring a very small difference between the signals, so most of the bits will be the same.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

If you are primarily measuring the difference between 2 signals you might want to consider using a differential amplifier made from precision op-amps prior to digitisation. This gain stage could reduce the required bit depth of the ADC depending on the range requirements of your signals.

(For ratio you would use one channel as single ended and the other as differential with high gain, then adjust in the math)

regards
Al