Shop OBEX P1 Docs P2 Docs Learn Events
No interrupts issue — Parallax Forums

No interrupts issue

You2meYou2me Posts: 2
edited 2007-04-15 19:09 in BASIC Stamp
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?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-15 19:09
    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.
Sign In or Register to comment.