Shop OBEX P1 Docs P2 Docs Learn Events
How to wake up a QuickStart board? — Parallax Forums

How to wake up a QuickStart board?

Duane DegnDuane Degn Posts: 10,588
edited 2011-06-13 19:44 in Propeller 1
I'm working on a data logging project using a QuickStart board.

I know there are commands like waitpe and waitpne that can put a Prop into a low power state as it waits of a button to be pressed or some other event that raises or lowers a pin's state.

I doubt the touch pads could be used for such a trigger? Right?

I'll be using a mezzanine board with this project. Do I need to add a "real" button to wake up the Prop?

I'll have multiple thermistors, a uSD card, RTC, EEPROM and probably and accelerometer connected to the mezzanine board. I don't see a way of waking a Prop with any of the devices I just mentioned.

Unless. . . I could possibly use the uSD card holder's "check disk(CD)" pin to wake up the Prop. I'd need to probably pop the uSD out of the socket to trigger the wake up. I'd rather not go this route though. Those uSD cards are too easy to drop and lose.

Any other ideas?

Duane

Comments

  • jazzedjazzed Posts: 11,803
    edited 2011-06-13 10:57
    Duane Degn wrote: »
    Any other ideas?
    When do you need the logger to wake up? Manually only?
    Some RTCs have an alarm function that could be used.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-06-13 11:27
    Jazzed, Thanks for thinking about this with me.

    I want it to wake up periodically, say every fifteen minutes or so and manually.

    I figure I'll use a waitcnt(cnt) type delay and increment a counter (or check the RTC) to get close to whatever interval I want it to wake up (it wont need to be very precise).

    I'll also want to be able to wake it up manually to either end the logging session or to transfer data to another device.

    I don't think the RTC (DS1307) I'm using has an alarm. Not that an alarm would help me wake a Prop manually.

    I'll probably just add a button on the mezzanine board. I was hoping not to have add an extra part.

    Duane
  • jazzedjazzed Posts: 11,803
    edited 2011-06-13 11:41
    Duane, I think your approach is fine.

    As for waking up every 15 minutes more or less with an alarm, I was thinking you could use the alarm output to reset the propeller until the alarm pin goes high to release reset at a preset time in the future (requires BOE pulled high). A DS1337 is available in a DIP8 or SMD package.
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2011-06-13 11:56
    The DS1307 has a 1/2 second heartbeat output. Put the Prop in RCslow mode with one cog running to monitor transitions on that heartbeat pin, count up to 1800 for a 15 minute interval, then back up to speed for logging.

    Why not add a small pushbutton? In parallel with one of the quickstart pads, and with a real pullup resistor. In a pinch you can use the reset button for wake-up.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-06-13 11:56
    Duane,

    You could use two cogs: one with a waitpeq for the pin; the other with a waitcnt for the fifteen-minute interval. Whichever one activates first wins. In order to span your fifteen minutes within the counter's 32 bit range, you can switch to RC_SLOW mode while you're waiting. This also has the benefit of minimum power usage.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-06-13 14:16
    jazzed wrote: »
    Duane, I think your approach is fine.

    As for waking up every 15 minutes more or less with an alarm, I was thinking you could use the alarm output to reset the propeller until the alarm pin goes high to release reset at a preset time in the future (requires BOE pulled high). A DS1337 is available in a DIP8 or SMD package.

    jazzed, Thanks for the suggestion. I doubt I have a DS1337 on hand. I'm hoping to start using the logger tomorrow morning. I will take a look at the DS1337 to see if I want to include it in a future parts order.
    Why not add a small pushbutton? In parallel with one of the quickstart pads, and with a real pullup resistor. In a pinch you can use the reset button for wake-up.

    Tracy, My mezzanine board is getting crowded. I was hoping not to need an extra button though this is the solution I"ll likely use.
    In a pinch you can use the reset button for wake-up.

    I hadn't thought of this alternative. Interesting idea. I can still reach the reset button with the mezzanine board attached. I might do this. Thank you.
    Duane,

    You could use two cogs: one with a waitpeq for the pin; the other with a waitcnt for the fifteen-minute interval. Whichever one activates first wins. In order to span your fifteen minutes within the counter's 32 bit range, you can switch to RC_SLOW mode while you're waiting. This also has the benefit of minimum power usage.

    -Phil

    Phil, I'll probably go the route you just suggested. Thank you.

    I just noticed from Phil's post, that I misspelled "waitpeq" in my top post. I don't think I've ever used waitpeq in any code I've written. I'm sure it's in lots of my modified versions of other peoples code.

    Thanks everyone for taking time to help.

    Duane
  • AribaAriba Posts: 2,690
    edited 2011-06-13 15:05
    If you add a very high pullup to P0, it's possible that you can use the Touchbutton at P0 like a normal switch. Try it with 10 MOhm for example.

    Andy
  • David CarrierDavid Carrier Posts: 294
    edited 2011-06-13 15:28
    Duane,
    If you clock the Propeller in RCSLOW mode, you can still read the touch buttons, and the Propeller's power consumption will be minimal. (I think it is around 500 μA, but I know it is much less than the power LED.) You will probably need to modify the touch button driver to get it working at that low of a frequency, but I've done it before, so I know it will work.

    — David Carrier
    Parallax Inc.

    Edit: I modified the demo to work in RCSLOW mode and attached it.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-06-13 19:42
    David,

    Thank you. The modified demo works great.

    This is the first time I've worried about battery life on a project.

    I had forgotten how little power the Prop uses with RCSLOW.

    This will make my job a lot easier.

    Thanks again.

    Duane
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-06-13 19:44
    Ariba wrote: »
    If you add a very high pullup to P0, it's possible that you can use the Touchbutton at P0 like a normal switch. Try it with 10 MOhm for example.

    Andy

    Andy, I had wondered it something like you suggested is possible. I think it's worth trying.

    Thanks,

    Duane
Sign In or Register to comment.