Author Topic: Keeping daughter board asleep after the microcontroller goes to sleep  (Read 4914 times)

0 Members and 1 Guest are viewing this topic.

Offline cryptykTopic starter

  • Contributor
  • Posts: 21
Hi!
I'm new at this, so forgive my naivete.  I have a Spark Core attached to a VS1053 (mp3 player) breakout board.  I'm measuring current with the [awesome] uCurrent Gold device.

When the system is up and running, the VS1053 board consumes about 35mA.  When I drive the reset pin low on the VS1053, the current drops to about 4mA.  The problem is that after I put the Spark Core to sleep, the current draw for the VS1053 jumps to about 55mA. 
My hypothesis is that when the Spark goes to sleep, the GPIO pin I use to drive the VS1053 reset low starts floating.  I guess this doesn't account for the *increased* draw of 55mA vs. the regular 35mA, though.

Not sure where to go from here.  Any thoughts on solutions or troubleshooting would be awesome. 
Thanks!
Ryan
 

Offline kolonelkadat

  • Regular Contributor
  • *
  • Posts: 202
  • Country: us
  • Obviously, windows are central to Windows.
    • Force Project X
maybe put a mosfet switch on the power for the peripherals? that way the micro goes to sleep, the mosfet turns off, then none of the peripherals get power.

maybe also have a google for pull-up and pull-down resistors.
 

Offline cryptykTopic starter

  • Contributor
  • Posts: 21
Awesome.  I'll go look at mosfets.  I use pull-* resistors on my switches, so I'm familiar with them.  Not sure how they apply here, though?

Thanks,
Ryan
 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Awesome.  I'll go look at mosfets.

First you should be shure that it is the floating reset pin.
To be shure, hardwire reset to ground and send the spark into the power safe mode.
If this works a simple pull-down resistor on the reset pin should keep it in power-down/reset if the MCU output floats.

If the power still is high, disconnect the VS1053 to be shure that draws the power, if so, only then go for the FET :)
 

Offline kolonelkadat

  • Regular Contributor
  • *
  • Posts: 202
  • Country: us
  • Obviously, windows are central to Windows.
    • Force Project X
I use pull-* resistors ... I'm familiar with them.  Not sure how they apply here, though?

the GPIO pin I use to drive the VS1053 reset low starts floating.

a simple pull-down resistor on the reset pin should keep it in power-down/reset if the MCU output floats.
 

Offline cryptykTopic starter

  • Contributor
  • Posts: 21
Oh, GOT IT!

I hadn't thought of using a pull down that way.  THANKS!!!
Ryan
 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
I hadn't thought of using a pull down that way.  THANKS!!!

Well... that is what they are made for, if you think about it. :-)
 

Offline cryptykTopic starter

  • Contributor
  • Posts: 21
Ok, so that didn't work, but you helped me learn more about the problem, although the results make no sense to me...

If I drive the VS1053 reset pin low using a GPIO write, it correctly drops to 4ma low power mode.
If I instead unplug the reset pin jumper and move it directly to ground, it drops from about 35mA to 20mA.  I would have expected it to go to low power mode  :-//  That could just be a huge misunderstanding on my part of how these things work...

It's as if grounding the reset pin just gets me to 20mA, but setting it low with the GPIO pin correctly gets it into low power mode.  Therefore my pull-down resistor still only gets me connected to ground, but that's not good enough.

I hope that makes sense.

Thanks for all of the help,
Ryan
« Last Edit: May 09, 2015, 07:41:47 pm by cryptyk »
 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
It's as if grounding the reset pin just gets me to 20mA, but setting it low with the GPIO pin correctly gets it into low power mode. 

There is someting bad happening, i just had a quick glance at the datasheet so i might be wrong, but the power consumption of the VS1053 should be <10µA when the reset pin is low.

Correct supply voltage?
No shorts?
Maybe parasitic power?

I would test the VS1053 without annything connected to it, if possible, to see if it behaves as the datasheet says.
Then i would connect the data lines in sequence to see if/when this strange behaviour occours.

Maybe a output of the spark core is shorted when the VS1053 is in reset, or something else.
I do not know wich state it is or what is connected were but the datasheet says during reset the IO of the VS1053 will change to the respected default state.
 

Offline cryptykTopic starter

  • Contributor
  • Posts: 21
I just looked at the datasheet too, and saw the same thing.  Maybe I should have mentioned this before, but this is the breakout I'm using:
https://www.adafruit.com/products/1381

