This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ADC + PPI + Timer on the nRF51822 polling too fast

I have the following ADC code: bitbucket.org/.../eakpq

I have been trying for the past few days to get this code to just perform a single ADC scan, on five channels, once every 100ms.

It seems like this should be simple to do and I think the code should work, I have been referencing the example here: github.com/.../main.c

However, it does not work as expected. Instead of polling for an ADC sample once every 100ms it seems to poll as fast as possible and the ADC readings happen back to back. Polling so quickly seems to be stealing CPU from the Bluetooth module which subsequently disconnects.

If anybody could have a quick read over that code and let me know what I am doing wrong that would be much appreciated. I have poured over the documentation and cannot seem to work it out.

Related