4 posts / 0 new
Last post
Krixen
Offline
Last seen:3.years 6 months ago
加入:2015-09-28 16:27
DA14580 Peripherals

I am working through the code 'ble peripherals' in the SDK example codes given. I am trying to use the ADC in order to sample
an input at 4MHz and then send it over the air to a terminal via bluetooth.

a few questions I have:

1. How do you select which pin you want to be the ADC?

2. How do you change the sampling speed of the ADC?

3.. How can you send the data over the bluetooth terminal (this is my first time using a bluetooth protocol). What is the function name?

Thank you

Device:
MT_dialog
Offline
Last seen:1 week 3 days ago
工作人员
加入:2015-06-08 11:34
Hi Krixen,

Hi Krixen,

Please have a look at the following document UM-B-051 in the Peripheral Drivers Section, there you can find all the info you need for working with the ADC. There is no function that just sends the value over bluetooth. You ve got to undestand the protocol and how it works. And you wont be able to just send adc values to a terminal......You need to use a custom profile where your adc value will be placed in characteristic and then that value will be sent to the host device through a notification or an indication. You can check the app_ble_peripheral example where a custom profile is set and a imaginary adc value (its just a random value) is send over that profile.

Thanks MT_dialog

Krixen
Offline
Last seen:3.years 6 months ago
加入:2015-09-28 16:27
I am finding the code

I am finding the code examples extremely confusing.

What I am trying to do is take in data and sample it (around 4MHz) with an ADC. From there I want to be able to send that data over the air continuously to a computer to be processed.
Setting up a custom profile seemed pretty convoluted, I guess you need to set up one in order to send data over.

What sample code do you think I should work off of?

MT_dialog
Offline
Last seen:1 week 3 days ago
工作人员
加入:2015-06-08 11:34
Hi krixen,

Hi krixen,

You can use the ble_app_peripheral and check the app_adcval1_timer_cb_handler() in the user_custs1_impl.c file. It uses an incremental value to emulate a value from the adc. You can change that and add the adc example from the peripheral_examples.

Thanks MT_dialog