This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why GPIO can be used as power supply pin?

Hi all,

I am new in nRF51822. Today I am doing experiment using GPIO and radio transmission. I wrote a very simple code as below:

int main(void) {

init_clock();
radio_configure();
transmit();
nrf_gpio_cfg_sense_input(8, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);
NRF_POWER->SYSTEMOFF = 1;

}

The first three functions are the same as in the example code from nrf51822.

In the experiment, I plan to make the chip go to system off sleep, and wakeup from the gpio interrupt. Accidentally, I connect the gpio pin with the 3V energy source, and the power pin of the chip is not connect with any energy source. But the program still runs, and the chip continuously transmits data (around 10 radio transmission per second).

So my questions are:

  1. Why the chip can get power supply from gpio pin? And is this harmful to the chip?

  2. If I set the chip to system off state, do I still need to init_clock() and radio_configure() before radio transmission after wakeup? Do the radio and clock setups retain in the memory after the wakeup from system off state?

  3. In this code, I found that as long as I give the gpio pin a high voltage (2.5V), then the chip will wakeup. Could I set the wakeup voltage higher (eg. 3.5V), since I only want the chip wakeup from system off state when the gpio pin get a voltage larger than 3.5V?

Kind Regards!

Parents
  • You're "backpowering" the chip through the protection diode in the GPIO-pin. (google "backpowering mcu" for more on that.)

    Even if it works, this is definitely not the way the chip is intended to be operated, so the datasheet can't be trusted and you can easily end up with brown-outs etc. depending on what your code does because of the higher impedance path through the gpio protection circuitry.

    1. There is a "diode" or protection circuit to the Vdd rail from the GPIO pin. This is there to protect the GPIO input from over-voltage conditions in case the GPIO pin voltage goes above Vdd. In your case Vdd is not powered, so effectively at 0V and you apply a voltage at the GPIO which will flow through that protection diode. A Nordic employee would have to chime in on the long term effects of continuous current through that diode.

    2. System reset is performed when waking up from off mode. So you'd have to init again. There is an option to retain RAM blocks in off-mode, but then the init-code would have to write retained values to the registers again.

    3. Not 100% sure what you are suggesting. Typically you should have Vdd applied to the chip at all times and either use the internal comparator/ADC to sample the 3.5V or a divided down version of it if Vdd is lower than 3.5V. Or you can use a GPIO pin together with an external voltage comparator.

Reply
  • You're "backpowering" the chip through the protection diode in the GPIO-pin. (google "backpowering mcu" for more on that.)

    Even if it works, this is definitely not the way the chip is intended to be operated, so the datasheet can't be trusted and you can easily end up with brown-outs etc. depending on what your code does because of the higher impedance path through the gpio protection circuitry.

    1. There is a "diode" or protection circuit to the Vdd rail from the GPIO pin. This is there to protect the GPIO input from over-voltage conditions in case the GPIO pin voltage goes above Vdd. In your case Vdd is not powered, so effectively at 0V and you apply a voltage at the GPIO which will flow through that protection diode. A Nordic employee would have to chime in on the long term effects of continuous current through that diode.

    2. System reset is performed when waking up from off mode. So you'd have to init again. There is an option to retain RAM blocks in off-mode, but then the init-code would have to write retained values to the registers again.

    3. Not 100% sure what you are suggesting. Typically you should have Vdd applied to the chip at all times and either use the internal comparator/ADC to sample the 3.5V or a divided down version of it if Vdd is lower than 3.5V. Or you can use a GPIO pin together with an external voltage comparator.

Children
No Data
Related