⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
gomezago
Offline
Last seen:1 year 2 months ago
加入:2018-12-04 10:46
Relative Timestamp

Hello!

I was wondering if it would be possible to use the bmi160_get_sensor_time function, from the documentation(https://support.dialog-semiconductor.com/system/files/restricted/UM-B-06...), to add some sort of timestamp, in milliseconds, to the accelerometer, gyroscope and magnetometer data.

I don't need a real time value, just a relative value from which I can get a time difference in milliseconds to corroborate the sampling frequency of the sensors.

I would like to add the timestamp to the sensor report, every time new data is generated. Would this be possible?

Thanks :)

Device:
PM_Dialog
Offline
Last seen:20 min 41 sec ago
Staff
加入:2018-02-08 11:03
Hi gomezago,

Hi gomezago,

You could use the bmi160_get_sensor_time(&v_sensor_time_u32) from the bmi160 driver or the lld_evt_time_get() which gets the current time value from HW and pass them to the sensor report. Take care that the bmi160_get_sensor_time() returns an uint32, which is not the real time clock. It returns a relative value which is related with the previous calculated value.

Thanks, PM_Dialog

gomezago
Offline
Last seen:1 year 2 months ago
加入:2018-12-04 10:46
Hi PM_Dialog!

Hi PM_Dialog!

Thanks for your reply! It was very helpful. The relative value is good enough for my application.

可以肯定的是,我必须添加一个广告ditional field (size 4B) to the accelerometer and gyroscope reports? Or is there any other way to implement this?

Thanks for your help,

PM_Dialog
Offline
Last seen:20 min 41 sec ago
Staff
加入:2018-02-08 11:03
Hi gomezago,

Hi gomezago,

This is up to your implementation. For example you might use the user_add_sensor_report_acc_gyro_mag(). This function sends the sensor data in the form of a notification (report) to the central device. A sensor data notification is called a report. This function forms a report for the accelerometer, gyroscope or magnetometer. A DWS_VAL_NTF_REQ message is formed and sent to the DWS profile task.

Thanks,