When the Operate property is 1, the oFreqL Object cycles the I/O line specified by the IOLine property at a rate specified by the Divisor property. The Rate property is a clock divider value that specifies the frequency. The Frequency is derived from a 1,132kHz clock divided by 128 minus the value of the Rate property. [Frequency = 1132/(128-Rate)] For example, a Divisor of 120 will produce a frequency of 141.5Hz. [141.5 = (1132/(128-120))] If 0 is given as the Divisor, then the output is shut off. This is useful for some rudimentary low frequencies. If you need a higher frequency, see the oFreqH object. if you want music, see the oSoundgin object. The Rate can be calculated for the desired frequency using the following formula: Rate = [128 - (1132 / Frequency) The lowest frequency that can be generated is 8.913Hz [8.913 = (1132/(128-1))] The highest frequency that can be generated is 1132Hz [1132 = (1132/(128-127))] Note that the frequencies are not linear. This will be most noticeable at the higher frequencies. (1132/1=1132Hz, 1132/2=566hz). The actual output is done by inverting the state of the I/O Line. The result is a square wave output at the specified frequency. If two or more oFreqL Objects are set to the same I/O line, the output is effectively the two tones combined.The oFreqL Object's output shares its timing with the rest of the ooPIC's multitasking objects. A large number of Objects running concurrently with the oFreqL Object can result in distortions on the higher frequency tones. |