LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling an 18bit ADC with serial interface

I need some help, I acquired an 18bit ADC circuit with a serial interface and I wish to write LABview code to read the output of this ADC circuit. The text below explains a bit about th ADC and I have also included the complete circuit. I just want to know what I should be looking for in doing this project, can I use the VISA vi's to read from the ADC and if so, what will I set the parameters like baud rate, parity etc to or will I not need to worry about that. There is also C code provided for this but I want to be able to write a driver for this circuit in LABview if I can.

'PC usually requires a plug-in ADC card to process analog signals. However, with the circuitry in Figure 1, a PC can communicate with an 18-bi
t ADC through its serial port. The port provides both positive and negative power supplies as well as control signals. IC1 is an 18-bit MAX132 ADC with a serial interface. It requires three input control signals, , DIN, and SCLK, and emits serial data, DOUT, and EOC (end-of-conversion) signals. An RS-232 port has three output lines: Pin 3 (TX), Pin 4 (DTR), and Pin 7 (RTS). TX generates the clock signal for the MAX132 and provides the negative power supply. DTR transmits serial data. RTS provides the CS signal and the positive power supply. Both the positive and the negative supplies use large capacitors for energy storage. When TX generates a clock signal or DTR sends a CS logic-low signal, the capacitors provide power to the MAX132. The MAX132 integrates everything except a reference that comes from a 1.2V LM385 voltage-reference diode, D1. The input-voltage range of the MAX132 is -512 to +512 mV. Listing 1 is a C program that displays the analog-to-digital-conversion result on-scree
n.'
0 Kudos
Message 1 of 9
(6,285 Views)
Hi Bupe,

I suggest you review the C source for some clues as to how to attack this project.

It does not appear that this is standard serial protocol. It looks like you turn on the ADC by asserting some control lines. This can be done using NI-VISA.
Similarly with monitoring the DTR line where it appears your data is coming in. It is not obvious to me how we know which bit is coming in when. Specifically what happens to signal the first bit and similarly the last.

You should also try to get a clue as to how the data is being represented, i.e. Big-endian, little-endian.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 9
(6,285 Views)
Ben
I have got the C code which should work I hope and I am in the process testing it as soonas I complete the circuit to see what the output will look like. I believe the ADC circuit takes its power from the Serial port and thats why there are no power inputs in the diagram.

I have attached the C code.
B.
0 Kudos
Message 3 of 9
(6,285 Views)
Hello Bupe & Ben

yesterday I already saw your question and was interested who would answer...........

I think you will get stuck with this ADC @ serial port - you will never use 18 Bit of resolution because of noise in the system - I expect at least max. 10 ... 12Bit
- let me know if it works better. I have tested this IC connected to LPT - Port; Ben knows how I typically perform this kind of SPI-Interface.
If you are interested in this solution - send an e-mail.
Find attached Front-Panel pict. of ADC.vi and in addition a suggested schematic from MAXIM. This looks
professional - and don't forget that a really good designed board is necessary to achive a resolution of 18 Bit...........

Regards
Werner
Download All
0 Kudos
Message 4 of 9
(6,285 Views)
Hello,

I just wanted to let you all know about a couple of other things. Bupe, you can simulate the C code you posted pretty closely using the Inport and Outport VI's to write to specific memory locations just like the C code that you posted. I think Ben is right in that you're not communicating in the 'normal' way of serial (because that would mean using the Tx and Rx lines, and I don't even think that Rx is wired up in your schematic).

The Inport and Outport VI's are located in the Advanced -> Port IO Palette. Additionally, if you need to use them with 2000/NT/XP, see this Knowledgebase.

Hope this helps.

Sc
ott
0 Kudos
Message 5 of 9
(6,285 Views)
Hi Bupe,

I sugest you follow-up with Werner.

Thank you Werner, I owe you some stars.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 9
(6,285 Views)
Thanks a lot guys, I will follow up on all your comments/help and I will let you know how it goes, but I will probably be back again with soem more questions.

So Scott, you really think its possible to simulate that C code in LABview, I did think about that at first but I just didnt know if it was possible.

Thanks again.
0 Kudos
Message 7 of 9
(6,285 Views)
I think you can get pretty close to the C code. Though I didn't get in depth with your code, it seems that it's primarily writing to various locations in memory (like the serial status registers, io registers, etc). You can do this with inport/outport as I mentioned above. Although many people think of LabVIEW as a quick-and-easy language to develop small apps in, it's a pretty powerful development language. You can do a lot of things with it.

Scott
0 Kudos
Message 8 of 9
(6,285 Views)

Dear Werner,

I am very interested in this ADC circuit because I want to applied to my project.

I found the schematic circuit from the MAXIM website and assembled it recently.

But I just a beginner in Labview, would you please e-mail me the labview file if it is possible available?

Thank you!


Chen

 

0 Kudos
Message 9 of 9
(5,748 Views)