你好,
我在这几件事上遇到了一些困难:
1我想连接https://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?
2ATT和GATT功能是否允许我使用BLE扫描仪接收实时信息以获取ECG波形和心率读数?如果不能,任何推荐应用程序,允许我显示我的数据通过android平台或任何同等软件,如果不使用android平台(用于远程监控)
谢谢您!
设备:
你好herochua617,
1) 我不确定我是否明白这个问题,具有ADC功能的管脚是预定义的,从端口0到管脚0、1、2、3,只有在这些管脚上才能连接ADC。您提到的管脚仅用于引导过程,设备引导后,您可以根据需要配置和使用这些管脚,引导过程由引导ROM代码控制,您不必担心自己将这些管脚设置为SPI。你只需要在你的固件中设置你想要使用的引脚的配置。只需调用函数GPIO\u ConfigurePin()和所需的设置,就可以切换管脚的配置。
2) SDK将允许您连接到BLE android手机并使用ATT/GATT/GAP协议交换数据,并从传感器接收实时信息,您可以检查实现自定义配置文件的应用程序外围设备,以便将自定义数据从设备发送到手机。是的,BLE扫描仪将是一个解决方案,以检查您的ADC测量在您的手机上更新的通知特征。
Thanks MT_dialog
Dear MT_Dialog,
谢谢,这两个问题你都回答得很好,不过,请确定,对于第一个问题,你的意思是引脚配置(如附件图片所示)只需要在设备启动前连接吗?设备启动后,我可以删除所有这些连接,我可以把我的代码烧录到开发工具包中,如果我没有连接它们,请纠正我的错误。
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?
你好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
你好,
非常感谢你!例如,我一直在四处搜索set\u pad\u functions()以了解如何配置管脚。但我找不到任何相关的例子。如果你不介意的话,你有什么例子可以让我从中开始吗?我已经下载了整个sdk5.0.3。
你好herochua617,
set\u pad\u functions()是整个SDK中所有SDK示例和参考设计中使用的函数,如果您在任何包含可配置函数的示例中进行搜索,您将能够找到此函数,或者您可以直接搜索GPIO\u ConfigurePin()。
Thanks MT_dialog
嗨,MT\u dialog,
我已经完成了在user\u periph\u setup.h*和user\u periph\u setup.c*中定义管脚的管脚保留和管脚配置,但是我还无法从ADC读取数据(请参阅附件),但我确实希望通过智能手机上的BLE获取数据。我确实听你说我需要用计时器做点什么,是吗?你有什么我也可以参考的例子吗?我发现这种联系也有点关联https://support.dialog-semiconductor.com/faq/how-use-ketimer-during-wake....
除此之外,我想用UART通信通过Tera术语显示我的数据。我应该更改代码的哪一部分?
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..
谢谢您!
你好herochua617,
为了触发ADC来测量,您可以查看外围设备示例中的adc示例,以了解如何操作adc,也可以查看ble\U app\U外围设备示例,以检查如何设置内核计时器(在函数user\u custs1\u ctrl\u wr\u ind\u handler()函数中,app\u easy\u timer()将设置内核计时器,并从该函数中可以可以声明回调函数,以便在特定的时间间隔内读取ADC)。关于打印,您可以在da1458x\u config\u basic.h函数中定义CFG\u PRINTF定义,并使用arch\u console.h文件和arch\u PRINTF()函数开始打印ADC的值。另外,请查看UM-B-050和UM-B-051文档,以便更好地掌握SDK5。您将能够在软件开发工具包的文档选项卡中的支持门户上找到这些文档。
Thanks MT_dialog
Dear MT_dialog,
Thanks!