DSP电流消耗大(不)

16个帖子/ 0新
最后一篇
千岛
Offline
最后一次露面:3年5个月前
加入:2016-01-15 01:32
DSP电流消耗大(不)

嗨mt_dialog,

回顾我的最后一篇文章http://support.dialog-semicondiondiondum/dsps-large-current-consumption.,我可以继续提出问题如何在DSP项目中实现低电流消耗吗?

我现在正在使用官方Da14580evkt-b。我使用HW或SW流量控制测试了电流消耗。如果使用HW流量控制,则电流消耗低于1mA。如果使用SW流量控制,则电流消耗几乎是2.x mA。因为MCU主机I / O引脚的限制,我不能使用HW流量控制的方法。但是目前使用SW流量控制的消耗仍然非常高,如何降低1mA以下的电流消耗?

此外,如果我配置UART1_TX,UART1_RX,UART1_RTS&UART1_CTS到端口2,则将消耗2MA更多电流,请告知。
谢谢。

设备:
mt_dialog.
Offline
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨Jackiechau,

嗨Jackiechau,

使用SW流量控制其更大的功耗,因为您必须更常见的是醒来的顺序发送流量控制信号,等待额外的字节接收等,SW流量控制比HW流量控制更详细,并保持580令人欣赏频繁地。您无法降低功耗,如果您确实存在丢失数据的侧面。只要它在DSPS应用笔记中提到的睡眠模式下运行时,DSP就会从电源消耗视角显示从功耗角度优化。

On which pins on port 2 you placed the UART pins?

谢谢mt_dialog.

千岛
Offline
最后一次露面:3年5个月前
加入:2016-01-15 01:32
嗨mt_dialog,

嗨mt_dialog,

Actually I have undefined h/w & s/w flow control, and would like to use a GPIO of external MCU to wake up 14580 for data reception and transmission later (rising edge to wake up 14580 and falling edge to let it sleep). All features of 14580 have been implemented but the current consumption is around 1x mA. Would you mind if I send you my whole project's source codes and you help me to take a look? Thanks.

千岛
Offline
最后一次露面:3年5个月前
加入:2016-01-15 01:32
嗨mt_dialog,

嗨mt_dialog,

在我的项目中,14580周期性地广播SSID并通过UART1从外部MCU接收数据。因为它在未定义的H / W和S / W流量控制(UART TX和RX FIFO应该为空)后,它总是消耗1x MA电流,
1.在广播SSID后,我可以强制14580到睡眠模式吗?怎么做?
2. 14580的GPIO之一被配置为中断引脚,以检测逻辑高或低,如果检测到逻辑高电平,则将永久激活14580。如果检测到逻辑低电平,则强制睡眠14580。是否有可能这样做?我应该使用app_force_active_mode和app_restore_sleep_mode吗?
3.如果A-B-026,则必须按顺序定义H / W流量控制(我认为H / W流量控制,并且14580不应该睡得无关),我可以使用外部MCU的“GPIO 1”,为CTS提供14580的复位脉冲,以便唤醒14580,并使用外部MCU的“GPIO 2”检测RTS的下边缘,以便传输和接收数据?

谢谢。

mt_dialog.
Offline
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨Jackiechau,

嗨Jackiechau,

1)你的意思是设置你的设备在永恒的睡眠智慧hout advertising or just enable the sleeping feature ? You can issue a stop advertising command after the SSID is sent and set a timer or a push button in order for your device to wake up (that will put your device in permanent sleep, you will also have to set the device in a sleep mode by invoking) arch_set_extended_sleep() or you can just invoke the arch_set_extended_sleep() and dynamically change the sleep mode (this will set your device in sleep mode between advertising).

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) The DSPS isn't designed to work without flow control due to data loss, the sleep and the flow control are deeply related since the DSPS doesn't implement external wakeup, when the device falls to sleep it keeps the RTS high in order to prevent the external MCU from sending any data.If data are sent while the 580 is sleeping, there will be data loss. Yes, i suppose that you can implement a case where the 580 will use flow control and also the external MCU will trigger the 580 to wake up and wait until the 580 is ready in order to start sending data.

