Closed AndreasLamparter closed 2 years ago
Hi Andreas,
The 470 hz update rate comes directly from the data sheet specs, but I have not tried to run that fast (at least not in a long time). I will look into the library code to see if something is limiting the rate. I suspect it may be limited because the ADC is operated in single conversion mode, which makes sharing the SPI bus easier. It's also better for low power applications because the ADC goes into standby between readings.
As soon as I get a moment to sit down with the hardware I'll see if I can get the full rate by forcing continuous conversion mode.
Hi,
if i use two channels, the update rate is reduced by half. With 6 channels the speed is at 30Hz.
That is the expected behavior. The channels are multiplexed, so your maximum data rate is divided up over the total number of channels. There is also a settling time for each time the channel is changed. The settling time is 1/(2 x f), where f is the selected output data rate, according to the datasheet. Because of the settling time, the actual output rate when using multiple channels will always be less than [ rate / channel count ].
I just committed an update to the library that includes an example for running in continuous mode at 470Hz. You can only do it on one channel at a time however. That is just the way the chip works I'm afraid. It also will not play nice with other devices on the same SPI bus. The update is on GitHub now. It is release 1.2.0 and should propagate out to the Arduino Library Manager soon.
I also add a method called setChopEnabled(bool)
to disable the "chop" feature. Doing so will get you significant increase in the effective sampling rate when using the default single conversion mode. I was getting around 280Hz for a single channel, and about 45Hz for all 6 channels in my testing. The downside is that the datasheet warns that there may be some long term drift in the output when running with chop disabled. I added the line //adc.setChopEnabled(false);
to the Read_6Ch example so it can just be uncommented to try it out.
I hope this is helpful to anyone needs a little more speed out of this device.
I've tested it and it works. Thank you for the fast help!
Hi,
i reached for a single channel only a update range about 178Hz. The update range is set to 470. Any ideas ?
Best regards Andreas
Device: Adafruit Feather nRF52840 Sense
Code: