Can you use waitcnt with the frequency synch object?
Dennis Ferron
Posts: 480
I'm using the "standard" frequency synth object from the object exchange to clock an A/D converter chip at 640 KHz. I need to wait 64 clock cycles for it to complete a conversion, and I'd like to be able to use waitcnt for that.
Can I drive the counter for waitcnt with a pin instead of the internal reference? And since the synth object itself uses a counter, is it conflicting with my existing counter? Or does the counter waitcnt uses already run at the same frequency as my synth object is outputting?
Can I drive the counter for waitcnt with a pin instead of the internal reference? And since the synth object itself uses a counter, is it conflicting with my existing counter? Or does the counter waitcnt uses already run at the same frequency as my synth object is outputting?
Comments
If you want to wait for 64 clock cycles of the 640khz clock then you should use a counter in edge detect mode (where phsA is incremented on each positive edge on a pin). You have two counters per cog, one does not effect the other and if your synth object is running in a different cog to the wait then you have two at your disposal.
Graham