High current in sleep mode in RFM95

I’m now trying to connect MSP430FR2355 with RFM95 LoRa module(https://www.adafruit.com/product/3072?gclid=EAIaIQobChMIz-XBxZba4AIVSLjACh1DTg8GEAQYAiABEgKZw_D_BwE).
First I put all pins in MSP into OUTPUT LOW. And I test the current can be 1 uA. That’s really great.

I use SPI to put RF95 into sleep mode. But when connect the MSP with RFM95, the total current is about 583 uA. I also put DMM between the 3V3(MSP) and Vin(RF), the current is 563 uA. Besides, the current is 530 uA when I put DMM between GND(RF) and GND(MSP). According to RF95 datasheet, the current can be 0.2uA in sleep mode. So the current I got is too large.

When in the test, I find that the MSP pins are about -0.3V to 0.3V(OUTPUT LOW). Does this cause some leakage current when connecting to RF chip? I also try to connect RF chip’s DIO pin to either 3V3 or GND, but the current is almost the same. Is there any way to configure the RF95 pins into INPUT HIGH. Are there other reasons that cause this high current?
I’m now out of ideas. If anyone can help me, I’m so grateful.

#include <msp430.h>
#include <stdint.h>
#include <RH_RF95.h>

void rfi (void);
void ls1 (void);
void tb (int tm);
void si (void);
unsigned char sa (unsigned char); uint8_t data;
void csn_high (void);
void csn_low (void);
void ce_high (void);
void ce_low (void);
void sw (uint8_t, uint8_t); uint8_t val;

int main(void)
{
WDTCTL = WDTPW | WDTHOLD;
//CSCTL4 = SELA__VLOCLK | SELMS__VLOCLK;
ls1();
si();
rfi();
ls1();
tb(1000);
__bis_SR_register(LPM3_bits | GIE);
}
#pragma vector = TIMER0_B0_VECTOR
__interrupt void Timer_B (void)
{
}
void rfi (void)
{
ce_high();
sw(RH_RF95_REG_01_OP_MODE, RH_RF95_MODE_SLEEP);
ce_low();
csn_low();
}
void ls1 (void)
{
P1DIR = 0xff; P2DIR = 0xff;
P3DIR = 0xff; P4DIR = 0xff;
P5DIR = 0xff; P6DIR = 0xff;
P1OUT = 0x00; P2OUT = 0x00;
P3OUT = 0x00; P4OUT = 0x00;
P5OUT = 0x00; P6OUT = 0x00;
}
void tb (int tm)
{
TB0CTL = TBSSEL__ACLK | MC__UP;
TB0CCR0 = tm;
TB0CCTL0 |= CCIE;
}
void si (void)
{
P1DIR |= BIT4; P1OUT |= BIT4;
P1DIR |= BIT3;
P1SEL0 |= BIT5; P1DIR |= BIT5;
P1SEL0 |= BIT7; P1DIR |= BIT7;
P1SEL0 |= BIT6; P1DIR &= ~BIT6;
P2DIR |= BIT0;
UCA0CTLW0 |= UCSWRST;
UCA0MCTLW = 0x00;
UCA0CTLW0 |= UCMST|UCSYNC|UCCKPH|UCMSB|UCMODE_0;
UCA0CTLW0 |= UCSSEL__SMCLK;
UCA0BR0 |= 0x01;
UCA0BR1 |= 0x00;
UCA0CTLW0 &= ~UCSWRST;
}
unsigned char sa (unsigned char data)
{
UCA0TXBUF = data;
while ( !(UCA0IFG & USCI_SPI_UCRXIFG) );
return UCA0RXBUF;
}
void csn_high (void)
{
P1OUT |= BIT4;
}
void csn_low (void)
{
P1OUT &= ~BIT4;
}
void ce_high (void)
{
P1OUT |= BIT3;
}
void ce_low (void)
{
P1OUT &= ~BIT3;
}
void sw (uint8_t addr, uint8_t val)
{
csn_low ();
sa (addr | 0x80);
sa (val);
csn_high ();
}

This Adafruit RFM95 LoRa module has a regulator and a level shifter this could be sucking some current.
But I guess you have a leaking current on the SPI pins.
Try to not set the SCK MISO and MOSI to OUTPUT LOW.
By default, the MISO is OUTPUT HIGH on the slave(RFM95).

I dont think many people will be able to tell what your code is doing, no comments and lots of register level operations.

1 Like

Hi Ricaun,
Thank you!
I put MISO pin in MSP430 side to INPUT PULL UP. And the total current reduces. Now the current is 172 uA.
I also put SCK, MOSI pin in MSP430 side to INPUT PULL UP. But the current is the same.
Is there something I miss? Is there something we can do to change default pin status in RFM95 side.
Thank you again.

Hi,
Thank you for replying. Sorry my bad.
The function of the code is basically configure MSP430 SPI interface.
rfi is RF INIT; ls is Pin OUTPUT LOW; tb is TIMER; si is SPI INIT; sa is send data through SPI; sw is write register.

No.

As has been mentioned that module has extra components, so whilst a plain RFM95 will quite easily go down to 0.1uA in sleep mode, that module might not.

As its Adafruits module, they ought to know what the minimum sleep current of their device is.

Were you curious as to why some of the MSP pins were apparently reading at 0.3V below ground level ?

The AP2112K-3.3 regulator consumes 55uA and the level shifter has a maximum of 20uA. The rest are probably floating pins. Use a meter check for floating pins.

Hi,
Thank you for your advice, I change to original RFM95, and now the current is 35uA.
Do you know the default Pin setting for MISO, MOSI, SCK, CS, DIO0-5? I didn’t find these information in the datasheet.

Chen

Dont understand the question sorry.

The LoRa device pins MISO, MOSI, SCK, CS, DIO0-5, are what they are, I dont understand what you mean by ‘settings’

In sleep mode that is very high, it ought to be less than 0.1uA.

like MOSI in RFM95 is OUTPUT HIGH or something? The port setting in RFM95.
And another question is how to test the floating pin? I know it’s a silly question. Thank you.

MOSI is Master Out Slave In, the RFM95 is the slave, so the MOSI pin is an input, it cannot be anything else.

If your thinking that the RFM95 pins need to be configured to inputs or outputs like an Arduino, that is not the case.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.