- May 18, 2021 at 10:00 pm #16733pkstrskParticipant
Hello, I have been struggling to achieve the 6.66kHz output data rate using python on a raspberry pi 4 connected via SPI. I am writing the data directly to the RAM and storing it after it has colected required number of samples. However, I can’t hit more than 3.3kHz. I believe I set the registers correctly, crunched most of the datasheet for the LSM6DSL, but I can’t figure it out. Any chance someone has a working example of 6.66kHz over SPI to Pi?
I want to explore all options, before declaring Python being slow as the culprit 🙂
Any help will be highly appreciated, thanks.
Matt.May 18, 2021 at 11:10 pm #16734richardpParticipant
We haven’t been able to get up to 6.664KHz using python, we think it is too slow.
Using C, we were able to get up to 5.2KHz on a Raspberry Pi 3, and this was while doing other stuff in between. You might be able to get it running at 6.664Khz with C on a Pi 4 and using the optimisation flag.
BTW:An Arduino has no problem getting it to run at full speed.
Richard --OzzMaker.com --July 7, 2021 at 5:04 am #16818pkstrskParticipant
Hello again, I have made a few experiments, but I haven’t been able to make it work using C (not my favourite programming language :D). Any chance there are some examples available where the mentioned 5kHz sample rate was achieved that I could work with?
Thanks in advance,
- You must be logged in to reply to this topic.