Knowledge Base
HOME » KNOWLEDGE BASE » FORUM

SX1262 Lambda62 RFSolutions Overcurrent Problems

Hi,
We are using the Lambda62 from RF Solutions. Transmitting and receiving packets fine but the current is peaking at 200mA+ way over the specification from RF Solutions. We are using the DC_DC converter mode and we got nowhere using the LDO mode.

TX Power is 14dBm and PA Config is 2 2 0 1. Time on air ~7ms as expected for our packet size. Config below.

Does anyone have any ideas to try?

Regards
Ian



#define LORA_FREQUENCY 866000000 // Hz
#define LORA_BANDWIDTH SX126X_LORA_BW_250_0
#define LORA_SPREADING_FACTOR 5
#define LORA_CODINGRATE SX126X_LORA_CR_4_5
#define LORA_LDRO SX126X_LORA_LOW_DATA_RATE_OPTIMIZE_OFF
#define LORA_PREAMBLE_LENGTH 12
#define LORA_SYMBOL_TIMEOUT 0
#define LORA_PAYLOADLENGTH 0 // 0 = Variable length payload 1..255
#define LORA_CRC_ON SX126X_LORA_CRC_ON
#define LORA_INVERT_IQ SX126X_LORA_IQ_STANDARD
SX126X: txPowerInDbm: 14
SX126X: spreadingFactor: 5
SX126X: bandwidth: 5
SX126X: codingRate: 1
SX126X: ldro: 0
SX126X: preambleLength: 12
SX126X: payloadLen: 0
SX126X: crcOn: 1
SX126X: invertIQ: 0
SX126X: ocp: 24
SX126X: paConfig: 2 2 0 1
bool SX126x_Initialise(u32 frequencyInHz,
s8 txPowerInDbm,
u8 spreadingFactor,
u8 bandwidth,
u8 codingRate,
u8 ldro,
u16 preambleLength,
u8 payloadLen,
bool crcOn,
bool invertIQ,
u8 ocp,
u8 paConfig[4])
{

SX126x_Hal_Printf("SX126X: Initialise\r\n");
SX126x_Hal_Printf("SX126X: txPowerInDbm: %d\r\n", txPowerInDbm);
SX126x_Hal_Printf("SX126X: spreadingFactor: %d\r\n", spreadingFactor);
SX126x_Hal_Printf("SX126X: bandwidth: %d\r\n", bandwidth);
SX126x_Hal_Printf("SX126X: codingRate: %d\r\n", codingRate);
SX126x_Hal_Printf("SX126X: ldro: %d\r\n", ldro);
SX126x_Hal_Printf("SX126X: preambleLength: %d\r\n", preambleLength);
SX126x_Hal_Printf("SX126X: payloadLen: %d\r\n", payloadLen);
SX126x_Hal_Printf("SX126X: crcOn: %d\r\n", crcOn);
SX126x_Hal_Printf("SX126X: invertIQ: %d\r\n", invertIQ);
SX126x_Hal_Printf("SX126X: ocp: %d\r\n", ocp);
SX126x_Hal_Printf("SX126X: paConfig: %x %x %x %x\r\n", paConfig[0], paConfig[1], paConfig[2], paConfig[3]);

if(!SX126x_Reset())
{
SX126x_Hal_Printf("SX126X: ERROR. Reset Failed. Check wiring\r\n");
return FALSE;
}

SX126x_Hal_Printf("SX126X: Reset OK\r\n");

// check the SPI interface
u8 chipStatus = SX126x_GetStatus();
if(0x22 != chipStatus)
{
SX126x_Hal_Printf("SX126X: ERROR. Bad Status X\r\n", chipStatus);
return FALSE;
}
SX126x_Hal_Printf("SX126X: Status X\r\n", chipStatus);

SX126x_SetStandby(SX126X_STANDBY_RC);

SX126x_Calibrate(SX126X_CALIBRATE_IMAGE_ON
| SX126X_CALIBRATE_ADC_BULK_P_ON
| SX126X_CALIBRATE_ADC_BULK_N_ON
| SX126X_CALIBRATE_ADC_PULSE_ON
| SX126X_CALIBRATE_PLL_ON
| SX126X_CALIBRATE_RC13M_ON
| SX126X_CALIBRATE_RC64K_ON);

SX126x_SetDio2AsRfSwitchCtrl(FALSE);
SX126x_SetStandby(SX126X_STANDBY_RC);
SX126x_SetRegulatorMode(SX126X_REGULATOR_DC_DC);
SX126x_SetBufferBaseAddress(0, 0);

SX126x_SetPaConfig(paConfig[0], paConfig[1], paConfig[2], paConfig[3]); // See Table 13-21: PA Operating Modes with Optimal Settings
SX126x_SetOvercurrentProtection(ocp);

SX126x_SetPowerConfig(txPowerInDbm, SX126X_PA_RAMP_200U);

SX126x_SetDioIrqParams(SX126X_IRQ_ALL, //all interrupts enabled
(SX126X_IRQ_RX_DONE | SX126X_IRQ_TX_DONE | SX126X_IRQ_TIMEOUT), // interrupts on DIO1
SX126X_IRQ_NONE,
SX126X_IRQ_NONE);

SX126x_SetRfFrequency(frequencyInHz);

SX126x_SetStopRxTimerOnPreambleDetect(FALSE);
SX126x_SetLoRaSymbNumTimeout(0);
SX126x_SetPacketType(SX126X_PACKET_TYPE_LORA);
SX126x_SetModulationParams(spreadingFactor, bandwidth, codingRate, ldro);

m_packetParams[0] = (preambleLength >> 8) & 0xFF;
m_packetParams[1] = preambleLength;
if(payloadLen)
{
//fixed payload length
m_packetParams[2] = 0x01;
m_packetParams[3] = payloadLen;
}
else
{
m_packetParams[2] = 0x00;
m_packetParams[3] = 0xFF;
}
m_packetParams[4] = crcOn ? 0x01 : 0x00;
m_packetParams[5] = invertIQ ? 0x01 : 0x00;

WriteCommand(SX126X_CMD_SET_PACKET_PARAMS, m_packetParams, sizeof(m_packetParams));

//receive state no receive timeout
SX126x_SetRx(0xFFFFFF);

return TRUE;
}