Generating a tone

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Generating a tone

Post by FFMan »

Is it possible with the zx to generate a tone whilst receiving serial data or does the resources required mean this is not possible.

I'd like to generate simple tones like those used in a variometer.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Generating a tone

Post by dkinzer »

FFMan wrote:Is it possible with the zx to generate a tone whilst receiving serial data or does the resources required mean this is not possible.
FreqOut() disables interrupts for the entire duration of the tone. To avoid interfering with serial transmission/reception on one of the software UART channels (Com3 to Com6) interrupts must be disabled for no more than about 25% of a bit time. For a hardware UART, transmission is not affected by interrupts (other than possibly delaying the beginning of the next character transmission) but reception may be affected if interrupts are disabled for more than about 1.9 character times (a character time is 10 to 12 bit times).
- Don Kinzer
Post Reply