using SUB-20 SPI read-write.vi

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
acc-gyro
Posts: 2
Joined: Thu Apr 12, 2012 6:23 am

using SUB-20 SPI read-write.vi

Post by acc-gyro »

XDIMAX has provided a LabVIEW VI (SUB-20 SPI read-write.vi) for SPI communication and I am working on using it with the SUB-20 together with an IC (acc/gyro, LSM330DL) using SPI. Eventually, I want to use the IC to develop some algorithm using LabVIEW. There are certain issues that I need help to achieve my goal. I am breaking my goal down to some smaller tasks:
1. Configure SUB-20 to give command and to read data from the 3 axis accelerometer
2. Configure SUB-20 to give command and to read data from the 3 axis gyroscope
3. Configure SUB-20 to give command and to read data from the 3 axis accelerometer and 3 axis gyroscope
4. Stream all above 6 axis data set to LabVIEW for data processing/algorithm development

The list of the 8-bit registers embedded in the device for the gyro and the acc. (they have a different CS) and the respective address:

OUT_X_L_A 0x28
OUT_X_H_A 0x29
OUT_Y_L_A 0x2A
OUT_Y_H_A 0x2B
OUT_Z_L_A 0x2C
OUT_Z_H_A 0x2D

I am having difficulties using the VI. Would you how to use the vi or to modify it to achieve my objectives?

serg
Posts: 143
Joined: Mon Aug 31, 2009 9:17 pm

Re: using SUB-20 SPI read-write.vi

Post by serg »

Hi acc-gyro,

Before developing your vi in LabView I would suggest to use our GUI application - subtool, to communicate with your LSM330DL device, i.e
- Configure SPI (or I2C), SS polarity, clock edge, clock rate etc. See the datasheet for the LSM330DL
- Read registers from the device, check if reading is reliable. Then go ahead and develop your vi.
By the way, have you seen our new labview driver here
viewtopic.php?f=2&t=506
Try to achive your goal by the GUI tool, first. This will allow you to eliminate hardware related issues, like connections, grounds, pull-ups, signal levels etc.

Post Reply