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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-09-2009, 01:09 AM
|
#1
|
Member
Registered: May 2007
Posts: 89
Rep:
|
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 ?
|
|
|
02-11-2009, 04:05 AM
|
#2
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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 04:09 AM.
|
|
|
02-11-2009, 04:05 AM
|
#3
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
Sorry, double post
Last edited by knudfl; 02-11-2009 at 04:08 AM.
|
|
|
02-11-2009, 06:05 AM
|
#4
|
Member
Registered: May 2007
Posts: 89
Original Poster
Rep:
|
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...
|
|
|
02-11-2009, 02:17 PM
|
#5
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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 03:54 PM.
|
|
|
02-12-2009, 04:48 AM
|
#6
|
Member
Registered: May 2007
Posts: 89
Original Poster
Rep:
|
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
Driver code attached(Read function actually samples the value)
ltc1861.txt
|
|
|
02-13-2009, 08:50 AM
|
#7
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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.
|
....
|
|
|
02-15-2009, 11:15 PM
|
#8
|
Member
Registered: May 2007
Posts: 89
Original Poster
Rep:
|
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).
|
|
|
02-16-2009, 03:19 AM
|
#9
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,196
|
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 01:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|