Frequency Synthesizer-Synth
steprog
Posts: 227
Hello
I was hoping to use the freq synth object to help me create 8 different frequencies coming out of 8 different cogs, but I found out that this object doesn't play nice being called again.· I tried calling it twice in cog 0 using different pins frequencies and different counters, but for some reason it wouldn't let me do it.· I also tried loading it into cognew with plenty of stack and it wouldn't do that either.· Is there some reason why freq synth object can only be used once?
Sorry for the newby question.
Thanks,
Greg
I was hoping to use the freq synth object to help me create 8 different frequencies coming out of 8 different cogs, but I found out that this object doesn't play nice being called again.· I tried calling it twice in cog 0 using different pins frequencies and different counters, but for some reason it wouldn't let me do it.· I also tried loading it into cognew with plenty of stack and it wouldn't do that either.· Is there some reason why freq synth object can only be used once?
Sorry for the newby question.
Thanks,
Greg
Comments
The easiest thing to do is to put a REPEAT at the end of Synth so that it never exits, then use COGNEW to call Synth (with an appropriate stack). Save the cog number returned from COGNEW so you can stop that cog later if you want to restart it with new parameters or just to stop it.
Thanks Mike
· I just realized that one condition doesn't quite jive with your explanation.· I ran a test to turn on Freq.synth for the A counter and a second instance for the B counter.· Different freqs and pin numbers.· For some reason, the first instance would start then turn off once the second instance started up.· I've been up all night, but I can't see why I can't turn on to instances in cog 0 like that.
In order to create 8 different frequencies, you only need 4 cogs (you could have 16 different frequencies)
The 'Synth' object is capable of generating 2 independent frequencies from Counter A and Counter B. Each instance of the 'Synth' object needs to be called as a separate COG. The Stack requirement of each 'Synth' object is about 25 longs, so 4 instances or 4 COGS would require a stack space of 100 longs.
Hope this helps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I will give it a shot.
Greg