Dear Dialog Team,
I recently purchased the basic dev Kit for the DA14580. I am very new to programming itself and want to read an ADC Value or Digital Pin state and transmit the data via bluetooth to smart phone with dsps.
I do not know where to implement the code and already spent so much time in trying to figure it out.
我真的很欣赏你的eSay和快速示例。从那时起,我就可以改变了und und the代码。
Please get back to me as soon as you can, really appreciate the help.
Device:
kiwi85,
While you're waiting for Dialog to return, you might want to look at the ble_app_peripheral example in the SDK and the documentation for it in UM-B-050. It shows reading an ADC value into a BLE characteristic that can be read by an app on your phone. This example also has a characteristic for toggling the LED, which is essentially writing to a GPIO pin from your phone.
我正在使用修改的BLE_APP_PERPIHERAL示例代码来通过ADC频道读取传感器数据并读/写GPIO引脚,并为此工作。
However, I'm not sure you're going to find anything that's "easy and quick" in this environment! The degree of difficulty of the SDK code is rather on the high side for novice programmers.
Regards, Max
It was a while ok you replied, so hopefully you have an answer. I've the basic dev kit, I'm a experienced developer, software and some hardware but new to this board and chip. You say "code to read sensor data through the ADC channels and read/write GPIO pins" . Any chance you can elaborate ? I'm struggling looking at schematics to see which header pin on the board is attached to the ADC ?
Many thanks
Andy
Looking further at the docs, I see that adc_enable_channel takes a channel number as an arguement. This will be one of :
#define ADC_CHANNEL_P00 0
#define ADC_CHANNEL_P01 1
#define ADC_CHANNEL_P02 2
#define ADC_CHANNEL_P03 3
#define ADC_CHANNEL_AVS 4
#define ADC_CHANNEL_VDD_REF 5
#define ADC_CHANNEL_VDD_RTT 6
#define ADC_CHANNEL_VBAT3V 7
#define ADC_CHANNEL_VDCDC 8
#define ADC_CHANNEL_VBAT1V 9
So I guess the first 4 P0 wires are the ADC channels on the 28 pin header.
Andy
你好,马克斯,谢谢你这么多的快reply.
You would not have a project file I can use to get started by any chance? I am just totally new and lost and want to have a little success in getting my circuitry running.
Please help:-)
The ble_app_peripheral example is a complete project you can load and examine (and modify). Look at ~\Dialog\DA1458x_SDK_5.0.4\DA1458x_SDK\5.0.4\projects\target_apps\ble_examples\ble_app_peripheral\Keil_5. This will run as is on your design kit.
Hello Max,
ok I have already had a gaze at it and I would just like to know how the adc value will be sent out so that I can receive the value in the dsps app for android.
Maybe I am not even close to be on the right track with that.
Thanks alot
I'm not using DSPS, so I may not be any help there. I'm using a custom Android app to receive the ADC data directly via the BLE characteristic, ADC data is sent out as a 2 byte value containing the 10 bits of ADC data. If you want to try this with the example code without DSPS, you can use the BlueLoupe app (free download) to read and display data on an Android phone tablet.
Hi kiwi85,
由于您刚刚开始使用580,DSP项目是一个非常复杂的Begginer甚至更加复杂的示例,所以如果您也不熟悉BLE协议,如果您想仅将ADC数据从设备转移到另一个设备DSP项目除非你想要串行函数,否则不是必须的。因此,除非您希望有一个串行接口,否则您可以查看仿真ADC测量的SDK示例,并将其发送到链接的另一侧(如MAX44 incorly建议),请在ble_app_peripheral中检查app_adcvall_timer_cb_handler()示例项目,这是定期触发的函数并将数据发送到另一侧。此外,如果您是BLE协议的新功能,我建议检查该技术的一些基本方面,尤其是如何通过数据库和通知属性逐渐增加数据传输。
Regarding the DSPS and sending data, you can have a look at this posthttps://support.dialog-semicondiondiondum/forums/post/dialog-smartbond-bl ...but still before going to the DSPS check some simple examples on the SDK.
Thanks MT_dialog
kiwi85,
As a final comment, something else you might want to try to get started:
I got the same Basic Design Kit about 1 year ago. I started using it with the much simpler and easier to understand peripheral examples in the SDK before diving into the BLE operations. You can send data out the J-Link serial port and display it on a terminal emulator on your computer (I use a PC with TeraTerm) without having to deal with the complexity of the BLE stack. This will allow you to hook up external sensors and such to the ADC pins and read/write GPIO via the Design Kit connectors.
Cheers! Max