Computing stuff tied to the physical world

Taming the radio startup current

Let’s briefly recall the problem we’re having with the RFM69’s startup current:


(CH1/yellow = Vres, CH2/blue = Vradio, QMA/red = Vres-vRadio, CH3/purple = unused)

  • when Vres is about 2.0V, Q1/Q2 switch on and power up the rest of the circuit
  • the Vradio supply starts rising, due to back-feeding from the SPI I/O pins
  • when it reaches about 1.2V, the RFM69 starts drawing more current
  • this prevents Vres, the main supply voltage, from rising much further
  • once the RFM69 is initialised and put to sleep, Vres rises to its maximum level

Although this example works, it prevents the MPS from working with less incoming energy.

The solution is in fact quite simple: as soon as the µC comes out of reset, we turn all the SPI pins connected to the RFM69 to outputs and set their level to “0”. This will prevent any further back-feeding into Vradio.

Then, just before we want to initialise the RFM69, we restore the original settings, send the initial SPI commands, and then put the RFM69 into its 0.1 µA sleep mode.

The difference is quite dramatic:


(with apologies for the scale of the red difference line, which was set 4x lower here)

  • the blue Vradio line only rises to about 0.45V
  • then the µC comes out of reset and prevents it from rising further
  • as a result, the RFM69 never goes into its more-power-consuming mode
  • now Vres continues to rise all the way to the 3.55 V maximum level

Turning on the radio still causes a dip of about 0.7V, but now the dip is at a Vres supply level, where we can easily handle such a brief drop.

The code for this new approach can be found on GitHub:

// disable all special pin functions

// make all SPI pins "0" outputs to prevent radio back-feeding
LPC_GPIO_PORT->DIR[0] |= 0b111110;  // pio1..5 all outputs
LPC_GPIO_PORT->CLR[0] = 0b111100;   // pio2..5 set to 0
LPC_GPIO_PORT->SET[0] = 0b000010;   // pio1 set to 1

sleep(10000); // sleep 1 sec to let power supply rise further

LPC_GPIO_PORT->DIR[0] &= ~0b111100; // pio2..5 all inputs again
LPC_GPIO_PORT->B[0][1] = 0;         // low, turns radio power on

sleep(100); // sleep 10 ms to let the radio start up

// SPI0 pin configuration
// lpc810: sck=3p3, ssel=4p2, miso=2p4, mosi=5p1
LPC_SWM->PINASSIGN[3] = 0x03FFFFFF; // sck  -    -    -
LPC_SWM->PINASSIGN[4] = 0xFF040205; // -    nss  miso mosi

// initialise the radio and put it into idle mode asap
rf.init(61, 42, 8683);              // node 61, group 42, 868.3 MHz

Here is an example where the incoming energy is much lower than before (about half):


The red line is now the derivative of Vres, i.e. the rate of change of that power supply voltage – it’s a rough indication of the current going in or out of the reservoir capacitors. Note that its zero baseline is two divisions down from the top. As you can see, the current starts coming in fast, then drops as the capacitors reach their full level, with a brief consumption spike when the µC starts up and the radio starts drawing some current.

Vradio does not drop back to zero, as you can see. This is because all of this is caused by diodes on the chip, which start conducting early but prevent that charge from flowing out.

In this case, the incoming energy is insufficient (max about 2.4 V) to send out wireless packets. The voltage would drop to a level where neither the µC nor the RFM69 can work.

In summary: we’ve timed the µC startup through Q1/Q2 and we’ve tamed the RFM69 radio startup current sufficiently to bring it up slightly later under µC control.

This final result is also probably the maximum achievable without further circuitry – given that this dip is taking place when the µC is not yet able to do anything more about it.

But we’re fine: the MPS can send out packets using only energy picked up by its C.T. !

[Back to article index]