Hello,
I am using two quadrature encoders via the hardware peripherals through the tremendous library by mjs513 on Github and I am having trouble figuring out where to start with a compare interrupt. I have pulled through the examples and the code and I can't find something analogous to what I need to do.
I am looking to create a precise pulse every X number of counts in the quadrature register. I know I have to set positionMatchMode = ENABLE and put the value of the target in positionCompareValue, but what after that?
Do I create a ISR() with the interrupt vector in it, clear the flags, and then return? From the chip manual, it looks like there is the ipi_int_comp core interrupt, but I am unclear how to use it. Or do you create a master ISR and test for flags? If so, how do I determine the flag for each encoder channel? And do I enable this with the enableInterrupts in the Quadencoder library?
So many questions!
I suppose it extends to a larger question of how to determine the way to attach interrupts to registers rather than pins.
Thank you in advance.
I am using two quadrature encoders via the hardware peripherals through the tremendous library by mjs513 on Github and I am having trouble figuring out where to start with a compare interrupt. I have pulled through the examples and the code and I can't find something analogous to what I need to do.
I am looking to create a precise pulse every X number of counts in the quadrature register. I know I have to set positionMatchMode = ENABLE and put the value of the target in positionCompareValue, but what after that?
Do I create a ISR() with the interrupt vector in it, clear the flags, and then return? From the chip manual, it looks like there is the ipi_int_comp core interrupt, but I am unclear how to use it. Or do you create a master ISR and test for flags? If so, how do I determine the flag for each encoder channel? And do I enable this with the enableInterrupts in the Quadencoder library?
So many questions!
I suppose it extends to a larger question of how to determine the way to attach interrupts to registers rather than pins.
Thank you in advance.