LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   LTC1861 ADC driver... (https://www.linuxquestions.org/questions/linux-software-2/ltc1861-adc-driver-703254/)

ramesh6056 02-09-2009 12:09 AM

LTC1861 ADC driver...
 
Hi all,

I am interfacing LTC1861 to At91sam9263 spi interface. Linux 2.6.20 is running on my custom board. Does anyone have driver for this 12-bit ADC (LTC1861) on linux ?

knudfl 02-11-2009 03:05 AM

It is my understanding, that the ADC output is not
compatible with SPI .
ADC = high bitrate output, and SPI = low bitrate input ?

(( Imagine this : connecting an ADC chip to an RS-232 bus ...
you would also need some kind of hardware based interface,
this isn't something a "driver" can do ))

The solution could be : ADC with SPI output or a
computer board with ADC input .... example board
http://www.oasistechsol.com/at91sam9263_module.aspx

:Quote: "This CPU module board supports peripherals such as TFT LCD, USB
host, USB device, SDIO, SD/MMC, CAN, 10/100 Mbps Ethernet, CMOS camera, ADC,
SPI, I2C, Hard Disk etc and up to 64 MB RAM and up to 64 MB Flash."
.......................

More information : Google .. adc to spi ..
http://www.keil.com/forum/docs/thread1121.asp
http://www.edn.com/article/CA6280029.html
...........
(( http://www.webopedia.com/TERM/S/SPI.html ))
.................

knudfl 02-11-2009 03:05 AM

Sorry, double post

ramesh6056 02-11-2009 05:05 AM

Hi thanks for your reply....

I am actually using the alternate function of the spi interface. I mean, if using normal gpio pins to obtain the sampled data from the ltc1861. I wrote small piece of code for commanding the adc to start the conversion and stop it. After stopping the conversion by supplying clock i am retrieving the 12-bit sampled data.

I am facing the following problem now,

1) When i sample the data from adc, it is giving that the sampled voltage is around 2 volts, eventhough i have not connected 2v to the adc pins.

2) By continuosly sampling the adc, the adc is not giving the constant value.

Does any one faced the problem like this with the ltc1861 chip ?

If anyone has worked on this chip, please help me up in solving my issue...

knudfl 02-11-2009 01:17 PM

Datasheet ( LTC1861 )
http://www.linear.com/pc/downloadDoc...58,P2081,D1181

The maximum output current is 360 ľA resulting in a Vo = min 2.4 V
( If I am reading this right )
If Vo = 2.0 V, the load is too heavy and requires
some kind of buffering. The stability will probably
also be OK, if used within the recommended data.

If you want Vo = 4.6 V, go down to a lower Io.
....

ramesh6056 02-12-2009 03:48 AM

2 Attachment(s)
Hi thanks for your reply...

Actually i have supplied voltages ranging from 0V to 9V....

What ever the voltage i give, i am getting the sampled value(in my driver) as 2Volts. And if i sample repeatedly, i am getting around 1.3 volts and there it stops, further sampling gives the same value.

I attached my driver code and the schematics of my adc here.

I have tried the following to solve the issue,
1) All of the Adc pins are configured correctly. I am able to see the clock and sampled signal at my adc pins properly.
2) I tried configuring various delays in my driver code to check the possibilities of the problem. But no success.
3) The CH0 and CH1 of the chip is connected via some filters to the external pins. I don't whether they are proper or not.... But what ever voltage i give on the external adc pin i am not able to get any change in my sampled values.
4) I tried directly giving voltages to CH0 and CH1 pins avoiding the filters,(I mean directly on the pins of chip), i am able to get immediate change in my sampled value, (It was showing the maximum voltage - 4095mv).

I have totally lost, where to suspect the problem...

Schematics attached
Attachment 142

Driver code attached(Read function actually samples the value)
Attachment 143

knudfl 02-13-2009 07:50 AM

1 Attachment(s)
The scematic, # 6, looks like the one in the manual,
nothing indicates, what's connected to the output, see
page 16 ( attached picture )

I still think, you have a misfit with the curcuit
connected to the output, pin 7, SDO.

Or you have a measuring error ?

Suggest : Print the data sheet to paper, and study it.

Some more info
http://www.eetindia.co.in/ART_880049...P_1eafdb6a.HTM
Quote:

Operating from a single 5V supply, the 16bit LTC1864/LTC1865 and
12bit LTC1860/LTC1861 each draw 850ľA and are guaranteed for output
rates up to 250KSps. All four ADCs communicate via a 3-wire
SPI-compatible serial interface.
....

ramesh6056 02-15-2009 10:15 PM

Thanks for your reply and interest on the problem.

The SDO pin is connected to the SPI0_MISO of processor(This pin i have made it as normal gpio input(it is no more spi pin) -- Not only this pin, also the pins like SCK, SDI and CONV pins i have made it as output).

The ADC CH0 and CH1 are my input pins, where i should supply my analog voltage for sampling.

According to the datasheet, if you have time to see my code(attached in my previous post), you will come to know that, how i am signalling SCK, SDI and CONV pins inorder to get the sampled value through SDO pin according to the datasheet.

When i give clock cycle by cycle through the SCK pin of adc, i am able to get sampled value shifted in my SDO. I am determing the state of this SDO gpio pin(high or low), and then getting the sampled value.

I am getting this sampled value as wrong and is not according to the analog voltage which i supply to the Channels.

May be i am sampling the SDO gpio pin states as wrong ? (0.4 v is low and vcc should be max if i am right).

jlinkels 02-16-2009 02:19 AM

1. What do you get when on the data output when you apply the clock signal with a signal generator? That is, disconnect the whole processor, and use bare to the bone electronics hardware debugging. What does it give you?

2. I see that both your inputs are floating for DC. Are you sure that is allowed?

jlinkels


All times are GMT -5. The time now is 05:20 PM.