01-14-2016 09:15 AM
Hello
I am using LabVIEW 2013 with myRIO 1900 and want to interface an external ADC (ADS 8332) to the myRIO as I need more analog inputs. The datasheet specifies the cinfiguration register bits in binary. I referred the datasheet and tried to do this but the whole thing doesnt seem to be working. Need urgent help as to how to configure the ADC in LabVIEW to read data and send it to myRIO.
I am attaching the codeI tried to write and the datasheet of ADS 8332.
Thanks 🙂
01-14-2016 11:56 AM
Hello,
According to your code you are not driving CONVST signal. This signal freezes sample and hold, starts conversion.
Besides mentioned problem it seems you are going to send with SPI 16 numbers, and I guess you mentioned 1s and 0s in the array assuming SPI write VI accepts binary numbers, correct?
Actually you should write values of the registers, in decimal, according to the ADC's manual. SPI sends these numbers as a packages of 8 bits.
Thanks,
Arev
CTO | RAFA Solutions
01-15-2016 11:01 AM
Okay, taking your advice and trying to keep everything 'Auto', I entered the registers in decimal. Also, I'm confused about the number of frames to read. What should I put in the SPI configuration and iniside the while loop ?
With the code I've written, I get some output of 7.02xxx... I've connected a potentiometer as the signal.
What am I doing wrong ?
01-15-2016 11:49 AM
In the modified code you again are not driving the CONVST signal. This signal should be set to 0 (the signal is active 0) in order to start the conversion, after the register data is written to the ADC. If you are not going to use CONVST signal, you should program the ADC for Auto-Trigger mode (CFR_D9 = 0).
What data are you trying to write to the registers (236, 125)?
Also it will be useful if you show the connection diagrams, i.e. to which inputs/outputs of the myRIO are connected used pins of the ADC.
For example is Reset signal connected to the digital power, or at least some of the IOs to be able to drive it to high or low for reset operation.
Thanks,
Arev
CTO | RAFA Solutions
01-15-2016 04:03 PM
Dear deepen_solanki,
Our company has extensive experience in developing various drivers for ADCs and DACs in the market, we have even release one driver kit for couple of DACs, you can check it out on LabVIEW Tools Network with the below link http://sine.ni.com/nips/cds/view/p/lang/en/nid/213162.
Please let me know if you can dedicate any budget so our team can help you to develop and provide the required drivers.
Best regards,
Rafayel.
01-16-2016 09:58 AM
The values of the configuration register are as follows (Table 5)
CFR _D0 = 1 (Normal Operation)
CFR_D1 = 0 (TAG bit disabled)
CFR_D2 = 1 (Deep power down disabled)
CFR_D3 = 1 (Nap power down disabled)
CFR_D4 = 1 (Auto Nap power down disabled)
CFR_D5 = 1 (Pin 10 used as EOC output)
CFR_D6 = 1 (Pin used as EOC)
CFR_D7 = 0 (EOC active high)
CFR_D8 = 0 ( 500kSPS, 21 CCLKs)
CFR_D9 = 0 (Auto-trigger, conversions start automatically 3 CCLKs after EOC)
CFR_D10 = 1 (CCLK = Internal OSC)
CFR_D11 = 1 (Auto Channel Select)
CFR_D12:D15 = 0111 (Write CFR) (Table 4)
Taking MSB first and dividing them into two packets of 8
11101100 = 236
01111101 = 125
Hardware connections
SDO -> MISO
SDI -> MOSI
SCLK -> No Connection
MUXOUT - ADCIN
EOC - DIO (myRIO)
01-16-2016 02:30 PM
Why is the SPI clock (SCLK) left unconnected? Is RESET pin connected to the digital supply?
Thanks,
Arev
01-17-2016 01:03 AM
I am trying to use the internal clock of the converter to carry out my operations thats why I left the SCLK of myRIO unconnected.
Will this work ?
Flat Sequence Structure containing the following :
1) CONVST activated
2) EOC polled
3) Data read
Also, What are the appropriate hardware connections according to you ?
01-17-2016 02:11 AM
If you have programmed the ADC to use the internal clock, it will be used to run the conversion. For the conversion SCLK can also be used, if the ADC is programmed appropriately.
But for interfacing the ADC with SPI the SCLK clock is required.
The RESET signal is active 0, so if left unconnected, it can place the ADC into reset state. If not used, this pin should be connected to the digital supply (see section 8.5.5 of the datasheet).
The sequence of operations you mentioned is correct, and will work if all timing parameters are followed.
Thanks,
Arev
01-17-2016 04:45 AM
Are the values of the configuration registers I mentioned correct ?
Does using 'Auto-Trigger' eliminate the role of CONVST ?
What should I do with RESET ?
Also, I am attaching an image circling the parts of the code I am not feeling confident about.
You have been really patient with me, I thank you for that.