It also has an SDcard on it, and some other stuff.  I'm wondering if there's some weird interaction between the vs1053, sd card, and spark core such that when the spark goes to sleep, something else happens that causes "part" of the vs1053 board to come out of sleep mode.

I like the idea of pulling the data pins and seeing if I can narrow down a bit more. 

I've tried supplying the board with 5v on the VCC pin and 3v3 on the 3v3 pin.  Same results.  Both of those voltages come from the spark core, which has both 5v and 3v3 outputs on it.

Be back in a bit with some more details.

Thanks,
Ryan
 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
I've tried supplying the board with 5v on the VCC pin and 3v3 on the 3v3 pin.  Same results.  Both of those voltages come from the spark core, which has both 5v and 3v3 outputs on it.

Be back in a bit with some more details.

You blithering oath, there is your problem! :-) (i think)
Well, at least one problem, that board is 5V tolerant, but works on 3.3V only and it has its own power regulators from the looks of it.
You only connect one or the other supply, either 5V or 3.3V i suspect. At least that is the case with most of these boards. I suspect one of those is a output and not a input.
 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Yep, had a look, here it is:
https://learn.adafruit.com/system/assets/assets/000/011/221/original/adafruit_products_vs1053_v2.png?1380122647

The schematic says:

The VIn/5V pin is the input to the on board 3.3V regulator.
The 3.3V pin is the output of the on board regulator.
 

Offline cryptykTopic starter

  • Contributor
  • Posts: 21
I was only using one of those voltages at a time, not both at the same time.  Sounds like I should be using 5v to the VCC pin  :)

I also found the problem:  It's the DREQ pin.

The VS1053 pulls it's DREQ pin low to indicate it can receive more data/commands.  I have this hooked up to a GPIO input on the Spark Core.
Here's the summary:
1)  Drive the VS1053 reset pin low:  4mA draw
2)  Put the Spark Core to sleep:  20mA
3)  Unplug the DREQ pin:  4mA
4)  Plug the DREQ pin back in:  20mA

I obviously can't avoid using the DREQ pin in normal operation.  It seems weird to me that DREQ, being an output on the VS1053, would cause the board to draw power when it's connected, but not when it's disconnected.

 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
1)  Drive the VS1053 reset pin low:  4mA draw
2)  Put the Spark Core to sleep:  20mA
3)  Unplug the DREQ pin:  4mA
4)  Plug the DREQ pin back in:  20mA

4mA with a sd-card in the socket or without a sd-card in the socket?
The DREQ pin is not wired through the level shifter.

You wired the DREQ directly to the Spark-IO and are using the Spark pin configured as input to read the state of DREQ?

My wild guess DREQ is default high, during reset as well, then the spark IO pin goes low during power down/sleep (no idea how it works, never used one).
"Short" between DREQ and spark IO.
Solution, resitor in line, 100K perhaps, rough guess.
 

Offline cryptykTopic starter

  • Contributor
  • Posts: 21
You're a god.

I put a 6.8k resistor inline, and now DREQ still works, and powerdown mode only consumes 2.2mA.

I'm still not sure why it's not in the uA range, but that may just be the SD card- not sure.

Thank you SO much for taking your Saturday morning and helping me!!!
Ryan
 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
You're a god.

Jaffa, kree!

Quote
I put a 6.8k resistor inline, and now DREQ still works, and powerdown mode only consumes 2.2mA.

Interesting and strange at the same time, but good that it works now.
Does the Spark-IO really go low in the sleep mode?
Maybe, if it really was a short, there could allready have been a tiny bit of magic blue smoke leakage.

Quote
I'm still not sure why it's not in the uA range, but that may just be the SD card- not sure.

Yes, that is the sd-card, they have horrible stand by currents.
You are lucky that is only draws 2.2mA, that could be much, much worse.

You have 4 components consuming power:
Regulator @ ~80µA
Level shifter @ 1µA
MP3 decoder @ 5µA (in reset)
and the SD card

If you really want to safe as much power as you can, you will have to switch the power to the whole board off using a n channel fet with low rds-on and low-vgs.
And you will have to make shure that all data lines are low or tristate when the board power is switched off or you will have some parasitic feeding through the data lines.
Or you can use a buffer to tri state all lines together with the FET.

Edit:
There are SD card with much better idle currents, maybe you card has a power safe mode too.
Check if all data lines are low when the spark is in sleep mode.
Again, disconnect the data lines to make shure of that.
Maybe the sd-card goes into sleep mode if it does not see anny action on the spi interface for long enough.
« Last Edit: May 09, 2015, 09:50:24 pm by PeterFW »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf