-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Hi,
Thanks again for your previous help with the ticket.
I'm currently working on optimizing the energy consumption of the SX1262 and ensuring stability when used with the SWL2001. However, I’m running into some issues that I don’t fully understand.
- High power consumption
After sending data to the LoRa gateway, the device issues the SetSleep command with the bytes 0x84 0x04, indicating that it's entering sleep mode with configuration retention. I then set the next alarm for 30 minutes later. Below is the final SPI command sent before going to sleep:
Despite this, the power profiler shows that the device draws 1.5 mA during sleep, which seems too high:
I traced the current leakage and discovered that it appears to come through the SPI’s CS line and the VDD of the SX1262. When I disconnected those lines, the sleep current dropped to about 260 µA, which aligns with the expected values from the datasheet.
I suspect the increased energy consumption is due to the use of the TCXO (temperature-compensated crystal oscillator). I'm using the SX1262 LoRa module with a Raspberry Pi Pico, which requires activating the TCXO via the SetDIO3AsTCXOCtrl command
SX1262 LoRa module with a Raspberry Pi Pico
To enable the TCXO, I modified the code as follows:
void ral_sx126x_bsp_get_xosc_cfg( const void* context, ral_xosc_cfg_t* xosc_cfg, ...)
{
*xosc_cfg = RAL_XOSC_CFG_TCXO_RADIO_CTRL;
*supply_voltage = 0x01; // voltage 1.7V
*startup_time_in_tick = 0x0140;
}
According to the datasheet from sx1262, the nominal current consumption should be around 1.5 mA, which is why I believe the TCXO is responsible for the higher power draw. The current consumption in sleep is 1.55 mA. I also attempted to reset the device in an effort to switch to the internal oscillator since it's the only way to change oscillators, but the energy consumption remained unchanged.
Is there something I can do? Can I deactivate the TCXO when it has been activated?
- Waking-up sporadically
The second issue is that the device wakes up every 31.99 seconds, despite being configured to wake up after 30 minutes. Here’s a snippet from the log:
Here is the log:
Here is the logic analyzer output:
I've been trying to identify the source of the wake-up event, but it doesn't appear to be triggered by the RTC or any of the LoRa device's pins, as there's no detectable pin state change when the device wakes up.
EDIT 1:
The MCU wakes up due to the LPTIM (Low-Power Timer). I added a log message ("LPTIM") to confirm when the timer callback is triggered, and I can see it in the log:
Do I need to manually disable the LPTIM, or is this something the library is supposed to handle automatically?
Let me know if you need anything else.