8477 views|1 replies

50

Posts

0

Resources
The OP
 

Crazy Shell AI open source drone SPI (barometer data acquisition) [Copy link]

1. Introduction to SPL06

SPL06 is the latest new air pressure sensor launched by Goertek. The latest new air pressure sensor SPL06-001 is launched. Goertek is a world-leading MEMS manufacturer. SPL06 uses Goertek's MEMS development technology accumulated over many years. By carrying high-precision detection MEMS (MicroElectroMechanicalSystems) and low-power integrated circuits, it has achieved the industry's highest level of accuracy of ±5cm. SPL06 is a miniaturized digital air pressure sensor with high precision and low current consumption, combining pressure and temperature measurement. The pressure sensor element is based on the principle of capacitive sensors to ensure high-precision measurement during temperature changes. The small package structure is suitable for mobile applications and wearable devices. The internal signal processor of SPL06 converts the output of the pressure and temperature sensor elements into 24-bit data. Each pressure sensor has been individually calibrated and contains calibration coefficients. The coefficients are used in the application to convert the measurement results into real pressure and temperature values.

The actual picture of SPL06 is shown below.

image.png

2. Barometer Data Acquisition Experiment

The barometer data acquisition experiment uses the hardware SPI of STM32 to connect to the barometer SPL06. Serial port 1 is UART1, and the computer is connected through the USB to serial port module. The original pressure value and original temperature value data of SPL06 obtained by SPI are transmitted to the serial port debugging assistant on the computer through serial port 1 for display. When doing this experiment, you need to temporarily remove the visual module and connect the USB to serial port line to the visual module interface. The barometer SPL06 is in the white RGB light box on the top of the drone. The SPI and power supply ports are connected through the soft row, as shown in the figure below.

image.png

According to the schematic diagram, we can see that the SPI interfaces of SPL06 are: PB15, PA5, PA6, and PA7, as shown in the figure below.

image.pngimage.png

For the configuration of serial port 1, please refer to "Serial port (basic transmission and reception), configuration code (by calling the official library)".

The idea of writing code to obtain SPL06 data is as follows:

1

Pin Configuration

1. Define the structure

2. Enable the clock

3. Filling the structure

4. Loading structure

2

SPI Configuration

1. Define the structure

2. Enable the clock

3. Filling the structure

4. Loading structure

5. Enable SPI

3

SPI read and write logic

1. Read a byte

2. Write a byte

4

SPL06 Driver

1. Read from the sensor

2. Write from sensor

3. ICM20602 initialization

The SPI initialization code is as follows:

image.png

The SPI read and write codes are as follows.

image.png

The initialization code of SPL06 is as follows.

image.png

The read and write codes of SPL06 are as follows.

image.png

After checking the manual, I found that the 24-bit original values of pressure and temperature are at addresses 0x00~0x05.

image.png

Read the register data and send it to the serial port. The code is as follows.

image.png

Here, please note that the serial port transmission must also be configured so that the data can be sent to the computer. Serial port 1 is connected to the computer through the USB to serial port module, save, compile, and download the code. You can see that the USB to serial port module is constantly printing the 3-byte original pressure value data and 3-byte original temperature data of SPL06. The data is shown in the figure below:

image.png

2.飞控开发基础-【7】SPI(气压计数据获取).pdf

1.05 MB, downloads: 8

This post is from Creative Market

Latest reply

Crazy shell AI open source drone Thanks to the host for sharing the entire xi series systematically. Thank you   Details Published on 2021-9-12 13:16
 
 

46

Posts

0

Resources
2
 

Crazy shell AI open source drone Thanks to the host for sharing the entire xi series systematically. Thank you

This post is from Creative Market
 
 
 

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