需求方推动I2C数据

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
9个帖子/ 0新
Last post
ahiggs
Offline
Last seen:7个月3天前
加入:2019-12-17 07:10
需求方推动I2C数据

Hello,

I am currently running the DSPS_device example on my DA14585 dev kit and am attempting to have the 14585 push its own data on to the buffer to send to the host. For the host, I am connecting to the 14585 with my phone using the DSPS android app and am able to send data to the 14585, but not receive from it.

I am attempting to push data to the buffer using the user_ble_push() function and a timer. The function runs every 5 seconds and the test data shows up on the com port of the device, but not in the received data on my phone's DSPS app.

我对代码进行的唯一更改是将Flow_Control_config定义为1(在user_periph_setup.h中)以及向user_sps_scheduler.cn(下面的代码)添加我的函数。

Am I not pushing data to the buffer correctly?

谢谢!

void test_function(){uint8_t msgs [] =“test_fn_buf_push \ r \ n”;user_ble_push(msgs,sizeof(msgs));//重新启动计时器计时器= app_easy_timer(timer_delay,test_function); // timer_delay 500}

设备:
PM_Dialog
Offline
Last seen:5天16小时前
工作人员
加入:2018-02-08 11:03
嗨ahiggs,

嗨ahiggs,

在您的论坛线程的一点点中,您提到您希望从I2C推送数据。那是对的吗?DSP模拟串行电缆通信并将数据推送到UART。Flow_Control_config将UART流控制设置为软件流控制(XON / XOF)或硬件流量控制(RTS / CTS)。在扩展睡眠模式配置的情况下,需要硬件流控制才能唤醒设备。DSP永远不会永久无效地睡着,醒来才能为BLE事件服务,即使没有任何数据发送DA将唤醒以保持与主机的连接。当设备醒来时,它会将RTS线切换到低,以指示他准备好(设备将在每个连接间隔或广告间隔中唤醒RTS低电平。另请注意,当设备接收时,当传输的数据到达内部FIFO阈值时,RTS将返回高电平,以通知它应该停止发送数据的另一侧。当在BLE接口中有可用数据时,User_sps_server_data_rx_ind_handler()在外围模式下调用user_ble_push()函数。它将数据推在BLE_TO_PERIPH_BUFFER循环缓冲器中,并检查缓冲级别是否超过高水印以向对等设备发送流关闭信号。 Please refer to theUM-B-088:对话框串行端口配置文件的用户手册(DA14585)for more information.

Thanks, PM_Dialog

ahiggs
Offline
Last seen:7个月3天前
加入:2019-12-17 07:10
感谢你的回复。

感谢你的回复。

The way our project is currently set up has an ATTiny reading a sensor and sending data to the uart on the DA which sends it via bluetooth to the DSPS_central device to log on a computer.

我想消除主题并让外围DA读取I2C传感器(已经在不同的项目中完成),然后通过蓝牙将数据发送到中央。因此,我尝试使用上面给出的test_function()将测试数据推入Periph_to_ble缓冲区。

PM_Dialog
Offline
Last seen:5天16小时前
工作人员
加入:2018-02-08 11:03
嗨ahiggs,

嗨ahiggs,

的user_ble_push() function is looking for a pointer and a length similarly. This will pass the data to FIFO buffer and send the data via BLE. Can you please run it in debug mode and add a breakpoint into user_ble_push()? Have you done any other modifications in the DSPS device project? Please share them and I will try to replicate it.

Thanks, PM_Dialog

ahiggs
Offline
Last seen:7个月3天前
加入:2019-12-17 07:10
我放了一个断点

我在user_ble_push函数上放置了一个断点,并验证了它是否达到。从我从数据表中了解的情况下,如果按下数据以启动BLE传输,也需要运行user_ble_pull功能。我已将新代码包含在下面的test_function

The only modifications I have made are the test_function() and associated timer in user_scheduler_init() as well as changing to SW flow control in user_periph_setup.h

Thank you for your help, I will have time tomorrow (in ~16 hours) to continue work

void test_function(){ user_ble_push(msgs,sizeof(msgs)); user_ble_pull(true, NULL); timer = app_easy_timer(TIMER_DELAY,test_function); }

PM_Dialog
Offline
Last seen:5天16小时前
工作人员
加入:2018-02-08 11:03
嗨ahiggs,

嗨ahiggs,

Thanks for sharing the code. I will try to replicate in my side.

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen:5天16小时前
工作人员
加入:2018-02-08 11:03
嗨ahiggs,

嗨ahiggs,

Sorry for my late response. You mentioned that you are using SW flow control. Can I ask if you are using extended sleep mode configuration in the DSPS firmware? If yes, you should use HW flow control or remove the sleep configuration.

Thanks, PM_Dialog

ahiggs
Offline
Last seen:7个月3天前
加入:2019-12-17 07:10
延迟没问题。I

延迟没问题。我最终通过使用user_send_ble_data()命令查找替代方法。

我正在使用SW流量控制。在''user_config.h'下我有app_default_sleep_mode调成ARCH_EXT_SLEEP_ON., but you're suggesting to set this toArch_sleep_off.?

I obviously haven't burnt the OTP, but the final application将要有OTP烧焦。

编辑:

我刚刚尝试改变睡眠设置,但函数user_ble_push()函数仍未导致任何要发送到DSP应用程序的东西。

PM_Dialog
Offline
Last seen:5天16小时前
工作人员
加入:2018-02-08 11:03
嗨ahiggs,

嗨ahiggs,

In case of extended sleep mode configuration (app_default_sleep_mode = ARCH_EXT_SLEEP_ON), hardware flow control is required in order to wake up the device. The DSPS is never permanently inactive it falls asleep and wakes up in order to serve BLE events, even if there isn't any data to send the da will wake up to keep the connection with the host active. When the device wakes up, it will toggle the RTS line to low in order to indicate that it he is ready (the device will pull the RTS low whenever it wakes up, in every connection interval or advertising interval). Also be aware that when the device is receiving, when the data transmitted reach the internal FIFO threshold the RTS will go back to high to notify to the other side that it should stop send data. According to user manual, note 2 in page 7, software flow control is partially supported in Extended sleep mode. Only incoming serial data can be controlled by DA14580 device. Any incoming XON/XOFF will be ignored during sleep time. On the contrary, software flow control is fully supported in Active mode. Also upon the reception of a flow off signal (0x19) an amount of up to 16 bytes can be transmitted by the DA14580 until transmission stops. Not sure what happened in your set up, but my recommendation would be to use HW Flow control in sleep mode.

Thanks, PM_Dialog