Shop OBEX P1 Docs P2 Docs Learn Events
Super low power mode... something not right — Parallax Forums

Super low power mode... something not right

wanderingjeepwanderingjeep Posts: 3
edited 2010-10-15 15:43 in Propeller 1
When i start the program I set it to rcslow. Then at some points I set it to use the xtal at 80mhz then back to rcslow. When the program starts I draw 3.95ma when I switch to 80mhz and back to rcslow, it draws 6.87ma. Any ideas here?
Pub ClockSet(X)

if x:=1 
  clkset( %01101000,80_000_000 )    'Set to XTAL1
  waitcnt(220000+cnt) 
  clkset( %01101111,80_000_000 )    'Set to XTAL1 + PLL16x
   waitcnt(3000000+cnt)
   return

If X:=0    
    waitcnt(cnt+500_000) 
     
  clkset(%0000001 , 20000)
                                                    ' turn on crystal, but don't use it
  waitcnt(2000 + cnt)                                                            ' wait [at least] 10ms for PLL/crystal to stabilize

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2010-10-15 13:17
    Power varies with what the Prop is doing. The Propeller Datasheet has a graph that shows that SPIN uses more power than assembly and a waitcnt/waitpeq/waitpne uses even less power. You may want to read Section 9 of the datasheet.

    John Abshier
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-10-15 14:11
    Pure guess work but, does the Prop spend enough time at 80MHz to warm up slightly and have a higher draw ?
  • rokickirokicki Posts: 1,000
    edited 2010-10-15 14:27
    Yeah, none of those numbers are "low". We'd need to see/know:

    1. How you are measuring? Does it include *only* the prop, prop+EEPROM, prop+EEPROM+regulator, etc.?

    2. Can we get the entire program?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-15 14:27
    wanderingjeep,

    Can you post the simplest program (in its entirety) that exhibits this behavior? It's hard to tell just from one subroutine what else might be going on in your code.

    -Phil
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-10-15 15:43
    Just some problems with your code to note:
    You use if statements where you store X as a value. Are you sure you don't mean to compare X to the value? Use == instead of := if you do.

    Your clkset()'s are wrong. Like the first one (I think, if I'm reading it right) would turn on XTAL1, but actually use RCFAST, and no matter if that last statement is right or not, you wouldn't be running at 80MHz, but you set your timing at that, thus your waitcnt will be performed differently than what you may think.

    Check out my attached file, these are the methods I've been using to go into and come out of power save mode. It includes all the necessary waiting and whatnot. There are options to go to RCSLOW, RCFAST, 5MHz, 20MHz, 80MHz, etc.
Sign In or Register to comment.