Shop OBEX P1 Docs P2 Docs Learn Events
Continuous Frequency Generation — Parallax Forums

Continuous Frequency Generation

Gerry ShandGerry Shand Posts: 45
edited 2012-06-24 08:20 in BASIC Stamp
Hi All:

I want to generate a frequency continuously on a pin. The frequency will be filtered and fed into an audio amplifier. The FREQOUT command has a set time interval that you have to program in. Is there a way around this so you can generate a tone continuously?

Thoughts?

Thanks.

Gerry Shand

Comments

  • NWUpgradesNWUpgrades Posts: 292
    edited 2012-06-22 18:48
    I may be wrong (and I am sure someone will point out if I am) but I think a simple loop would solve this issue.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-06-22 20:24
    No, there is no way to generate a continuous signal on a Stamp I/O pin. The Stamp is a single-threaded processor ... it can only do one thing at a time. The FREQOUT statement can generate two tones at the same time, but it can only do tone generation while the statement is executing. As soon as the FREQOUT is done executing, the tone stops. The only way to generate a continuous tone is to have some kind of external signal generator that the Stamp controls. The SoundPAL is an example of this.
  • ercoerco Posts: 20,257
    edited 2012-06-24 08:20
    Everybody's right here. Depending on your application, NWU's looping suggestion may work for you. Creating a loop of FREQOUTs will output a fairly continuous frequency, perhaps a few cycles missing during the looping process.
Sign In or Register to comment.