Author Topic: microcontroller with sleep status output?  (Read 2289 times)

0 Members and 1 Guest are viewing this topic.

Offline NiHaoMikeTopic starter

  • Super Contributor
  • ***
  • Posts: 9005
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
microcontroller with sleep status output?
« on: June 26, 2017, 03:35:49 am »
Are there any microcontrollers with a sleep status output? In other words, the capability to set a GPIO output a logic level depending on whether the microcontroller is in sleep or in active mode, set by hardware? The main advantage I see is that for applications where the microcontroller goes to sleep often and is usually in the active state for a very short time, external peripherals (e.g. sensors) can start powering on a little sooner and reduce the active time needed. And be immune to strange bugs from forgetting to set a GPIO on entering or exiting sleep.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7720
  • Country: ca
Re: microcontroller with sleep status output?
« Reply #1 on: June 26, 2017, 04:22:04 am »
Bug in code not being able to set an IO before and after the sleep command?  Wouldn't this would be an impossibly difficult bug to create?

As for minimal advance powering up signal for external hardware, why not put the MCU into sleep in 32KHz ultra low power mode, then when waking up, in 32KHz, set the IO on and wait that infinitesimal small delay before changing the MCU clock back to full speed as a means of minimizing power consumption?
 

Offline NiHaoMikeTopic starter

  • Super Contributor
  • ***
  • Posts: 9005
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: microcontroller with sleep status output?
« Reply #2 on: June 26, 2017, 04:34:05 am »
It's more for curiosity than a real need. As for how to forget to set a GPIO, maybe there's a time after initial development where there's a need to add another ISR and the requirement to set the GPIO is forgotten.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Online Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3335
  • Country: ca
  • Place text here.
Re: microcontroller with sleep status output?
« Reply #3 on: June 26, 2017, 04:58:39 am »
I put an ammeter on the power supply of a PIC I was debugging. Sleep means the current consumption goes to 0 as far as a milliammeter is concerned. Wasn't my code or my design so this was the quickest way to find out if the thing was indeed sleeping.
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Online AndyC_772

  • Super Contributor
  • ***
  • Posts: 4221
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: microcontroller with sleep status output?
« Reply #4 on: June 26, 2017, 07:18:15 am »
Code: [Select]
void sleep (void)
{
  p_gpio_sleeping = 1;
  asm ("sleep");
  p_gpio_sleeping = 0;
}

Offline cgroen

  • Supporter
  • ****
  • Posts: 631
  • Country: dk
    • Carstens personal web
Re: microcontroller with sleep status output?
« Reply #5 on: June 26, 2017, 07:36:26 am »
It's more for curiosity than a real need. As for how to forget to set a GPIO, maybe there's a time after initial development where there's a need to add another ISR and the requirement to set the GPIO is forgotten.

If you are afraid that you will forget to set/reset a GPIO pin in this particular situation, then what about the other million situations where you need to set a GPIO pin ???
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf