Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Real time acquisition of low voltage signals with Intan RHD 2000

Solved!
Go to solution

I have been struggling for quite some time to get a real time signal acquisition system working. This is my year project for the University of Leeds MEng in Electronics.

The specifications of this system are:

  • Use a myRIO-1950
  • The myRIO is interfaced with a 16-bit ADC Intan RHD 2032 signal amplifier (32 channel amplifier)
  • The communication protocol used to communicate with the RHD 2032 is SPI
  • 5+ channels must be acquired and displayed in "real time"
  • Basic signal processing needs to be performed on every signal depending on the need (peak detection, fft, averaging, etc)

These are the basic requirements. The system needs to be working in "real-time" because in its future operation it will be used in the field of neuroscience to acquire ECG/EMG and any action potential related signals.

So far the code linked acquires up to 8 channels (although I'm not quite sure if it is working as fast as it could be).

 

At the minute, I'm making use of the SPI low level protocols that are part of the SPI Express VI to achieve communication with the chip.

I have been reading a few articles about how the myRIO-1950 comes with a pre-programmed FPGA personality but I am unsure whether this default FPGA personality is always implemented when DI/O and and AI/O lines, together with the communication protocols (SPI, I2C) are using the FPGA by default. Any clarification on this issue would be appreciated.

 

One bug that I found in the code as well is that the channel numbers do not correspond to the pins on the Intan RHD 2032 when in operation. For example, a signal applied to channel 0 through a signal generator will be displayed to channel 5 in the software. I believe this may be because of the use of sequence structures although that seemed the most logical approach for this operation. 

Using the onboard FPGA to handle all channels on parallel would be ideal although the data coming from the SPI device is multiplexed into 16-bit frames effectively coming into the SPI communication pins rather than having separeate DI/O pins for each channel. Would there be any way of handling the multiplexed data stream in such a way to achieve real time performance?

 

The end goal for this system is to achieve a user friendly software (to be used on a PC) and all the signal acquisition/communication protocols to be working on an embedded device. Is the approach I'm developing effectively on the right tracks or am I going the wrong route?

 

Thank you for your time and your patience. Any feedback will be extremely appreciated.

Arnau Segura

0 Kudos
Message 1 of 5
(3,830 Views)

I would break the problem down into smaller ones and confirm specific parts to be working before going on to the next step.  Do not try to build the whole thing in one shot, debugging will be more difficult than it has to be.

 

Have you been able to run the examples to see how things should be programmed?


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 2 of 5
(3,792 Views)
Solution
Accepted by topic author ArnauSegura

 Hi Arnau,

 

Before I start of I want state that I could not find the intan RHD 2032 so I cant go in depth on the communication with the chip. (do you mean the 2132?)

 

I've had a look at your code and it seems that you are running your code in normal while loops at full speed. 

Due to this the loops will not be deterministic. 

I would recommend to use timed loops instead to make sure you would reach your loop timings.

http://zone.ni.com/reference/en-XX/help/370622P-01/lvrtconcepts/deterministic_apps_timed_loop/

 

However I would personally choose a different approach:

There are SPI VI's available for LabVIEW FPGA. This would allow you to let the FPGA run headless and capture data, passing it on to a DMA FIFO. Whenever the CPU has time it will grab all the data from the FIFO and process it in its own time.

(I found this to be the best course of action on lower powered hardware)

 

Kind regards,

Natan Biesmans

0 Kudos
Message 3 of 5
(3,786 Views)

Hi terry,

 

Thanks for your feedback. I am aware that a "divide and conquer" approach might be the best solution for such a system. I have ran simple high level spi (SPI express Vis) tests with the myRIO following online tutorials and then tried developing the low level SPI communication with the chip (it works). I have developed very simple FPGA programs to get acquainted with their programming and operation. I'm still waiting on performing DSP simulations on signals because I would ideally want to achieve a reliable SPI communication working between the RHD 2132 and the microcontroller. Is this what you mean by running examples to see how things should be programmed?

 

As I said, the main problem I'm facing is with data transmission between RT-FPGA and host PC. I have been researching for the past days different implementations but still struggle to get my head around it. The actual implementation that I'm using at the moment is only using the myRIO's onboard CPU but would eventually only need the FPGA (thats an estimation). 

 

I have been researching the use of DMA FIFOs between FPGA and host PCs but the fact that the information comes multiplexed in a 16-bit SPI data stream increases complexity.

 

Thank you for your feedback and I will keep researching.

0 Kudos
Message 4 of 5
(3,776 Views)

Hi Natan,

Yes you are completely right, the IC I'm using to communicate with the myRIO is indeed the intan RHD 2132 (32-channel amplifier).

I will update the code to try to run it on a timed loop and see how performance is affected (most of the development needs to be documented).

 

I definitely agree with you that using the FPGA would be the best approach. It might be worth mentioning that the Intan RHD 2132 is only capable of  handling SPI communication up to 24 MHz and that between the myRIO and the chip there is an LVDS-to-SPI converter chip (the intan chip is hard wired in LVDS communication mode). 

 

I have been looking at different SPI VI tutorials for Labview FPGA but after a full week I still haven't managed to make them work on the myRIO-1950. This tutorial seemed to be the best course of action: https://forums.ni.com/t5/Labvolution/myRIO-FPGA-SPI-Communications/ba-p/3484859

I found that I had extreme difficulty to convert the code from the sbRIO personality to the myRIO-1950. Do you have any tips on that note?

 

Thank you very much for you help.

0 Kudos
Message 5 of 5
(3,774 Views)