PDA

View Full Version : Elephant stimulus, and beyond...



Del Ogren
05-08-2006, 12:15 PM
Friends,

Some of you might remember a previous post where a cousin, and
her graduate student, pulled me out of retirement to do some hardware
and write some Basic Stamp code to help them with an experiment
aimed at understanding whether or not elephants respond to sound
in an operant conditioning experiment.

Thanks to your help, the project is done.· And just needs to be put in
a box that they can use in the field.

But I'm still not all that happy with it.

I believe that true interrupts are not supported.
Is that true?

What I'd like to do is put the controller into low current draw mode until
either·of two switches is pressed, then go off to a subroutine, and then
go back to sleep.

Is that possible?

--del

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Which end do end-users use?

·

allanlane5
05-08-2006, 08:13 PM
It should be possible with one switch, if you tie that switch across the 'reset' line. Then write your code such that when it comes up, it can find out 'why' it was reset -- or probably you can always assume your code 'wakes up' on reset to run your program.

Then, at the end of your code, call a "sleep".

Del Ogren
05-09-2006, 12:00 PM
Hmm, that might work...

I might try that, but at the moment I'm under the gun to
get a prototype in their hands by this weekend.

Worth thinking about tho...

--del

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Which end do end-users use?

·

Grant_O
05-10-2006, 04:07 AM
That’s a good idea. But how about this added on to it. You can use more then one switch except they have to be double pole, one of the poles controllers the reset and the other is linked between an IO pin and Gnd or VDD. If the switch is thrown the stamp resets and on load runs a few conditional statements. If Sw1 or Sw2 ect... satisfies the condition then the stamp will go to the specified sub ruteine or label:

Although there is more then likely a bug in this as during the time the switch is thrown the stamp will be forced to repeatedly reset, hence when the switch is open the reset will stop but there will be no closed switch to satisfy the IF conditional statement.
Maybe some circuits will have to be built to pulse the reset pin once quickly. (Im not in a thinking mood today but maybe you could somehow use a small capacitor that charges while the switch is in open state and discharges through the switch when closed to control a current to the reset pin. quick pulse, might work!).

Good luck though.

Del Ogren
05-12-2006, 06:54 AM
Thanks for all the input,
But it's a problem I've stopped worrying about.
That 9V battery doesn't seem to want to die!

Myabe I should hook it up to the power supply to see
how much current it actually draws?! '-)

--del

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Which end do end-users use?

·

Grant_O
05-13-2006, 12:23 PM
yea im useing a BS1 right now at work running on a 9V Duracell, it drives a few little reed relays but and the guys there never turn it off at night. it doesnt die normaly for about 2 weeks!