LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ADC on myRIO

Hello. 

 

I'm using myRIO 1900 with LabVIEW (FPGA module) 2013 on Windows 7. I've run out of the number of analog inputs on the controller and desperately need more. I inderstand I'll be needing to use ADC's for this. Other than that I dont know much about what to do.. Could somebody please help with what needs to be done and how exactly to do it  ? eg. I know that the SPI and other 'special' pins are going to be used.. but how exactly ? 

I know I'm asking a lot, but any help will be greatly appreciated 🙂

 

Thanks in advance

0 Kudos
Message 1 of 19
(5,665 Views)

You might be able to add a multiplexor chip instead. Most of the NI DAQ devices actually only have one analogue input, but they have a multiplexor which switches which input gets connected to the ADC.

 

I think these are your options:

- Get a multiplexor chip and use it to connect multiple - you'll obviously get a slower sampling rate as you'll need to switch the multiplexor between reads. The chip might be SPI or it might just take a number of digital input lines to select the input.

- Get an ADC chip as you suggested - it might be SPI or I2C, there might even be Serial ones? You'll need to wire it up as appropriate. An oscilloscope will help you in the early stages to see if you're sending out the right commands to perform a read and whether or not the device is responding. The myRIO SPI VIs should mean you won't need to do any low-level SPI programming.

- You could also use another device like an Arduino to add the extra analogue inputs. The resolution isn't very high though.

 

Oh - it's also worth noting there is a specific board on the forums for the myRIO


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 19
(5,612 Views)

I always thought the Arduino option would be an interesting one.  Assuming you can get the USB device recognized, and have VISA working with it, the LIFA, or LINX toolkits should just work with any Arduino with the firmware loaded on it.

0 Kudos
Message 3 of 19
(5,584 Views)

I hadn't even though about directly connecting the Arduino to the myRIO via the USB (enumerated serial port), but I don't see any reason why it wouldn't work - I've read in a few places that USB to Serial converters can be plugged into the USB port on the myRIO. If that doesn't work, connecting the serial RX/TX pins to the myRIO should work (I think the myRIO serial pins are TTL level rather than RS-232 level).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 19
(5,553 Views)

Alright.. But I've got to do it using ADCs for my project.. specifically.. so  I'm kinda stuck with that. 

0 Kudos
Message 5 of 19
(5,522 Views)

Well then you need to find a suitable ADC that gives you the resolution & accuracy that you require and with a suitable communication method (e.g. SPI, I2C, Serial/UART) and then read the datasheet in detail to figure out how to build it into a circuit and connect it to your myRIO. You'll then need to read the section on the protocol used (whether it's SPI/I2C/UART) and then see if you can use the myRIO SPI/VISA functions to talk to it - or you might need to write some custom FPGA code that does the communications with the ADC.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 19
(5,518 Views)

Yes.. I was hoping i could get more help with this 

0 Kudos
Message 7 of 19
(5,456 Views)

Well once you've got your ADC chip all wired up, and you've written some LabVIEW code for the myRIO to communicate with it but you can't get it to work, then come back to us and we'll help you try to figure out what's going wrong.

 

We're not going to do your work for you! I've told you the steps you need to take - it's up to you to do the research necessary to complete them!


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 8 of 19
(5,440 Views)

Hey deepen_solanki,

 

I have had the same problem as I needed a 16 bit ADC. I can only recommend you to use an ADC with UART or USB output as these two inputs are the only one not having to write FPGA code 🙂 as they are not linked to the FPGA. If you take one with SPI (I took one with "SPI compatible") I could share part of my codes with you, although I was not able to test it yet 🙂

 

 

So try to get UART or USB interface first 🙂

 

kind regards

 

Slev1n

0 Kudos
Message 9 of 19
(5,431 Views)

Having never used the myRIO personally I can't say for sure, but I didn't think you had to write FPGA code to talk SPI.  There is an express VI that you can configure to do SPI communication, and the FPGA code associated with this should already be written.

0 Kudos
Message 10 of 19
(5,418 Views)