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

Reading analog and TWI signals while using the ble_peripheral_uart in SDK15.0.0 and sending strings to an iPhone

I am trying to read values from an analog peripheral device. To perform an analog read, I am using this example from the NordicSnippets simple examples:

https://github.com/andenore/NordicSnippets/blob/master/examples/saadc/main.c

I want to transmit the reading from the analog device to an iphone over BLE using the ble_peripheral_uart example in the SDK. The problem is that the connection between the iphone (central) and the BL652 (peripheral) keeps crashing every time I try to read from the analog signal and send. It happens in a very peculiar way: The two devices connect, then a small time later I get 

"Error Code: The connection has timed out unexpectedly" in red font from the log in nRF Toolbox iPhone app.

The funny thing is: the peripheral disconnects successfully, as shown by its LED on its board and by its advertisement in another device. But the iphone app that originally connected still wants to disconnect, but cannot. 

When I remove the clock tasks from lines 8 to 11, the program runs, but the values from the analog read are not reasonable or responsive to changes in the sensor. 

We wish to generalize the pin assignment of the port by changing the index of the NRF_SAADC->CH[0] to NRF_SAADC->CH[pin]. What does the value of this argument actually correspond to?

I am currently working on a Laird DK, which follows the layout of pca10040.h (with the exception of a clock parameter, which has already been fixed).

Using Nordic's SDK 15.0.0

SoftDevice 132 v6.0.0

Thanks in advance for any help. I really appreciate it.

Parents Reply Children
No Data
Related