本地团队将通过您的注册电子邮件地址与您联系。

谢谢mt_dialog.

千岛
Offline
最后一次露面:3年5个月前
加入:2016-01-15 01:32
嗨mt_dialog,

嗨mt_dialog,

下周我会联系您的分销商,但我想知道如果定义了硬件流控制并启用了EXT_SLEEP,则METR MCU无法通过RTS唤醒BLE。当ext_sleep被禁用时,我检查CTS中断可以触发,可以接收正确的数据,似乎不能醒来,请敬请咨询。

mt_dialog.
Offline
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨Jackiechau,

嗨Jackiechau,

DSP不仅仅是通过设计实现的,通过唤醒控制器外部唤醒,它只是以垂直间隔唤醒,以便保持连接,当它唤醒时,它才能为其拉低其RTS另一边知道它是令人醒目的并且能够接收数据。您必须启用外部唤醒控制器并将其设置为适当的PIN,以便通过MCU的RTS信号唤醒,并且还需要进一步的修改以覆盖先前的功能,并通过中断调整唤醒。

谢谢mt_dialog.

千岛
Offline
最后一次露面:3年5个月前
加入:2016-01-15 01:32
嗨mt_dialog,

嗨mt_dialog,

你提到了

1.我发现“启用唤醒控制器”通过External_WakeUp,但是您的意思是Master MCU的RTS也应该连接到另一个引脚的BLE,可以在此GPIO中断处理程序中禁用BLE睡眠,可以在某处启用睡眠状态吗?
2.进一步修改,请提供该示例。
谢谢。

千岛
Offline
最后一次露面:3年5个月前
加入:2016-01-15 01:32
嗨mt_dialog,

嗨mt_dialog,

Refer tohttp://support.dialog-semicondiondiondiond.com/dsps-use-gpio-control-its-extend ...,我遵循App_button_press_cb()函数中的智能标记参考设计,主MCU的连接RTS到P1_0,用于外部唤醒中断和保留的P0_2,用于BLE的CTS。但是,它似乎无法醒来,没有任何内容在app_cts_logi_high_cb(void)中打印。

In periph_setup.c

