工具/软件:
我有一个要求低功耗的器件。 我想在睡眠时尽可能少地使用电源。 将设备置于待机模式的示例程序只调用 sleep() 函数。 我已经确认、这会使器件进入睡眠状态、消耗大约 10 μ A 的电流。 如果我不想调用睡眠、而是依靠信标来等待任务、那么我的功耗为 300uA。 然而、调用睡眠函数不能通过中断来唤醒任务。 我可以执行中断、但一旦 ISR 结束、器件在剩余的睡眠时间内恢复睡眠状态。
在调用睡眠模式时、如何将功耗降至 10uA、并在 ISR 触发时让我的设备继续执行任务?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:
我有一个要求低功耗的器件。 我想在睡眠时尽可能少地使用电源。 将设备置于待机模式的示例程序只调用 sleep() 函数。 我已经确认、这会使器件进入睡眠状态、消耗大约 10 μ A 的电流。 如果我不想调用睡眠、而是依靠信标来等待任务、那么我的功耗为 300uA。 然而、调用睡眠函数不能通过中断来唤醒任务。 我可以执行中断、但一旦 ISR 结束、器件在剩余的睡眠时间内恢复睡眠状态。
在调用睡眠模式时、如何将功耗降至 10uA、并在 ISR 触发时让我的设备继续执行任务?
我不知道在等待信标时为什么电流消耗为 300uA。 得到的电流低于 1uA、这是待机时的预期功耗。
我从 SDK 中获取了 rfPacketTX 示例、并对其进行了修改、以等待在数据包之间按下按钮、而不是调用睡眠模式。
代码如下:
/* Standard C Libraries */
#include <stdlib.h>
#include <unistd.h>
/* TI Drivers */
#include <ti/drivers/rf/RF.h>
#include <ti/drivers/PIN.h>
#include <ti/drivers/pin/PINCC26XX.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Task.h>
/* Driverlib Header files */
#include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h)
/* Board Header files */
#include "Board.h"
#include "smartrf_settings/smartrf_settings.h"
/***** Defines *****/
/* Packet TX Configuration */
#define PAYLOAD_LENGTH 30
/***** Variable declarations *****/
static RF_Object rfObject;
static RF_Handle rfHandle;
static PIN_Handle buttonPinHandle;
static PIN_State buttonPinState;
static uint8_t packet[PAYLOAD_LENGTH];
static uint16_t seqNumber;
static Semaphore_Struct txSemaphore;
static Semaphore_Handle txSemaphoreHandle;
PIN_Config buttonPinTable[] = {
Board_PIN_BUTTON0 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
PIN_TERMINATE
};
void buttonCallbackFunction(PIN_Handle handle, PIN_Id pinId) {
/* Simple debounce logic, only toggle if the button is still pushed (low) */
CPUdelay((uint32_t)((48000000/3)*0.050f));
if (!PIN_getInputValue(pinId)) {
/* Post TX semaphore to TX task */
Semaphore_post(txSemaphoreHandle);
}
}
void *mainThread(void *arg0)
{
RF_Params rfParams;
RF_Params_init(&rfParams);
Semaphore_construct(&txSemaphore, 0, NULL);
txSemaphoreHandle = Semaphore_handle(&txSemaphore);
buttonPinHandle = PIN_open(&buttonPinState, buttonPinTable);
PIN_Status status = PIN_registerIntCb(buttonPinHandle, &buttonCallbackFunction);
RF_cmdPropTx.pktLen = PAYLOAD_LENGTH;
RF_cmdPropTx.pPkt = packet;
RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW;
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
while(1)
{
packet[0] = (uint8_t)(seqNumber >> 8);
packet[1] = (uint8_t)(seqNumber++);
uint8_t i;
for (i = 2; i < PAYLOAD_LENGTH; i++)
{
packet[i] = rand();
}
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);
RF_yield(rfHandle);
Semaphore_pend(txSemaphoreHandle, BIOS_WAIT_FOREVER);
}
}
使用能量曲线、最低电流消耗(待机)显示为 0、因为 ET 无法测量小于 1uA 的电流
峰值是待机模式下的重新充电脉冲、然后有一个 TX

Siri