This page details the access sequences and configuration of the different sensors of the avionics module for the Avionics Module.
| Ref | Description | Doc. ID | Issue |
|---|---|---|---|
| [GYRDT] | Gyroscope Datasheet | Link | |
| [ACMDT] | Accelerometer Datasheet | Link | |
| [BARDT] | Barometer Datasheet | Link |
The hostboards read all sensors every 10ms. Thus our sensors must produce data of at least 100Hz.
The Bosch BMP390 is interfaced using I2C. Bosch recommends burst reading values from the sensor, which consists in reading from multiple registers in a single go, then unpacking the values from the processor thread.
mode[1…0]The barometer has three power modes, which can be configured using the mode bits in the PWR_CTRL register (address 0x1B).
mode[1…0] |
Mode name | Description |
|---|---|---|
00 |
Sleep | The default (sleep) state of the sensor. No measurements will be taken. |
10 or 01 |
Forced | Forces a single measurement. Will return to 00 after read. |
11 |
Normal | Continuously reads from the sensor. |
For all intents and purposes only the normal mode will be used during flight.
Activate the barometer by writing 0b00110011 to the PWR_CTRL register (address 0x1B). The most significant 11 represents activates the Continuous read power mode and the least significant 11 activates temperature and pressure measurement.
| Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Name | r | r | mode[1] | mode[0] | r | r | temp_en | press_en |
| Purpose | | | MSB of mode | LSB of mode | | | 1 enables temperature measurement | 1 enables pressure measurement |
Set the sensor read frequency by writing to the CONFIG register (address 0x1F)
Read calibration parameters from the NVM_PAR registers (addresses 0x31 to 0x45) and convert them to floating point integers using formulas from Datasheet §8.4, then save them into the corresponding barometer_calib_data structure.
This involves reading from the DATA_0…5 registers. DATA_0 to DATA_2 represents pressure data, and DATA_3 to DATA_5 temperature data. To avoid getting the wrong value, Bosch recommends reading all data at once