Hello All,
I have custom board with cc1312R. Currently, My board consume 20 mA when 792 byte data sent every 5 second. But 20 mA is too high for my application. I want to decrease it to 10 mA or smaller. you can see rf setting and code below.
I am changing tx power like 12.5 or 12, the current is decreasing about 17.5 mA. But it is not enough for me. After changing txpower with 11 or 10, 9 rf current consumption is increasing somehow. anyway I dont want to decrease txpower too much. because I need to send data around 50-100 meters. if i desrease tx power, distance range will be decrease.
How to descrease this current without descreasing tx power too much?
the buffer size is about 782 byte. Changing size can be useful for current comsuption.?
or is it logical to send every second.(but sending time may be cause comsuption too much current ?)
Another issue is data sending time is about 130-140 milisecond. is it normal? how to decrease this time?

#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
#include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h)
#include <ti/drivers/rf/RF.h>
#include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_prop.h)
#include <ti_radio_config.h>
// TI-RTOS RF Mode Object
RF_Mode RF_prop =
{
.rfMode = RF_MODE_AUTO,
.cpePatchFxn = &rf_patch_cpe_prop,
.mcePatchFxn = 0,
.rfePatchFxn = 0
};
// Overrides for CMD_PROP_RADIO_DIV_SETUP
uint32_t pOverrides[] =
{
// override_prop_common.json
// DC/DC regulator: In Tx, use DCDCCTL5[3:0]=0x7 (DITHER_EN=0 and IPEAK=7).
(uint32_t)0x00F788D3,
// override_prop_common_sub1g.json
// Set RF_FSCA.ANADIV.DIV_SEL_BIAS = 1. Bits [0:16, 24, 30] are don't care..
(uint32_t)0x4001405D,
// Set RF_FSCA.ANADIV.DIV_SEL_BIAS = 1. Bits [0:16, 24, 30] are don't care..
(uint32_t)0x08141131,
// override_tc106.json
// Tx: Configure PA ramp time, PACTL2.RC=0x3 (in ADI0, set PACTL2[4:3]=0x3)
ADI_2HALFREG_OVERRIDE(0,16,0x8,0x8,17,0x1,0x1),
// Rx: Set AGC reference level to 0x1A (default: 0x2E)
HW_REG_OVERRIDE(0x609C,0x001A),
// Rx: Set RSSI offset to adjust reported RSSI by -1 dB (default: -2), trimmed for external bias and differential configuration
(uint32_t)0x000188A3,
// Rx: Set anti-aliasing filter bandwidth to 0xD (in ADI0, set IFAMPCTL3[7:4]=0xD)
ADI_HALFREG_OVERRIDE(0,61,0xF,0xD),
// Tx: Set wait time before turning off ramp to 0x1A (default: 0x1F)
HW_REG_OVERRIDE(0x6028,0x001A),
// TX power override
// Tx: Set PA trim to max to maximize its output power (in ADI0, set PACTL0=0xF8)
ADI_REG_OVERRIDE(0,12,0xF8),
// evalden yaklasik 5 dbm daha iyi sonuc verdi.
// (uint32_t)0x00F688A3,
(uint32_t)0xFFFFFFFF
};
// CMD_PROP_RADIO_DIV_SETUP
// Proprietary Mode Radio Setup Command for All Frequency Bands
rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup =
{
.commandNo = 0x3807,
.status = 0x0000,
.pNextOp = 0,
.startTime = 0x00000000,
.startTrigger.triggerType = 0x0,
.startTrigger.bEnaCmd = 0x0,
.startTrigger.triggerNo = 0x0,
.startTrigger.pastTrig = 0x0,
.condition.rule = 0x1,
.condition.nSkip = 0x0,
.modulation.modType = 0x1,
.modulation.deviation = 0x64,
.modulation.deviationStepSz = 0x0,
.symbolRate.preScale = 0xF,
.symbolRate.rateWord = 0x8000,
.symbolRate.decimMode = 0x0,
.rxBw = 0x52,
.preamConf.nPreamBytes = 0x4,
.preamConf.preamMode = 0x0,
.formatConf.nSwBits = 0x20,
.formatConf.bBitReversal = 0x0,
.formatConf.bMsbFirst = 0x1,
.formatConf.fecMode = 0x0,
.formatConf.whitenMode = 0x0,
.config.frontEndMode = 0x0,
.config.biasMode = 0x1, //n-burasi 0 oalbilir
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.config.bSynthNarrowBand = 0x0,
.txPower = 0x013F, //14 dBm max outputs
// .txPower = 0xA410 , //14 dBm max output
.pRegOverride = pOverrides,
.centerFreq = 0x0364,
.intFreq = 0x8000,
.loDivider = 0x05
};
// CMD_FS
// Frequency Synthesizer Programming Command
rfc_CMD_FS_t RF_cmdFs =
{
.commandNo = 0x0803,
.status = 0x0000,
.pNextOp = 0,
.startTime = 0x00000000,
.startTrigger.triggerType = 0x0,
.startTrigger.bEnaCmd = 0x0,
.startTrigger.triggerNo = 0x0,
.startTrigger.pastTrig = 0x0,
.condition.rule = 0x1,
.condition.nSkip = 0x0,
.frequency = 0x0364,
.fractFreq = 0x0000,
.synthConf.bTxMode = 0x0,
.synthConf.refFreq = 0x0,
.__dummy0 = 0x00,
.__dummy1 = 0x00,
.__dummy2 = 0x00,
.__dummy3 = 0x0000
};
// CMD_PROP_RX_ADV
// Proprietary Mode Advanced Receive Command
rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv =
{
.commandNo = 0x3804,
.status = 0x0000,
.pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
.startTime = 0x00000000,
.startTrigger.triggerType = 0x0,
.startTrigger.bEnaCmd = 0x0,
.startTrigger.triggerNo = 0x0,
.startTrigger.pastTrig = 0x0,
.condition.rule = 0x1,
.condition.nSkip = 0x0,
.pktConf.bFsOff = 0x0,
.pktConf.bRepeatOk = 0x0,
.pktConf.bRepeatNok = 0x0,
.pktConf.bUseCrc = 0x0,
.pktConf.bCrcIncSw = 0x0,
.pktConf.bCrcIncHdr = 0x0,
.pktConf.endType = 0x0,
.pktConf.filterOp = 0x0,
.rxConf.bAutoFlushIgnored = 0x0,
.rxConf.bAutoFlushCrcErr = 0x0,
.rxConf.bIncludeHdr = 0x0,
.rxConf.bIncludeCrc = 0x0,
.rxConf.bAppendRssi = 0x0,
.rxConf.bAppendTimestamp = 0x0,
.rxConf.bAppendStatus = 0x0,
.syncWord0 = 0x930B51DE,
.syncWord1 = 0x00000000,
.maxPktLen = 0x00FF,
.hdrConf.numHdrBits = 0x0,
.hdrConf.lenPos = 0x0,
.hdrConf.numLenBits = 0x0,
.addrConf.addrType = 0x0,
.addrConf.addrSize = 0x0,
.addrConf.addrPos = 0x0,
.addrConf.numAddr = 0x0,
.lenOffset = 0x00,
.endTrigger.triggerType = 0x0,
.endTrigger.bEnaCmd = 0x0,
.endTrigger.triggerNo = 0x0,
.endTrigger.pastTrig = 0x0,
.endTime = 0x00000000,
.pAddr = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
.pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
.pOutput = 0 // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
};
// CMD_PROP_TX_ADV
// Proprietary Mode Advanced Transmit Command
rfc_CMD_PROP_TX_ADV_t RF_cmdPropTxAdv =
{
.commandNo = 0x3803,
.status = 0x0000,
.pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
.startTime = 0x00000000,
.startTrigger.triggerType = 0x0,
.startTrigger.bEnaCmd = 0x0,
.startTrigger.triggerNo = 0x0,
.startTrigger.pastTrig = 0x0,
.condition.rule = 0x1,
.condition.nSkip = 0x0,
.pktConf.bFsOff = 0x0,
.pktConf.bUseCrc = 0x1,
.pktConf.bCrcIncSw = 0x0,
.pktConf.bCrcIncHdr = 0x0,
.numHdrBits = 16,
.pktLen = 0x0000,
.startConf.bExtTxTrig = 0x0,
.startConf.inputMode = 0x0,
.startConf.source = 0x0,
.preTrigger.triggerType = 0x0,
.preTrigger.bEnaCmd = 0x0,
.preTrigger.triggerNo = 0x0,
.preTrigger.pastTrig = 0x0,
.preTime = 0x00000000,
.syncWord = 0x930B51DE,
.pPkt = 0 // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
};
void RFTx_Function(UArg arg0, UArg arg1)
{
int i;
RF_Params rfParams;
RF_Params_init(&rfParams);
RF_cmdPropTxAdv.pktLen = PAYLOAD_LENGTH+2-1;
RF_cmdPropTxAdv.pPkt = RF_Buffer2;
RF_cmdPropTxAdv.startTrigger.triggerType = TRIG_ABSTIME;
RF_cmdPropTxAdv.startTrigger.pastTrig = 1;
if (!rfHandle)
{
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
}
while(1)
{
Semaphore_pend(semTxHandle, BIOS_WAIT_FOREVER);
#ifdef WATCHDOG_ENABLE //# komutu ön işlemci komutu demek bu da program calısmaya baslamadan once bu komutun oldugu yerleri kontrol eder.
Watchdog_clear(watchdogHandle);
#endif
RF_Buffer[0]=(uint8_t)(PAYLOAD_LENGTH);
RF_Buffer[1]=(uint8_t)(PAYLOAD_LENGTH >> 8);
RF_Buffer[2]=RF_Header[0];
RF_Buffer[3]=RF_Header[1];
RF_Buffer[5]=(uint8_t)(PAYLOAD_LENGTH);
RF_Buffer[4]=(uint8_t)(PAYLOAD_LENGTH >> 8);
RF_Buffer[7]=(uint8_t)(Destination_Address);
RF_Buffer[6]=(uint8_t)(Destination_Address >> 8);
RF_Buffer[9]=(uint8_t)(Source_Address);
RF_Buffer[8]=(uint8_t)(Source_Address >> 8);
RF_Buffer[10]=(uint8_t)(Command_Number);
RF_Buffer[11]=(uint8_t)(Data_Number);
Data_Number++;
RF_Buffer[782]='\r';
RF_Buffer[783]='\n';
for(i = 0; i < PAYLOAD_LENGTH; i++)
{ CRC_Buffer[i] = RF_Buffer[i + 2];}
CRC_Code = CRC16_Calculate(CRC_Buffer, sizeof(CRC_Buffer));
RF_Buffer[781]=(uint8_t)(CRC_Code);
RF_Buffer[780]=(uint8_t)(CRC_Code >> 8);
RFtime = RF_getCurrentTime();
RFtime += PACKET_INTERVAL;
RF_cmdPropTxAdv.startTime = RFtime;
for(i = 0; i < 100; i++)
{ RF_Buffer2[i] = RF_Buffer[i];}
RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, NULL, 0);
RF_yield(rfHandle);
// PIN_setOutputValue(hPin, STA_LED,!PIN_getOutputValue(STA_LED));
memset(RF_Buffer, 0, sizeof(RF_Buffer));
memset(CRC_Buffer, 0, sizeof(CRC_Buffer));
}
}
if you have any idea or advice please let me know
thank you
Best Regards
Bekir