LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading complete data from an IMU through SPI

I'm trying to read various values from an IMU (Yost Labs 3 Space Sensor Nano) to Labview through myRIO's (1900) SPI channels. I am able to write to the chip and receive something back but it's only one value. 

 

Here is a screenshot of my code and here is the IMU manual. The command in the example attempts to read the gyro data (page 30 of the manual). It should spit out 12 bytes/3x floats.

 

Whenever I run it, it gives me one value that jumps between 32 and 255 (for this specific command. for other commands it will still jump between # and 255). Is it a digital output and I just need to take the moving average? If that's the case how, how do I get the other two gyro values?

 

If not, how do I access all 12 bytes?

 

I noticed this similar issue in another thread but it did not solve my issue. I've tried indexing the array, unbundling, etc. but alas, nada.

 

I've been racking my brain over this for the past 3 days. Any sort of guidance would be immensely appreciated.

 

PS perhaps a side issue...the wiring diagram for SPI calls for a wire between the slave select pin that exists on the IMU but I can't locate it on the myRIO. Is this an issue?

0 Kudos
Message 1 of 6
(2,451 Views)

Having slave select allows multiple devices on the same bus, the master device can set SS high or low for a specific device so it knows you are talking to it (and not some other slave device on the bus).

 

If this is the only device, and the datasheet says its active low slave select, I would just connect the slave select pin to a gnd pin on the RIO.

 

 

0 Kudos
Message 2 of 6
(2,406 Views)

I'm experiencing the same issue, did you figure it out?

0 Kudos
Message 3 of 6
(2,129 Views)

I am guessing that you do not understand the SPI protocol, and are not "doing the right thing".  Do you want me to guess what you have coded, so I can suggest how you should fix it?  Don't you think that if you attached the code you are trying to run (you need to attach the entire Project, so compress the folder containing all the VIs you are using and attach the resulting .zip file), we could "see" and say "Aha, the SPI protocol says you need to ...", enabling you to fix what is wrong?

 

Bob Schor

0 Kudos
Message 4 of 6
(2,105 Views)

Hello! do you figure it out? 

 

 

0 Kudos
Message 5 of 6
(1,129 Views)

Three years ago, the Original Poster asked a Question, but didn't provide any code.  There were a few responses, but nothing more from the Original Poster,  He (or she) has posted nothing since two days after joining the Forum in 2019.

 

If @JoseCarlos or @Hat_Trick have a similar situation and would like some help, start a new message, explain clearly what you are trying to do, what devices are hooked up, what works and what doesn't, and attach your code (meaning VIs, not pictures).

 

Bob Schor

0 Kudos
Message 6 of 6
(1,110 Views)