Looking for some suggestions on generating tones with the SX chip. (1000Hz - 50
![RobotWorkshop](https://forums.parallax.com/uploads/userpics/915/nCTRZ4MIBWKDB.jpg)
I'm sure that I can come up with something to generate one specific frequency at a time but am not quite sure about how about generating multiple ones at the same time with the SX chip. It can probably all reside an an ISR Since I was probably going to use some sort of RC circuit on the output to soften it a bit I thought it might be better to use a separate pin for each output. At most there may be 4 tones at one time.
Has anyone used the SX like this?
Robert
Has anyone used the SX like this?
Robert
Comments
· Are you trying to create square-wave output or sine-wave outputs ?
· What resolution do you need ? 1Hz is going to be much more difficult.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·
I'm going to try just the square wave output first to see if that will work. I don't need to hit every frequency within that range. Just a few specific ones that I'd need to get close to. At the moment it looks like some would be around 1600Hz, 2000Hz, 2600Hz, 2800Hz, etc. I've got some experimenting to do and will probably need to break out the scope to determine some of the others.
My first thought was to do it in the ISR. With a single one it would just have a counter equal to half my target frequency. When ever the counter gets down to zero, toggle the output, and reload the counted. Ideally i'd like to have it based on an ISR rate that the background buffered Serial code can work with in case I want to use the serial port later. I'm just not quite sure what i'd do with more than one going.
It should be interesting to figure out.
Robert