Pause vs Sleep Alternatives
First, thanks to all for the help over the last week. It's quite the learning curve, but I think we've got most of it nailed down.
OK, so it appears we're being tripped up by the fact that the PAUSE command is limited to the 64000ms. I discovered the SLEEP command, which can do things in longer time periods, although I'm not able to figure out how to do things in parallel so I'm reaching out for ideas again.
In short, here's what we're up to as we ready our programmed module for it's first near space flight.
Our BS2 needs to do a few simple tasks, separated, unfortunately, by time increments greater than those allowed in the PAUSE command.
We launch at T=0.
At T=10 minutes, we send a PULSOUT command to the servo at PIN 14 to open the payload bay doors.
At T=90 minuter, we send a PULSOUT command to the servo at PIN 14 to close the payload bay.
At T=91 minutes, we cut down the Balloon by sending (via a relay through a darlington array) a 1 minute pulse of power at PIN 1 to a piece of nichrome wire that will burn off the balloon cord.
HIGH 1
PAUSE 60000
LOW 1
At T=150 minutes, we turn on the audible tracking beepers at PIN 2 (again through a relay) and they stay on from this point until recovery.
HIGH 2
At T=240 minutes, we cut down the parachute (in case we're caught in a tree), with a 1 minute pulse of power at PIN 3
HIGH 3
PAUSE 60000
LOW 3
END
It would seem that I can deal with the time issue, by using the SLEEP command in between these different events, is that correct?
Now, here's the bigger problem. I'm not sure I can use the SLEEP command at all, because while the BS2 is conducting the simple program items above, it is also storing to a memory card the external temperature and GPS position each minute, so that when it returns we can pop that card in and see what the temp was at each minute and at each GPS coordinate during the flight.
So now I'm stuck, and need the experts big time....
Hope someone has a solution because I've looked everywhere with no luck. I thought I could somehow run the items above with SLEEP in between, while at the same time allowing it to store the other info at the datalogger card.
Regards
Steve
OK, so it appears we're being tripped up by the fact that the PAUSE command is limited to the 64000ms. I discovered the SLEEP command, which can do things in longer time periods, although I'm not able to figure out how to do things in parallel so I'm reaching out for ideas again.
In short, here's what we're up to as we ready our programmed module for it's first near space flight.
Our BS2 needs to do a few simple tasks, separated, unfortunately, by time increments greater than those allowed in the PAUSE command.
We launch at T=0.
At T=10 minutes, we send a PULSOUT command to the servo at PIN 14 to open the payload bay doors.
At T=90 minuter, we send a PULSOUT command to the servo at PIN 14 to close the payload bay.
At T=91 minutes, we cut down the Balloon by sending (via a relay through a darlington array) a 1 minute pulse of power at PIN 1 to a piece of nichrome wire that will burn off the balloon cord.
HIGH 1
PAUSE 60000
LOW 1
At T=150 minutes, we turn on the audible tracking beepers at PIN 2 (again through a relay) and they stay on from this point until recovery.
HIGH 2
At T=240 minutes, we cut down the parachute (in case we're caught in a tree), with a 1 minute pulse of power at PIN 3
HIGH 3
PAUSE 60000
LOW 3
END
It would seem that I can deal with the time issue, by using the SLEEP command in between these different events, is that correct?
Now, here's the bigger problem. I'm not sure I can use the SLEEP command at all, because while the BS2 is conducting the simple program items above, it is also storing to a memory card the external temperature and GPS position each minute, so that when it returns we can pop that card in and see what the temp was at each minute and at each GPS coordinate during the flight.
So now I'm stuck, and need the experts big time....
Hope someone has a solution because I've looked everywhere with no luck. I thought I could somehow run the items above with SLEEP in between, while at the same time allowing it to store the other info at the datalogger card.
Regards
Steve
Comments
The Maxim/Dallas DS1302 is a readily available real-time clock that's easily controlled by a Stamp. There's plenty of sample code available for this. It requires 3 I/O pins. Have a look at Nuts & Volts Column #33 for details. You don't have to set the clock to the actual time and date (although you could). It would be enough to zero the time and date at launch time, then use the minutes information to do your timing. The clock could be used to time stamp your data.