LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB8451 with ADXL345 in SPI mode

I try to grab date from the adxl345 in SPI mode by using USB 8451.

In order to make sure that adxl345 is working, I used microcontroller (adruino) to control adxl345 and obtain data from them.

It is working well. But when I try to do the samething in the labview,  I get nothing from the adxl345.

In order to simplify my problem, I try to write a single data (0x08) to a register (address 0x2D) and read data from this regisitor again. 

After exciting this program shown below, I get a value (0x00).

Anyone can give me some hint to solve this problem.

 

Best,

 

 

 

 

0 Kudos
Message 1 of 4
(2,963 Views)

You might need to check the command format: for example, some device need an opcode to write before your address and data.

The shipping example of 845x "ATML AT25080A" just demonstrated this.

 

0 Kudos
Message 2 of 4
(2,939 Views)

Based on a quick scan of the datasheet, your commands don't make any sense. In the first call you're trying to write a value of 8 to the 2D register, which is the POWER_CTL registers. Well, that register has the MSB hard-coded to 0, so setting the register to a value of 8 makes no sense. In the second call you're trying to access register AD, which doesn't even exist.

0 Kudos
Message 3 of 4
(2,932 Views)

To check an ADXL345 you could use the following VI. It read the 0 register. If all is OK you get E5.

Note: SPI connections are tricky. Read data sheets carefully, My first try don't work because SDI and SDO were permuted...

0 Kudos
Message 4 of 4
(2,473 Views)