3151 views|2 replies

171

Posts

0

Resources
The OP
 

Data acquisition based on LIS25BA bone vibration sensor of NUCLEO-767ZI [Copy link]

 This post was last edited by sylar^z on 2019-9-9 08:06

The active ST bone vibration sensor board, first post a picture. The board can be connected by directly soldering a 2.54 double-row pin.


The working voltage of the LIS25BA sensor is 1.8V (1.71V-1.99V), and the board I have is 3.3V. To connect the sensor, I need a 3.3V-1.8V level conversion board. So I bought a TXS0108 conversion board on Taobao to solve this problem.

In addition, the boards I had either didn't have a SAI interface or it was difficult to bring out the interface. Fortunately, EE could borrow a development board, so I connected a NUCLEO-767ZI board. Thanks to @ nmg . After the hardware was done, it looked like the picture below.

The control communication of LIS25BA is I2C protocol, which can support up to 400K rate. There are not many registers on the sensor, and only two registers need to be configured to complete the setting of LIS25BA.

TMD controls the sensor. Enable TMD function, set sampling rate, etc.

LIS25BA controls the sensor. Set PD to 0 to enable the sensor

The data acquisition of LIS25BA is TMD interface, and the master controller needs to provide sampling clock. The signal lines are MCLK, WCLK, BCLK, and SD on the sensor. MCLK is the sensor data sampling clock. WCLK is the data sampling frequency, which can be 8KHz, 16KHz, or 24KHz. BCLK is the bit rate. LIS25BA data contains 8 slots and 16-bit data. According to the requirements of the above three clocks in the manual, MCLK is fixed to 12.288MHz, BCLK and WCLK must be divisible by MCLK, and BCLK must also be an integer multiple of WCLK. This can ensure that the sampling data and timing are strictly consistent.

When MCLK is not the standard 12.288MHz, as long as the three clocks are integer multiples, data can be collected stably, but the corresponding sampling frequency of the data (such as 16KKHz) will change accordingly.

Under this requirement, the frequency of MCLK needs to be set to 1536 times, 768 times and 512 times of WCLK at 8KHz, 16KHz and 24KHz respectively. From the F7 manual, it is found that the frequency of MCLK is fixed to 256 times of WCLK frequency. This requires an additional synchronous clock to be used as MCLK. I enabled another SAI MCLK to obtain a 12.288NHz clock output.

The program configuration uses STM32CubeMX, and configures SAI1, SAI2, I2C1 and the corresponding DMA functions. SAI1 is used to collect data from LIS25BA, 16KHz, 8SLOT. DMA transmission is enabled.

In terms of clock, SAI1 uses a 32MHz PLLSAI clock, and SAI2 uses a 96MHz PLLI2S clock, so that the MCLK frequency of SAI2 is 3 times the frequency of SAI1, that is, 768 times the MCLK frequency of SAI1.

The following is the LIS25BA data collected by the program. You only need to extract the first three of the eight SLOT data to get the XYZ three-axis data of the sensor.


Latest reply

It would be better if LIS25BA had more data interfaces.   Details Published on 2019-9-9 10:10

赞赏

1

查看全部赞赏

 

1w

Posts

25

Resources
2
 

It would be better if LIS25BA had more data interfaces.

 
 

171

Posts

0

Resources
3
 
dcexpert posted on 2019-9-9 10:10 It would be better if LIS25BA had more data interfaces.

Yes

It would be nice if the MCLK, WCLK, and BCLK synchronous outputs could be used with the standard interface of LIS25BA. After all, occupying two SAI channels is a bit of a waste.

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list