I have a motor/encoder which gives 466 pulses per revolution, going on average 30-60rpm, and I want to swap 2 digital io high/low each revolution. Currently the LJ is reading the pulse count using the high-speed counter and making the swap when the count >465 - but this means the LJ is having to read this input 466+Hz to be accurate. Its also doing a load of other things including streaming various inputs.
Is there a way to automatically trigger the digital IO on a certain count of the counter, or an easier way than above, without needing to read the count in?
I have an idea. Though it is untested. If the DIO_EF system is not being used then we can configure it to use an external clock. Provide the encoder signal as the external clock. Then use two DIO_EFs set to PWM with phase control to toggle at the desired time. I think the period will need to be 932 with the center toggle at 465.
Many thanks for the clever idea - I will try it asap and get back to you!