Shop OBEX P1 Docs P2 Docs Learn Events
How long? — Parallax Forums

How long?

Sniper KingSniper King Posts: 221
edited 2008-08-27 18:22 in Propeller 1
From power on to program execution how long does it take?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Ouch, thats not suppose to be hot!··


Michael King
Application Engineer
R&D
Digital Technology Group

Comments

  • Sniper KingSniper King Posts: 221
    edited 2008-08-27 17:14
    This is what I am trying to do.· It is simple really.

    I have a parallax PIR sensor.· I have it set to go high on detection.·The PIR sensor will stay high for 2 seconds.·I have this switching power on to the propeller.· That works.· The code in the propeller is small...really small for testing...·

    DIRa[noparse][[/noparse]15]~~
    repeat
     OUTa[noparse][[/noparse]15]:=1
     
    

    pin 15 also drives the switch.· So in essense the PIR sensor activates, switch goes on. Propeller starts program execution and keeps the switch alive until it finishes what it needs to do and then will commits suicide by driving pin 15 low( in the finished software).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Ouch, thats not suppose to be hot!··


    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-08-27 17:25
    That information is in the datasheet in section 9.6, there is no exact time provided because the boot sequence uses the internal RC clock which varies in it's speed across chips because of process variation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Sniper KingSniper King Posts: 221
    edited 2008-08-27 17:29
    if I have 2 seconds of power, is that going to be enough time for the program to execute?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Ouch, thats not suppose to be hot!··


    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-27 17:35
    The time is on the order of 1.5 seconds (see page 29 of the Datasheet). You would do much much better by keeping the Propeller powered up, but running at a slow clock rate (like using the internal RCSLOW clock) and using the WAITPEQ/WAITPNE statements to look for the PIR output to go high. The WAITPEQ/WAITPNE instructions markedly reduce the power consumption of the cog and the other, stopped, cogs take very little power. With the crystal oscillator and PLL turned off, the idle current of the Propeller is well under 100uA, probably closer to 50uA. You can go through the graphs in the Propeller Datasheet to figure out the specifics for your situation.
  • Sniper KingSniper King Posts: 221
    edited 2008-08-27 17:59
    Can you give me a little code to know what direction to go?· At some point I need to go to a higher clock speed to run fullDuplexSerial than then go to a low power mode again.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Ouch, thats not suppose to be hot!··


    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Sniper KingSniper King Posts: 221
    edited 2008-08-27 18:22
    {{
    PIR UDA Sensor.spin, v1.1,Michael King
    ┌──────────────────────────────────────────┐
    │ Copyright (c) 2008 Michael S. King       │               
    │ See end of file for terms of use.        │      
    └──────────────────────────────────────────┘
    
     
    }}
    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    VAR
     
    OBJ
           
            Send : "FullDuplexSerial"
            
    PUB main
    DIRa[noparse][[/noparse]15]~~    
    OUTa[noparse][[/noparse]15]:=1  ' Keep Power alive after PIR out goes low     
     
      
     
     dira[noparse][[/noparse]16]:=1 
    
     outa[noparse][[/noparse]16]:=1  'PIN High of PWR to switch XTEND module on 
    
     send.start(21,17,0,9600)  ' start FullDuplexSerial
    
     waitcnt(10_000_000+cnt)   'Wait a bit for the XTEND to be ready
    
     send.str(string("<*00000001*S*>")) 'Send activation of sensor Message
    
     waitcnt(30_000_000+cnt)  ' Wait for message to be sent
    
     outa[noparse][[/noparse]15]:=1     ' Kill thy self
     
     
    

    This is my code..· I dont know how to use the RCSLOW or the WAITPEQ commands properly.· That certainly sound like the way I want to go though!· Makes this really simple to implement.· But how do I get the clock speed up for the use of the FullDuplexSerial Object and then bring everything back to RCSLOW clock again.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Ouch, thats not suppose to be hot!··


    Michael King
    Application Engineer
    R&D
    Digital Technology Group
Sign In or Register to comment.