In SX Microcontrollers, SX/B Compiler and SX-Key Tool, green_phantom wrote: We all know that you can only use FREQOUT on the SX chip to generate a tone for the piezo speaker (for example) through one I/O pin, right? I found a way to create multiple frequencies at one time. Each assigned I/O pin will generate its own tone by INCreasing an SX variable inside a DO...LOOP statement. If you want the highest frequency set at 4000 Hz, put a PAUSE 1 inside the DO...LOOP statement along with the code the INCrease a variable and send it to the corresponding Port A, B or C I/O pins of the SX chip. Try increasing the value of one of the Byte variables by 3 or 5 and send the result to the pins designated for multiple frequency/multiple pin outputs. Take the connection to the piezo speaker used to tie to one of the I/O pins and connect to one of the 8 pins that receive that byte variable. Try connecting directly to a computer speaker. According to my experiments, this will NOT damage the SX chip because instead of you needing to connect the resistors and capacitors as instructed in the sX manuals to drive an 8-ohm speaker, the computer speakers already have their own amplifier circuits. Remember that here you are connecting the SX I/O outputs to the computer speaker jacks, NOT directly to a bare-bones speaker you find in your electronic parts benchtop drawers! OR you can build a 741 Op-Amp or MOSFET-based amplifier and connect the SX to an 8-ohm speaker through the input connections to the amplifier circuit. If you use the RANDOM command in SX/B and output the result to the I/O pins for the speaker, you generate "white noise!" Through the 8-ohm speakers set up with the amplifier circuits as I explain here, the SX chip sounds like an Atari 2600 system. Green Phantom ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=302923 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)