Shop OBEX P1 Docs P2 Docs Learn Events
Being energy efficient — Parallax Forums

Being energy efficient

Hello all,

A project I am working on is a USB power bank. I want the prop to control and monitor the charging, discharging, fuel gauge, etc.. And I am looking to get some ideas and input about one thing. I have the rest somewhat figured out.

I would like the prop to either go into a low power mode or stop all together when there is no output load, or input charging. Mostly, if there is no reason for the prop to be running at full power, then in it shouldn't be running at full power.

The actions that would put the prop back into full power mode would be, pushing a single button(power), connecting an input charger, or hooking a load to the output(phone).

One idea I had was to make the prop stop all but COG-0, and go to the lowest clock frequency it can. Then increase the clock frequency, and start additional COG's when a input action is detected.

What ideas does everyone have?

Thanks
TC

Comments

  • Of course there are micros that are specially designed for this sort of thing but if it's not for mass production then damn the torpedoes, full speed ahead with the mighty Propeller!

    The A/D chips probably need to have power all the time because their inputs are connected to the battery. If it was charging I wouldn't snooze on the job, you need to be checking charge voltage/current and time and temperature.

    Stopping all but one cog and switching to RCSLOW (~20kHz) is the typical way it can be made to snooze and even then you can waitcnt to cut power further, but bear in mind that the crystal oscillator will need time to stabilize when restarted, up to 10ms.

    There are so many A/Ds out there to choose from, just don't go for the old and lame "tried and proven" seeing you want to have some fun with the Prop.
  • TCTC Posts: 1,019
    I wasn't planing to have it snooze while charging, there would be no benefit since there would be an outside power source.

    For the A/D portion I was going to use a fuel gauge chip from TI. It would offload reading battery voltage, charge and discharge current, temp, and remaining capacity, as well as other things. The prop would only talk to the TI chip when the prop is out of snooze mode. The TI chip uses micro-amps of current, so it would not matter if the TI chip stayed on.
  • Sorry, I must have misread "I would like the prop to either go into a low power mode or stop all together when there is no output load, or input charging" but you must have meant "or NO input charging" or "nor input charging" :)

    The Prop sounds like overkill sometimes but we love it.
  • TCTC Posts: 1,019
    You are correct, that is exactly what I ment... But in my defense I did not have my morning coffee yet...

    The prop is way overkill, but its no fun doing something and not going overkill... Plus, its the only MCU I know how to work with.
  • Some basic functions to switch between clock speeds:

    If you don't need any type of precisely timed operations (serial communication, etc.) use these:
    PRI _rcslow_prop
    '' put propeller into slowest power save speed (using internal oscilator)
    
      clkset(%0_0_0_00_001, 20_000)                                                 ' ~20kHz no PLL
    
    PRI _rc_to_fast_prop
    '' put propeller into a fast speed (80MHz), intended to be used after propeller was put in rcslow mode
    
      clkset(%0_1_1_01_000, 12_000_000)                                             ' turn on PLL/crystal, but don't use it
      waitcnt(120000 + cnt)                                                         ' wait 10ms for PLL/crystal to stabilize
      clkset(%0_1_1_01_111, 80_000_000)                                             ' 80MHz
    

    If you do need precisely timed operations, then you'll need to stick to the external crystal, but you can save a little power by turning off the PLL like this:
    PRI _slow_prop
    '' put propeller into slowest power save speed (using XTAL), intended to be used when propeller already using XTAL
    
      clkset(%0_0_1_01_010, 5_000_000)                                              ' 5MHz no PLL 
        
    PRI _slow_to_fast_prop
    '' put propeller into a fast speed (80MHz), intended to be used after propeller was put in slow mode
    
      clkset(%0_1_1_01_010, 5_000_000)                                              ' turn on PLL, but don't use it
      waitcnt(500 + cnt)                                                            ' wait 100us for PLL to stabilize
      clkset(%0_1_1_01_111, 80_000_000)                                             ' 80MHz
    
  • TCTC Posts: 1,019
    That is great, because that was going to be my next question. What would be the best way to slow down the prop on demand. Thank you so much.
Sign In or Register to comment.