LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-09-2009, 12:09 AM   #1
ramesh6056
Member
 
Registered: May 2007
Posts: 89

Rep: Reputation: 15
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 ?
 
Old 02-11-2009, 03:05 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,391

Rep: Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604
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 ))
.................

Last edited by knudfl; 02-11-2009 at 03:09 AM.
 
Old 02-11-2009, 03:05 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,391

Rep: Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604
Sorry, double post

Last edited by knudfl; 02-11-2009 at 03:08 AM.
 
Old 02-11-2009, 05:05 AM   #4
ramesh6056
Member
 
Registered: May 2007
Posts: 89

Original Poster
Rep: Reputation: 15
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...
 
Old 02-11-2009, 01:17 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,391

Rep: Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604
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.
....

Last edited by knudfl; 11-12-2009 at 02:54 PM.
 
Old 02-12-2009, 03:48 AM   #6
ramesh6056
Member
 
Registered: May 2007
Posts: 89

Original Poster
Rep: Reputation: 15
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
Click image for larger version

Name:	ADC-schematics.JPG
Views:	34
Size:	58.4 KB
ID:	142

Driver code attached(Read function actually samples the value)
ltc1861.txt
 
Old 02-13-2009, 07:50 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,391

Rep: Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604Reputation: 3604
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.
....
Attached Thumbnails
Click image for larger version

Name:	screen.jpg
Views:	19
Size:	15.8 KB
ID:	148  
 
Old 02-15-2009, 10:15 PM   #8
ramesh6056
Member
 
Registered: May 2007
Posts: 89

Original Poster
Rep: Reputation: 15
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).
 
Old 02-16-2009, 02:19 AM   #9
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,194

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can samba 3 act as ADC or not ? marozsas Linux - Networking 1 09-10-2008 01:59 PM
Linux as Windows DC and ADC backup zmunawar Linux - Server 2 09-01-2007 03:12 AM
Linux as Windows DC and ADC backup zmunawar Linux - General 1 08-27-2007 08:09 AM
Device driver (ADC) knockout_artist General 0 01-06-2006 01:06 PM
Anyone good with ADC or DSP's? illiniguy3043 Programming 0 10-07-2004 11:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration