2023-05-05 01:23 AM
Hi,is it possible to acquire data from multiple sensors at the same time? Let me explain better, I have to acquire HR data from a PPG MAX30102 and the time between querying and receiving the data is about 2.5 ms, after which I should interrogate two other sensors and in total I would like to acquire at 240 Hz but I fear that reading sensors in sequence this is not possible. Is there a way to read data from sensors simultaneously and not one after the other? I am using an stm32 Nucleo-64 with Arduino IDE. Moreover there is a way to set the output frequency of a port to 240 Hz like in stmCUBE?
2023-05-05 02:03 AM
For simultaneous polling of the sensors, each sensor must be connected to its own communication interface. In addition, it can make sense to transfer the data via DMA, because this can maximise the parallelisation of the read-in.
Why don't you just use the much more flexible STM32CubeIDE for configuration and debugging?
Regards
/Peter
2023-05-05 04:47 AM
Unfortunately Arduino tends to reinforce the single linear execution mindset.
You can do more than one thing concurrently on different buses/sensors, especially if their response is delayed.
You need to start thinking in a threaded or interrupt model, where more than one thing can be happening at once, and you sequence through states, as they occur on the time-line, rather than sitting in a delay loop blocking.