FIFO is always 10-bit
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 41 KiB |
@ -49,6 +49,10 @@ x: 0.5480, y: -0.8800, z: -0.0720 mag: 1.0392
|
|||||||
x: 0.5480, y: -0.8800, z: -0.0800 mag: 1.0398
|
x: 0.5480, y: -0.8800, z: -0.0800 mag: 1.0398
|
||||||
x: 0.5480, y: -0.8960, z: -0.0960 mag: 1.0547
|
x: 0.5480, y: -0.8960, z: -0.0960 mag: 1.0547
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> ### Notes
|
||||||
|
> FIFO is always and only 10-bit
|
||||||
|
|
||||||
### Noise at 2G
|
### Noise at 2G
|
||||||

|

|
||||||
|
|
||||||
|
15
lis3dh.c
@ -294,8 +294,19 @@ int lis3dh_read_fifo(lis3dh_t *lis3dh, struct lis3dh_fifo_data *fifo) {
|
|||||||
int err = 0;
|
int err = 0;
|
||||||
int i, idx;
|
int i, idx;
|
||||||
|
|
||||||
scale = acc_shift(lis3dh);
|
/* FIFO is always 10-bit */
|
||||||
sens = acc_sensitivity(lis3dh);
|
scale = 6;
|
||||||
|
|
||||||
|
/* normal mode */
|
||||||
|
if (lis3dh->cfg.range == LIS3DH_FS_2G) {
|
||||||
|
sens = 4;
|
||||||
|
} else if (lis3dh->cfg.range == LIS3DH_FS_4G) {
|
||||||
|
sens = 8;
|
||||||
|
} else if (lis3dh->cfg.range == LIS3DH_FS_8G) {
|
||||||
|
sens = 16;
|
||||||
|
} else { /* 16G */
|
||||||
|
sens = 48;
|
||||||
|
}
|
||||||
|
|
||||||
/* fifo buffer is max 32 */
|
/* fifo buffer is max 32 */
|
||||||
fifo->size = lis3dh->cfg.fifo.fth > 32 ? 32 : lis3dh->cfg.fifo.fth;
|
fifo->size = lis3dh->cfg.fifo.fth > 32 ? 32 : lis3dh->cfg.fifo.fth;
|
||||||
|
11
plot.gp
@ -7,20 +7,17 @@ set key box opaque
|
|||||||
|
|
||||||
set ylabel "|[x y z]| - 1g"
|
set ylabel "|[x y z]| - 1g"
|
||||||
set xlabel "Samples over time"
|
set xlabel "Samples over time"
|
||||||
set yrange [-0.2:0.2]
|
set yrange [-0.3:0.1]
|
||||||
|
|
||||||
n(g) = g - 1.0
|
n(g) = g - 1.0
|
||||||
|
|
||||||
do for [g in "2g 4g 8g 16g"] {
|
do for [g in "2g 4g 8g 16g"] {
|
||||||
name = sprintf("graph-%s", g)
|
name = sprintf("graph-%s", g)
|
||||||
out = sprintf("%s.png", name)
|
out = sprintf("%s.png", name)
|
||||||
stub = sprintf("data/hr_%s_", g)
|
stub = sprintf("data/fifo_%s_", g)
|
||||||
set title sprintf("[%s + HR] comparison of ODR setting effect on magnitude of [x y z] acc vector (- 1g)", g)
|
set title sprintf("[%s FIFO] comparison of ODR setting effect on magnitude of [x y z] acc vector (- 1g)", g)
|
||||||
set output out
|
set output out
|
||||||
plot stub."1.txt" u n(4) w p ps 0.3 t "1 Hz", \
|
plot stub."50.txt" u n(4) w p ps 0.3 t "50 Hz", \
|
||||||
stub."10.txt" u n(4) w p ps 0.3 t "10 Hz", \
|
|
||||||
stub."25.txt" u n(4) w p ps 0.3 t "25 Hz", \
|
|
||||||
stub."50.txt" u n(4) w p ps 0.3 t "50 Hz", \
|
|
||||||
stub."100.txt" u n(4) w p ps 0.3 t "100 Hz", \
|
stub."100.txt" u n(4) w p ps 0.3 t "100 Hz", \
|
||||||
stub."200.txt" u n(4) w p ps 0.3 t "200 Hz", \
|
stub."200.txt" u n(4) w p ps 0.3 t "200 Hz", \
|
||||||
stub."400.txt" u n(4) w p ps 0.3 t "400 Hz", \
|
stub."400.txt" u n(4) w p ps 0.3 t "400 Hz", \
|
||||||
|