嗨mt_dialog,
回顾我的最后一篇文章http://support.dialog-semicondiondiondum/dsps-large-current-consumption.,我可以继续提出问题如何在DSP项目中实现低电流消耗吗?
I'm using official DA14580EVKT-B now. I have tested the current consumption by using HW or SW flow control. If HW flow control is used, the current consumption is below 1mA. If SW flow control is used, the current consumption is nearly 2.x mA. Because the limitation of I/O pins of MCU master, I can't use the approach of HW flow control. But the current consumption of using SW flow control is still quite high, how to lower the current consumption below 1mA?
此外,如果我配置UART1_TX,UART1_RX,UART1_RTS&UART1_CTS到端口2,则将消耗2MA更多电流,请告知。
谢谢。
设备:
嗨Jackiechau,
使用SW流量控制其更大的功耗,因为您必须更常见的是醒来的顺序发送流量控制信号,等待额外的字节接收等,SW流量控制比HW流量控制更详细,并保持580令人欣赏频繁地。您无法降低功耗,如果您确实存在丢失数据的侧面。只要它在DSPS应用笔记中提到的睡眠模式下运行时,DSP就会从电源消耗视角显示从功耗角度优化。
在港口2上的引脚你放置了UART引脚?
谢谢mt_dialog.
嗨mt_dialog,
实际上我拥有未定义的H / W&S / W流量控制,并希望使用外部MCU的GPIO来唤醒14580以进行数据接收和传输(上升沿唤醒14580和下降以放置睡眠)。已实施14580的所有功能,但目前的消费量为1x mA。你介意我寄给你我的整个项目的源代码,你帮我看看吗?谢谢。
嗨mt_dialog,
在我的项目中,14580周期性地广播SSID并通过UART1从外部MCU接收数据。因为它在未定义的H / W和S / W流量控制(UART TX和RX FIFO应该为空)后,它总是消耗1x MA电流,
1. Can I force 14580 to sleep mode after broadcasting SSID? How to do it?
2. One of GPIO of 14580 is configured as interrupt pin to detect logic high or low, if logic high is detected, 14580 is forced to active forever. If logic low is detected, 14580 is forced to sleep. Is it possible to do it? Should I use app_force_active_mode and app_restore_sleep_mode?
3.如果A-B-026,则必须按顺序定义H / W流量控制(我认为H / W流量控制,并且14580不应该睡得无关),我可以使用外部MCU的“GPIO 1”,为CTS提供14580的复位脉冲,以便唤醒14580,并使用外部MCU的“GPIO 2”检测RTS的下边缘,以便传输和接收数据?
谢谢。
嗨Jackiechau,
1)您的意思是在永久睡眠中设置您的设备而无需广告或仅启用睡眠功能?您可以在发送SSID后发出停止广告命令并设置计时器或按钮,以便您的设备唤醒(这将使您的设备放在永久睡眠中,您还必须在睡眠模式下设置设备通过调用)ARCH_SET_EXTEDDE_SLEEP()或者您只能调用ARCH_SET_EXTEDDE_SLEEP()并动态更改睡眠模式(这将在广告之间设置您的设备。
2)app_force_active_mode()和app_restore_sleep_mode()允许您在睡眠模式之间切换不同任务所请求的,它会从App_force_Active_Mode()的不同验证中保持计数,并且当每个任务调用Restore_sleep()时,它会减少计数零是设备可以贪婪地睡觉才能睡眠,可以在UM-B-006文档中找到功能的文档。ARCH_SET_EXTEDDED_SLEEP(SDK5)或APP_SET_EXTEDDED_SLEEP(SDK3)可以强制将设备免疫粘贴到睡眠模式中设置。
3)DSP不设计为由于数据丢失而无流量控制,睡眠和流量控制深入相关,因为DSP无法实现外部唤醒,当设备跌至睡眠时,它保持RTS高次数为防止外部MCU发送任何数据。如果在580睡眠时发送数据,则会有数据丢失。是的,我想你可以实现580将使用流量控制的情况,并且外部MCU将触发580醒来并等到580准备好以便开始发送数据。
本地团队将通过您的注册电子邮件地址与您联系。
谢谢mt_dialog.
嗨mt_dialog,
I will contact your distributer next week but I would like to know why master Mcu can't wake up BLE by RTS if hardware flow control is defined and ext_sleep is enabled. When ext_sleep is disabled, I check CTS interrupt can be triggered and correct data can be received, it seems BLE can't be woke up, please kindly advise.
Hi jackiechau,
DSP不仅仅是通过设计实现的,通过唤醒控制器外部唤醒,它只是以垂直间隔唤醒,以便保持连接,当它唤醒时,它才能为其拉低其RTS另一边知道它是令人醒目的并且能够接收数据。您必须启用外部唤醒控制器并将其设置为适当的PIN,以便通过MCU的RTS信号唤醒,并且还需要进一步的修改以覆盖先前的功能,并通过中断调整唤醒。
谢谢mt_dialog.
嗨mt_dialog,
你提到了
1. I found "Enable wake up controller" by EXTERNAL_WAKEUP but do you mean RTS of master Mcu should also connect to another pin of BLE, BLE sleep can be disabled in this gpio interrupt handler and BLE sleep can be enabled somewhere?
2. Futher modification, please provide the example.
谢谢。
嗨mt_dialog,
参考http://support.dialog-semicondiondiondiond.com/dsps-use-gpio-control-its-extend ..., I have followed the smart tag reference design in the app_button_press_cb() function, connected RTS of master MCU to P1_0 for external wake up interrupt and reserved P0_2 for CTS of BLE. However, it seemed BLE couldn't be woke up and nothing was printed in app_cts_logi_high_cb(void).
在periph_setup.c
void gpio_reservations(无效)
{
保留_GPIO(Push_Button,GPIO_PORT_1,GPIO_PIN_0,PID_GPIO);
RESERVE_GPIO( UART1_TX, UART1_TX_PORT, UART1_TX_PIN, PID_UART1_TX);
保留_GPIO(UART1_RX,UART1_RX_PORT,UART1_RX_PIN,PID_UART1_RX);
#if(uart_hw_flow_enabled)
RESERVE_GPIO( UART1_RTS, UART1_RTS_PORT, UART1_RTS_PIN, PID_UART1_RTSN);
保留_GPIO(UART1_CTS,UART1_CTS_PORT,UART1_CTS_PIN,PID_UART1_CTSN);
#endif / * uart_hw_flow_enabled * /
//reserve for UART2 debug
保留_GPIO(UART2_TX,UART2_TX_PORT,UART2_TX_PIN,PID_UART2_TX);
保留_GPIO(UART2_RX,UART2_RX_PORT,UART2_RX_PIN,PID_UART2_RX);
}
#endif // development_debug.
/ **
****************************************************************************************
*@brief Map port pins
*
*映射UART和SPI端口引脚和GPIO端口
****************************************************************************************
* /
void set_pad_functions(void)//设置GPIO端口功能模式
{
gpio_configurepin(gpio_port_1,gpio_pin_0,input_pulldown,pid_gpio,false);
GPIO_CONFIGUREPIN(UART1_TX_PORT,UART1_TX_PIN,OUTPUT,PID_UART1_TX,FALSE);
GPIO_ConfigurePin( UART1_RX_PORT, UART1_RX_PIN, INPUT_PULLUP, PID_UART1_RX, false );
#if(uart_hw_flow_enabled)
GPIO_CONFIGUREPIN(UART1_RTS_PORT,UART1_RTS_PIN,OUTPUT,PID_UART1_RTSN,FALSE);
GPIO_ConfigurePin( UART1_CTS_PORT, UART1_CTS_PIN, INPUT_PULLUP, PID_UART1_CTSN, false );
#endif / * uart_hw_flow_enabled * /
// init pad.
GPIO_ConfigurePin(UART2_TX_PORT, UART2_TX_PIN, OUTPUT, PID_UART2_TX, false);
GPIO_CONFIGUREPIN(UART2_RX_PORT,UART2_RX_PIN,INPUT,PID_UART2_RX,FALSE);
/ *
*配置应用程序端口。
IE。
gpio_configurepin(gpio_port_0,gpio_pin_1,输出,pid_gpio,false);//将P_01设置为通用输出
* /
}
app_sps_device_project.c.
void app_cts_logic_high_cb(void)
{
if(getBits16(sys_stat_reg,per_is_down))
periph_init();
printf_string("\r\napp_cts_logic_high_cb\r\n");
/ *按下按钮,启动3SEC GURD定时器检测按钮长按
**并恢复按钮GPIO上的极性以检测释放
* /
wkupct_register_callback(app_cts_logic_low_cb);
wkupct_enable_irq(0x100,0x100,1,0x14);// p1_0,极性低,1个事件,脱嘴时间= 20ms
app_button_status = 1;
if(ke_state_get(task_app)== app_connectable)
{
只有我们在广告模式中才能唤醒唤醒。仅在ADV模式中,用户可以清除绑定数据。
app_ble_force_wakeup();
app_ble_ext_wakeup_off();
//向Task_App发送消息。We should set the timer APP_BUTTON_PRESS_TIMER when BLE is awake
ke_msg_send_basic(app_wakeup_msg,task_app,null);
}
}
void app_cts_logic_low_cb(void)
{
if(getBits16(sys_stat_reg,per_is_down))
periph_init();
printf_string(“\ r \ napp_cts_logic_low_cb \ r \ n”);
//按钮发布,停止App_Button_Press_Timer Gurd Timer
//并恢复按钮GPIO上的极性以检测按钮按下
wkupct_register_callback(app_cts_logic_high_cb);
wkupct_enable_irq(0x100, 0x000, 1, 0x14); // P1_0, polarity high, 1 event, debouncing time = 20ms
app_button_status = 0;
if(ke_state_get(task_app)== app_connectable)
{
只有我们在广告模式中才能唤醒唤醒。仅在ADV模式中,用户可以清除绑定数据。
app_ble_force_wakeup();
app_ble_ext_wakeup_off();
//向Task_App发送消息。我们应该清除Timer App_Button_Press_Timer时醒来时
ke_msg_send_basic(app_wakeup_msg,task_app,null);
}
}
void app_init_func(void)
{
app_set_rxirq_threshold(ble_rx_buffer_cnt / 4);
app_sps_init();
printf_string(“\ n \ rapp_init_func \ r \ n”);
wkupct_register_callback(app_cts_logic_high_cb);
wkupct_enable_irq(0x100, 0x000, 1, 0x14); // P1_0, polarity high, 1 event, debouncing time = 20ms
}
int app_wakeup_handler(ke_msg_id_t const msgid,
void * param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
// If state is not idle, ignore the message
if (ke_state_get(dest_id) == APP_CONNECTABLE)
{
/ *Check if reason of wake up was button press or release and set or clear the long press timer.
**请注意,只有在设备广告而未连接时才会发生这种情况
* /
if( app_button_status )
{
app_timer_set(app_button_press_timer,task_app,300);
}
别的
{
ke_timer_clear(app_button_press_timer,task_app);
}
/ *如果(adv_count == 0)
{
RESTART_ADV = 0;
app_adv_start();
* /
}
return(ke_msg_consumed);
}
int app_button_press_timer_handler(ke_msg_id_t const msgid,
void const * param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
/ *如果(gpio_getpinstatus(gpio_button_port,gpio_button_pin))
{
//从非vlolatile存储器清除绑定数据
app_clear_bond_data();
//播放一个音调,表示已删除绑定数据
app_proxr_pwm_enable(button_pwm_callback);
systick_usec_units(false);
systick_wait(app_pwm_disable_delay);
app_proxr_pwm_disable();
* /
return(ke_msg_consumed);
}
Hi jackiechau,
几个关于您粘贴的代码的评论,唤醒控制器的衰减时间为20ms,如果您正在为MCU的RTS切换,可能是因为唤醒时间未触发唤醒中断。要确保设备正在接收中断并唤醒,可以在唤醒回调中使用ARCH_SET_PXACT_GPIO()函数,并检查中断是否在智能片段中进行了三次,当函数pxact时,您应该看到红色垂直线叫)。此外,当BLE处于睡眠模式时,您无法在唤醒后立即使用UART,因为在唤醒后,580使用RC16振荡器运行,这允许您正确使用UART,您必须切换到XTAL16在使用UART和OFF COME等待XTAL定居之前。
You can find more information regarding the wakeup controller in the UM-B-051 document in the peripheral drivers section.
谢谢mt_dialog.
嗨mt_dialog,
1.我正在使用基本套件和刻录图像,通过SmartSnippet将图像刻录到EVB中,如果函数pxact仍然可以看到红色垂直线?如果是这样,应该使用哪种Smartsnippet的布局,这样我就可以看到红色垂直线?如果基本套件无法显示这一行,我可以做些什么来证明系统醒来?
Also, should I shorten the debouncing time parameter of wkupct_enable_irq() and increase the toggle time of MCU's RTS signal?
2. If wkupct_register_callback and wkupct_enable_irq aren't called, and original api gpio0_callback() of periph_setup.c will be triggered if master MCU toggles its RTS signal, it's quite weird that dialog can receive and transmit data to master MCU. However, if app_timer_set(SPS_TIMER,TASK_APP, 100) is called per 1 second, nothing can be received or transmitted from dialog side. Is it still related to the wakeup issue?
谢谢。
Hi jackiechau,
1)不幸的是,如果您使用的基本套件不支持电源分布器,可以尝试从睡眠中唤醒时切换LED,这可能有点棘手,因为DSP可能跟踪没有数据要发送,所以它会恢复睡眠,醒来时会切换LED,所以必须在中断例程中设置一个变量,并且唤醒时检查PERIPH_INIT中的变量,以查看PIN是否已设置,除此之外,您可以使用分析仪设置PIN并将其跟踪,以验证您的设备是否唤醒。是缩短了你的去抖参数,因为你正在使用来自外部的proccessor的脉冲,一个20ms的去抖时间不会做任何好的,只是把去抖时间设置为0。
2) gpio0_callback()是一个平凡的中断,this interrupt can only be called when the system is awake, when the 580 is in sleep mode this interrupt is not going to wake up the system. When sleeping only the interrupt from the wake up timer can wake up the 580. There is no relation between the kernel timers and the wakeup timer.
谢谢mt_dialog.
嗨mt_dialog,
Thanks for your help, it's done. But in my source code, I just wonder why I need to add several ms delay in gpio0_callback(), app_cts_logic_high_cb() and app_cts_logic_low_cb() in order that master MCU can transmit and receive UART data from 14580.
Hi jackiechau,
当中断击中580的醒来需要一些时间时,它不会立即醒来,这需要时间,直到XTAL切换和稳定是正确的。
谢谢mt_dialog.
嗨mt_dialog,
我想知道如何在app_adv_start之前关掉无线电,如果需要,我可以直接调用setbits16(pmu_ctrl_reg,radio_sleep)直接吗?谢谢。
布罗尔,
杰基
Hi jackiechau,
当设备不是广告时,无线电熄灭,当您调用App_adv_start时,SDK和BLE堆栈将在收到/传输数据的时间根据您设置的广告间隔接收/传输数据时,同样适用连接。
谢谢mt_dialog.