Shop OBEX P1 Docs P2 Docs Learn Events
Power up timing sequence for the prop — Parallax Forums

Power up timing sequence for the prop

Don MDon M Posts: 1,654
edited 2010-02-11 18:35 in Propeller 1
I am looking at utilizing the Prop in a project that will data log serial data. The procedure would normally be as follows:

1. Connect data logger device to serial bus.
2. Power applied to machine providing the serial data. Same power will also power the data logger device.
3. Specs for the machine specify that the serial communication starts no sooner than 200ms but 500ms is typical.

Herein lies my problem. I was intending the data logger device to derive its power from the machine so it powers up the same time as the machine. Both to simplify the design and the need for a battery, etc. However the Prop as I understand it takes time to load its image from EEPROM to the Prop and start running of approx 1.6 seconds. Am I correct on this?

So I would need to keep the prop powered prior to the data logging by way of a battery. Any comments here about power consumption for the Prop in a "low power standby mode"? Any ideas or experience with this?

Don


Renamed post.

Post Edited (Don M) : 2/8/2010 6:10:14 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-08 15:24
    I don't believe it takes 1.6 seconds for a Propeller to start up, particularly if you have a pulldown on the boot receive pin to bypass waiting for a PC. It's more than 500ms though since the boot routine has to load 32K from the EEPROM at roughly 25us per byte.

    Look at the Propeller datasheet for specifics on the power requirements. A Propeller can switch clock frequency "on the fly" and, using WAITCNT / WAITPNE / WAITPEQ instructions, running cogs can be put into low power mode. The clock frequency determines overall power consumption including hub functions and all cogs can be either stopped or put into low power mode dropping chip power consumption into the uA range.

    Where do you plan to put the logged data? Remember that all sorts of storage devices require long times to initialize themselves, much longer than what a Propeller takes.
  • Don MDon M Posts: 1,654
    edited 2010-02-08 17:33
    Mike- The logged data will be sent to an SD card. I see on page 18 of the Prop manual where it describes the Boot up process and the Run time process. However it is not very specific (to me anyway) of any absolute time. So to get this in a graphical sort of way:

    Power up --->clock in slow mode for 50ms--->Switches to fast mode ---> Runs built-in boot loader---> Looks for communication from PC host --->Finds none so looks to eeprom --->Loads image from eeprom into Prop ram--->Program starts running from Cog 0

    There is mention of 100ms but it is not clear to me if that is the expected total run time of the above mention process or what.

    The data will be starting after 200ms at a rate of 9600 baud.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-02-09 00:21
    The problem is, I am guessing, that is takes differing amount of times depending on what boot it is doing (with/without PC, etc.).

    If you have two propellers you could have PropA reset ProbB and start a timer, have PropA time how long it takes for PropB to execute it's first command (setting a pin). I would do it if I had the time right now. Maybe tomorrow. I am kind of curious too.

    Off hand, anyone know how long it takes to launch a cog.

    EDIT: That is, if I were to launch a PASM cog from SPIN, how many clocks before the first PASM command would execute?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!

    Post Edited (Bobb Fwed) : 2/9/2010 12:31:34 AM GMT
  • kuronekokuroneko Posts: 3,623
    edited 2010-02-09 00:25
    Bobb Fwed said...
    Off hand, anyone know how long it takes to launch a cog.
    8K cycles (512*16) plus some minor overhead due to hub sync (less than 32 cycles).
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-09 04:42
    The source code for the boot loader is downloadable from Parallax. This resides in ROM and is copied from ROM to cog 0's RAM to execute. This takes about 512 * 16 cycles running with the RCFAST clock which is somewhere between 12 MHz and 20MHz. The boot loader should start running in less than 1ms. If there's a pulldown on Prop I/O pin #31, the boot loader drops immediately into the EEPROM loader which takes roughly 800ms. Figure the whole startup process takes less than 1 second.

    If you're using an SD card for datalogging, the SD card takes a while to be initialized once it's powered up. If you're using a FAT file system, then you have to open the log file too.

    You're going to have to keep the Propeller powered up or add some kind of buffering for the log data.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-02-09 06:17
    I have used stacked coin aluminum electrolytic capacitors to keep my propeller booted up when I had such a need. The ones I got were 1F and about the size of three (or so) quarters stacked. They had an ESR of 30 ohms, but they run the propeller (with one cog @ 5MHz) for over 5 minutes. If you put a couple in parallel that would go up to 12 minutes (more than double -- due to the high ESR) or at 20kHz it would last for ages. Cheaper and much easier than a battery. As long as you don't need it to last for a long time. You put it into a power save mode, then pull it out using the clock set capabilities when you need it to do something really quick. Just be sure to have a smaller cap as well (1000µF or so) and decouple the Smile out of everything to get the best performance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
  • BradCBradC Posts: 2,601
    edited 2010-02-09 06:29
    I'd keep it powered up with an RCSLOW clock and one cog sitting in a wait* waiting for an external pin to change state. Bringing things back up from there is a matter of milliseconds.
    You could start all the cogs loading and then do the clock switch while they boot up. You should be able to go from ultra low power to full speed in less than 20ms (limited by PLL settling time).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • Don MDon M Posts: 1,654
    edited 2010-02-11 14:32
    Ok here is a screen shot from my logic analyzer showing the amount of time from when the 3.3 volt supply comes up till the first output pin in the attached program turns on. As you can see it takes a bit over 1.25 seconds to fire up. I also tried the same test using the reset button and the time is exactly the same. Attached please find the simple program and the analyzer screen shot.

    I don't know how to implement Bradc's suggestion to see if it is any faster. Any and all comments welcome. If anyone has a simple program they would like to forward here to test this theory please do so. I'll be glad to show the results.

    Thanks.

    pub led_blink
    · dira[noparse][[/noparse]16] := 1
    · dira[noparse][[/noparse]17] := 1
    · dira[noparse][[/noparse]18] := 1
    · repeat
    ··· outa[noparse][[/noparse]16] := 1
    ··· outa[noparse][[/noparse]17] := 0
    ··· outa[noparse][[/noparse]18] := 0
    ··· waitcnt(clkfreq + cnt)
    ··· outa[noparse][[/noparse]16] := 0
    ··· outa[noparse][[/noparse]17] := 1
    ··· outa[noparse][[/noparse]18] := 0
    ··· waitcnt(clkfreq + cnt)
    ··· outa[noparse][[/noparse]16] := 0
    ··· outa[noparse][[/noparse]17] := 0
    ··· outa[noparse][[/noparse]18] := 1
    ··· waitcnt(clkfreq + cnt)
    ··· outa[noparse][[/noparse]16] := 0
    ··· outa[noparse][[/noparse]17] := 1
    ··· outa[noparse][[/noparse]18] := 0
    ··· waitcnt(clkfreq + cnt)
    ·
    1403 x 460 - 100K
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-11 15:02
    Did you have a pulldown resistor on pin 31?
  • Don MDon M Posts: 1,654
    edited 2010-02-11 15:13
    Mike- I am using the Professional Development Board. Pin 31 goes to the crystal. If you are referring to the BOE pin 10 then yes the board has a 10k resistor to ground.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-11 15:18
    Sorry, I'm referring to I/O pin 31, DIP pin 40. This is the boot receive line from the Propeller Tool. The ROM boot code initially checks whether this line is low or high. If low, it immediately goes to the EEPROM boot code. If high, it waits for a period of time looking for data from the Propeller Tool and goes to the EEPROM boot code if it times out.
  • Don MDon M Posts: 1,654
    edited 2010-02-11 15:29
    Ok I'll try tying it low. 10K good enough?
  • Don MDon M Posts: 1,654
    edited 2010-02-11 15:34
    No different with 10K on P31 to ground.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-02-11 17:10
    I did a test. I had two propellers, one resets the other and it tracks the time it takes with this program:
      OUTA[noparse][[/noparse]17]~                     ' reset
     
      start := cnt                  ' start timer
      OUTA[noparse][[/noparse]17]~~                    ' release reset                                   
      
      waitpne(|< 16, |< 16, 0)      ' wait for propeller to set pin low
      time := cnt - start           ' end timer
    
    



    It takes about 123637632 cycles at 80MHz which is 1.545 seconds. The amount of time was fluctuating a few hundred thousand cycles in either direction but the amount of time is not massive. The propeller that is resetting is also running at 80MHz. I also tried it without setting the clkmode (this it was running at about 12MHz), it took about 0.005 seconds less time (probably due to PLL settling time). Of course, this is all with a pull up on both P30 and P31 (due to other necessities I have on my circuit board).

    So this doesn't help, but it confirms what Don M was seeing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-11 17:27
    If there's no pulldown resistor on I/O pin 31, the timeout for serial input from the Propeller Tool is about 150ms, not much for a 1.5s overall boot time.
  • Don MDon M Posts: 1,654
    edited 2010-02-11 18:35
    So my question is- if the program is already loaded into eeprom and then the prop goes to "sleep"- how long of a time for it to come alive? I know there was mention somewhere of 50ms but I would like to measure it. Can someone throw something simple together and add it to the program at the top of this thread? Maybe something like BradC mentioned ealier in this thread?

    "I'd keep it powered up with an RCSLOW clock and one cog sitting in a wait* waiting for an external pin to change state. Bringing things back up from there is a matter of milliseconds.
    You could start all the cogs loading and then do the clock switch while they boot up. You should be able to go from ultra low power to full speed in less than 20ms (limited by PLL settling time)."
Sign In or Register to comment.