View Full Version : No interrupts issue
04-16-2007, 01:21 AM
I know the bs2sx doesn't have interuppts, but is there any way to simulate one? I have a car with sensors and motors. I'm now adding a buzzer to make a beep sound for certain distances. I'm using PWM for the buzzer but I can't figure out a way to do the pause command without it affecting the motors as well. Is it even possible? I was also thinking of connecting the buzzer to a PIC or something but it seems like I'll run into the same problem. Any suggestions?
04-16-2007, 03:09 AM
Assuming you're using servo motors, they need a pulse only every 20ms and the maximum pulse width is 2.5ms. You could use PWM instead of the normal PAUSE between servo pulses and you'll probably get a reasonable, but ragged buzzer sound. Alternatively, you could use a piezoelectric alert buzzer with its own internal oscillator to make the sound. It only requires an on/off signal. You could use a PWMPAL with the BS2sx which provides 4 independent PWM channels with a peripheral processor that sits under the Stamp and is controlled with SEROUT. Another choice might be to use a 555 timer in astable mode to produce the buzz signal and switch it on and off with a Stamp pin.