void gpio_reservations(无效)
{
保留_GPIO(Push_Button,GPIO_PORT_1,GPIO_PIN_0,PID_GPIO);
保留_GPIO(UART1_TX,UART1_TX_PORT,UART1_TX_PIN,PID_UART1_TX);
RESERVE_GPIO( UART1_RX, UART1_RX_PORT, UART1_RX_PIN, PID_UART1_RX);
#if(uart_hw_flow_enabled)
保留_GPIO(UART1_RTS,UART1_RTS_PORT,UART1_RTS_PIN,PID_UART1_RTSN);
RESERVE_GPIO( UART1_CTS, UART1_CTS_PORT, UART1_CTS_PIN, PID_UART1_CTSN);
#endif / * uart_hw_flow_enabled * /
// UART2调试保留
保留_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地图端口引脚
*
*映射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 pads
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发送消息。当ble醒来时,我们应该设置计时器app_button_press_timer
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,极性高,1个事件,脱嘴时间= 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发送消息。We should clear the timer APP_BUTTON_PRESS_TIMER when BLE is awake
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,极性高,1个事件,脱嘴时间= 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(ke_state_get(dest_id)== app_connectable)
{
/ *检查唤醒原因是否按钮按或释放并设置或清除长按计时器。
**请注意,只有在设备广告而未连接时才会发生这种情况
*/
if(app_button_status)
{
app_timer_set(app_button_press_timer,task_app,300);

}
else
{
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)
{
/ *if( GPIO_GetPinStatus( GPIO_BUTTON_PORT, GPIO_BUTTON_PIN ) )
{

// Clear bonding data from non-vlolatile memory
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);
}

mt_dialog.
Offline
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨Jackiechau,

嗨Jackiechau,

A few comments regarding the code you ve pasted, the wakeup controller has a debouncing time of 20ms, if you are toggling the RTS of your MCU perhaps because of the debouncing time the wakeup interrupt is not triggered. To make sure that the device is taking the interrupt and wakes up, you can use the arch_set_pxact_gpio() function in the wake up callback and check if the interrupt is triggred in smart snippets (you should see a red vertical line when the function pxact is called). Also when the BLE is in sleep mode you can't use the UART immediately after wake up, since after waking up the 580 operates with the RC16 oscillator, this wont allow you to use the UART properly and you will have to switch to the XTAL16 before using the UART and off cource wait for the XTAL to settle.

您可以在外围驱动程序部分中找到有关UM-B-051文档中的唤醒控制器的更多信息。

谢谢mt_dialog.

千岛
Offline
最后一次露面:3年5个月前
加入:2016-01-15 01:32
嗨mt_dialog,

嗨mt_dialog,

1. I'm using basic kit and burning image into EVB by smartsnippets, can I still see the red vertical line if function pxact is called? If so, which layout of smartsnippets should be used such that I can see the red vertical line? If basic kit can't show this line, what can I do to prove the system wakes up?
此外,我应该缩短wkupct_enable_irq()的脱嘴时间参数,并增加MCU的RTS信号的切换时间吗?

2.如果WKUPCT_REGISTER_CALLBACK和WKUPCT_ENABLE_IRQ未调用,并且如果主MCU将其RTS信号切换到其RTS信号,则触发Periph_setup.c的原始API GPIO0_CALLBALLBALLBALLBALLBALLBALLBALLBALLBALLBALLBALLBALLBALL,则对话框可以接收和将数据传输到MARER MCU,这非常奇怪。但是,如果每1秒调用app_timer_set(sps_timer,task_app,100),则无法从对话框接收或传输任何内容。它仍然与唤醒问题有关吗?

谢谢。

mt_dialog.
Offline
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨Jackiechau,

嗨Jackiechau,

1) Unfortunatelly not, if you are using the basic kit it doesn't support the power profiler, you can try to toggle the LED when waking up from sleep, this might be a bit tricky since the DSPS might trace that there are no data to send so it will fall back to sleep and when waking up will switch the led off, so you have to set a variable in the interrupt routine and when waking up check the variable in the periph_init to see if the pin was set or not, besides that, you can set the pin and trace it with an analyser in order to verify that your device wakes up. Yes shorten your debounce parameter, since your are using a pulse from an external proccessor a 20ms debounce time is not going to do any good, just set the debounce time to 0.

2)GPIO0_callback()是一个普通的中断,这个中断只能在系统唤醒时调用,当580处于睡眠模式时,该中断不会唤醒系统。只睡觉时,唤醒定时器的中断可以唤醒580.内核定时器和唤醒定时器之间没有关系。

谢谢mt_dialog.

千岛
Offline
最后一次露面:3年5个月前
加入:2016-01-15 01:32
嗨mt_dialog,

嗨mt_dialog,

感谢您的帮助,完成了。但在我的源代码中,我只是想知道为什么我需要在gpio0_callback(),app_cts_logic_high_cb()和app_cts_logic_low_cb()中添加几个ms延迟,以便主MCU可以从14580发送和接收UART数据。

mt_dialog.
Offline
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨Jackiechau,

嗨Jackiechau,

当中断击中580的醒来需要一些时间时,它不会立即醒来,这需要时间,直到XTAL切换和稳定是正确的。

谢谢mt_dialog.

千岛
Offline
最后一次露面:3年5个月前
加入:2016-01-15 01:32
嗨mt_dialog,

嗨mt_dialog,

我想知道如何在app_adv_start之前关掉无线电,如果需要,我可以直接调用setbits16(pmu_ctrl_reg,radio_sleep)直接吗?谢谢。

布罗尔,

杰基

mt_dialog.
Offline
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨Jackiechau,

嗨Jackiechau,

The radio is off when the device is not advertising, when you invoke app_adv_start the SDK and the BLE stack will switch on and off the radio when its time to receive/transmit data according to the advertising interval that you set, the same applies while you are connected.

谢谢mt_dialog.