Good afternoon,
I have only a few months of experience in programming and measuring with electronic devices. I recently bought a RPi hat ADS1263 (https://www.waveshare.com/18983.htm). My aim is to measure accelerations at about 14k SPS with a Raspberry Pi, and log these accelerations into a csv file, for further analysis. The problem is that I am currently stuck at about 600 SPS (not stable).
I have looked deeply into the datasheet, and the python libraries and couldn't find any parameter that would have an influence, except by changing the data rate ; even when selecting a data rate of 1200 SPS, or higher, I still have less than 600 SPS.
I suppose the problem comes from my code, but I couldn't find any code or indication on the internet. So here is my question: What are the parameters I should modify in the python libraries, and what code structure should I use?
I suspect the problem is that I put the reading function into a loop, and that the frequency at which the loop is achieved depends on the RPi, not on the ADC ; however I don't know how else I am suppose to read and log the values.
Currently, my code is structured as following:
Initialization of the module (function ADC.ADS1263_init() )
While (duration < 5s):
reading function (ADC.ADS1263_GetChannalValue)
Value added to an array
Array to csv file
Module exit (ADC.ADS1263_Exit() )
I would be amazingly grateful if someone had a piece of code, or at least concrete indications on how to achieve 14k SPS measurements.
Thank you very much
Thomas