LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Spi with Labview: Reading register contents

I've ran into situations like this before,  works one day, doesn't work the next.  It has almost always been a hardware problem.  Poor connections mostly.  But one time it was the actual cables I used to connect the 8451 to the device under test.  The cable impedance affected the quality of the signals.  Cross talk can cause a problem.  That is why you need a scope to look at the signals at the device end. 

 

In my case, it worked one day, and the next it didn't, it was because the cables were moved and crosstalk started occuring.  Also, the clock signal was skewed by the cable and it no longer looked like a clean square wave at the device end.  You may need to change cables or use very short wires (less than one foot in length).  Keep the wires apart.  If using ribbon cable, surround you clock line by grounds.  Surround your data lines by grounds.  It almost certainly has to be a hardware problem.

 

One time I had a problem because I was using level shifters to transform 5v to 3.3v.  The device did not like the output impedance of the level shifter circuit.  I had to play with the resistors on the output side.  A scope will go a long way to help you troubleshoot.

 

Sorry to hear about your colleagues giving you a hard time.

 

- tbob

Inventor of the WORM Global
Message 11 of 17
(1,917 Views)

One additional thing to add to what tbob mentions: we can only provide advice up to a point. I don't know what your level of experience is with this, so you may need to call in an engineer to take a look at your setup.

 

The behavior of your "colleagues" (and I use the term loosely in this case) is disappointing. We're not privy to the situation there, so I will not pass judgment, but if I were in your shoes I'd place that company at the bottom of my list as far as prospective future employers.

Message 12 of 17
(1,909 Views)

I know it's a hardware thing. I do now. I'm very much thankful for your comments!

 

Today I will look for a way to solve it with an oscilloscope as yesterday there wasn't one available for me to use. But I think it should be something regarding the cables and connections, so I won't bother here anymore unless a new problem (like future software) arises.

 

If not, then when it works I will work and when it doesn't then too bad. Yesterday my supervisor saw what happened and now he is aware that everything is the same and it works sometimes and sometimes it doesn't. Either way I sincerely appreciate all your quick and asserted responses. 

 

Thanks a bunch again!! I do have a little Labview experience, and with this forum I'm learning. All I know about VISA and GPIB I learnt here. That also goes for state machines (which are truly saving my life these days!)

 

The only thing left is to mark the solution, but you two have helped me a bunch? What should I do ;)?

 

Sincerely Thankful!

Gisela

0 Kudos
Message 13 of 17
(1,896 Views)

g.garzam wrote:

 

The only thing left is to mark the solution, but you two have helped me a bunch? What should I do ;)?


I wouldn't worry about it if I were you. Smiley Wink

0 Kudos
Message 14 of 17
(1,885 Views)

For cases like this, NI should provide a way to split the solution mark.  But since that doesn't exist, don't mark anything.  I get paid the same (nothing).  Actually, I am just glad to help.  Smercurio and I have teamed up quite a bit lately to help out others.  That is enough satisfaction for me.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 15 of 17
(1,873 Views)

Hello everybody,

 

I am a new user in Labview.I am trying to  communicate a ADXL345 3 axis digital accelerometer Via SPI Interface (4-Wire) with labview FPGA. I am trying to do that with SPI single port example which i have downloaded from NI website.I am using NI-9074 cRIO nodule and NI 9401 digital I/0  module.Now the problem is the main fpga vi and host vi (i have developed as per adxl345 configuration requirment).But no data is comming.

 

  Please help me. I've been reading a lot and seeing the examples, and I've managed to understand it, but I am not understanding that what should be corrected in program as i am a beginer in labview.

 

I am attaching here the host vi,main fpga vi and application datasheet of ADXL345 accelerometer.

 

Please help me and give me some suggetion about how i'll be able to read the register contents of adxl345.

 

Download All
0 Kudos
Message 16 of 17
(1,285 Views)

I love how you output the data here, and i wish you had attached your final code.

0 Kudos
Message 17 of 17
(34 Views)