Interfacing DA14580 with ECG Monitoring Module on ADC

9 posts / 0 new
Last post
herochua617
Offline
Last seen:3 years 9 months ago
Joined:2017-01-18 12:46
Interfacing DA14580 with ECG Monitoring Module on ADC

Hi there,

I having some difficulties in these few things:

1. I want to connecthttps://www.sparkfun.com/products/12650to the DA14580 development kit. The dev. kit only have 4 ADC channels and since I am using SPI communication, I have my P0_3 and P0_0 used up. By right I only need 1 adc port from the output of the AD8232 module and 2 digital IO from dev. kit. I have seen the keil file in ble_app_peripheral and found that I need to configure from gpio.c. Can the DA14580 dev. kit provide 2 digital IO pins to the AD8232 module? and How to configure pins for both ADC and digital IO?

2. Can the ATT and GATT functions allow me to use BLE scanner to receive real time information to obtain the ECG waveform and Heart rate reading? If cannot, any recommendation application that allow me to display my data through android platform or any equivalent software if not using android platform? (for remote monitoring purposes)

Thank you!

Device:
MT_dialog
Offline
Last seen:1 month 5 days ago
Staff
Joined:2015-06-08 11:34
Hi herochua617,

Hi herochua617,

1) I am not sure i get the question, the pins that have ADC functionallity are predefined, from PORT0 the pins 0,1,2,3, only on those pins the ADC can be connected. The pins that you are mentioning are only used for the booting procedure, after the device has booted you can configure and use those pins as you would like, the booting procedure is controlled by the Boot ROM code, you dont have to worry about setting those pins to SPI yourself. You just have to set in your fw the configuration for the pins that you would like to use. You can switch the configuration of the pins just by invoking the function GPIO_ConfigurePin() and the settings you would like.

2) The SDK will allow you to connect to a BLE android phone and exchange data using the ATT/GATT/GAP protocol and receive real time information from your sensor, you can check the app_ble_peripheral that implements a custom profile in order to send custom data from your device to the phone. Yes the BLE scanner would be a solution to check the notification characteristic updating on your phone with your ADC measurements.

Thanks MT_dialog

herochua617
Offline
Last seen:3 years 9 months ago
Joined:2017-01-18 12:46
Dear MT_Dialog,

Dear MT_Dialog,

Thanks and you've answered me well for both questions, However, just to be sure, for the question in number 1, did you mean that the pin configuration (shown in the attach picture) need to be connected only before the device boot? After the device booted, I am allowed to remove all those connections, and I can burn my code into the dev. kit as I wish without connecting them, correct me if I am wrong.

Additional question: Which c files or h files in ble_app_peripheral_580, that I need to start with if I want to configure the GPIO pins? There so many files. I know that the configure pins variable is already set up in gpio.c and gpio.h. Where do I need to code if I want to use the ADC ports and the GPIO ports? Or I need to make a custom profile? For configuring ADC pins for ECG signal, do this something to do with this document (RW-BLE-PRF-HRP-IS) - Heart Rate Profile?

MT_dialog
Offline
Last seen:1 month 5 days ago
Staff
Joined:2015-06-08 11:34
Hi herochua617,

Hi herochua617,

Sorry, i cannot figure out that much from the picture that you 've pasted in the first post, what i ve mentioned on my previous post is that the SPI pins are only used during the booting procedure, i am not able to predict if by having connected your ADC sensor on the booting pins will have any affect in downloading the program into the sysram (i suppose that it will be ok). When the system boots, if there is nothing in the OTP, the pins from port 0 are configured and used in order for the 580 to find an external module to download code (when i mention pin configuration i mean the code that either the bootloader of you fw has in the set_pad_functions() function in order to assign a function and a state to your pins), so the pins that you are going to download code from should be connected with the external memory, after the download of the code is complete then your fw should reconfigure those pins (from the set_pad_functions() function in your fw) in order to be used in any configurations the fw would like. I hope thats clear.

The file and the function that handles the configuration of your pins during start up and during wake up is the periph_init() function in the user_periph_setup.c file. If you would like to just to read the attached ADC, you will have to configure the pin that is connected with your ADC sensor as a PID_ADC pin (check the set_pad_functions() in an example to see how the pins are configured). After you have configured your pin, normally you would set up a ke_timer in order to read the ADC value periodically. In order to send the value to your central you can either start with a custom profile or use the HRPS which is a SIG qualified profile. The document that you mentioned describes the HRPS protocol, it has nothing to do in configuring the ADC, it only describes the HRP SIG profile.

Thanks MT_dialog

herochua617
Offline
Last seen:3 years 9 months ago
Joined:2017-01-18 12:46
Hi,

Hi,

Thank you very much! I have been searching around for example regarding the set_pad_functions() to see how the pins are configured. But I could not find any related example. If you don't mind, do you have any example that I can start with? I have already downloaded the whole sdk 5.0.3.

MT_dialog
Offline
Last seen:1 month 5 days ago
Staff
Joined:2015-06-08 11:34
Hi herochua617,

Hi herochua617,

The set_pad_functions() is a function used throughout the SDK in all the SDK examples and the reference designs, if you make a search in any example that includes BLE functionallity you will be able to find this function, or you can search the GPIO_ConfigurePin() directly.

Thanks MT_dialog

herochua617
Offline
Last seen:3 years 9 months ago
Joined:2017-01-18 12:46
Hi MT_dialog,

Hi MT_dialog,

我做过针保留和别针configuration with defining the pins in both user_periph_setup.h* and user_periph_setup.c* but I am unable to read the data from ADC yet. (refer to the attachment) But I do want the data to be obtained through BLE from the smartphone. I did heard from you that I need to do something with the ke_timer is it? Do you have any example that I can refer too>? I found that this link kind of related toohttps://support.dialog-semiconductor.com/faq/how-use-ketimer-during-wake....

Besides that, I would like to display my data through Tera Term using UART communication. Which part of the coding should I changed?

I am sorry to trouble you but I have a little knowledge in using the DA14580 development kit and I have my deadline coming in for my project..
Thank you!

MT_dialog
Offline
Last seen:1 month 5 days ago
Staff
Joined:2015-06-08 11:34
Hi herochua617,

Hi herochua617,

You have to set up a kernel timer in order to trigger the ADC to measure, you can have a look at the adc example in the peripheral_examples in order to see how to operate the ADC and you can also have a look at the ble_app_peripheral example in order to check how to setup a kernel timer (in the function user_custs1_ctrl_wr_ind_handler() function the app_easy_timer() will setup a kernel timer and from that function you can declare a callback function in order to read your ADC in specific intervals). Regarding the printing you can define the CFG_PRINTF definition in the da1458x_config_basic.h function and use the arch_console.h file and the arch_printf() function in order to start printing the values of your ADC. Also please have a look at the UM-B-050 and the UM-B-051 documents in order to have a better grasp of the SDK5. You will be able to find those documents on the support portal in the Documents Tab in the Software Development kit.

Thanks MT_dialog

herochua617
Offline
Last seen:3 years 9 months ago
Joined:2017-01-18 12:46
Dear MT_dialog, Thanks!

Dear MT_dialog,

Thanks!