MOD5234 eTPU Quadrature encoder QD position counter interrup
Posted: Fri Jun 06, 2014 9:29 am
Hi,
I'm trying to get my encoder to generate an interrupt when it reaches a certain position.
I want to use
fs_etpu_qd_set_pc_interrupts(chan, pc1, pc2)
but I can't find good documentation on it, here or at Freescale.
I either get no interrupts, or one correct interrupt, then can't stop the interrupts.
My questions are:
1) Does it generate an interrupt when the pc gets to either pc1 OR pc2?
2) Does it have to hit exactly?
3) Does it know which way I intend to go, given where I am, so that is doesn't start interrupts immediately?
4) Or does it generate an interrupt when it is between pc1 and pc2?
or what?
I've tried using both
eTPUInterruptEnable(EncoderChannel);
eTPUInterruptDisable(EncoderChannel);
and
fs_etpu_qd_enable_pc_interrupts(EncoderChannel);
fs_etpu_qd_disable_pc_interrupts(EncoderChannel);
Do I need all of them, or only one pair, and if just one, which one?
Do I need to disable the interrupt in the ISR with one of the disable commands above? Or is there a better way to turn it on and off?
Thanks!
Sam
I'm trying to get my encoder to generate an interrupt when it reaches a certain position.
I want to use
fs_etpu_qd_set_pc_interrupts(chan, pc1, pc2)
but I can't find good documentation on it, here or at Freescale.
I either get no interrupts, or one correct interrupt, then can't stop the interrupts.
My questions are:
1) Does it generate an interrupt when the pc gets to either pc1 OR pc2?
2) Does it have to hit exactly?
3) Does it know which way I intend to go, given where I am, so that is doesn't start interrupts immediately?
4) Or does it generate an interrupt when it is between pc1 and pc2?
or what?
I've tried using both
eTPUInterruptEnable(EncoderChannel);
eTPUInterruptDisable(EncoderChannel);
and
fs_etpu_qd_enable_pc_interrupts(EncoderChannel);
fs_etpu_qd_disable_pc_interrupts(EncoderChannel);
Do I need all of them, or only one pair, and if just one, which one?
Do I need to disable the interrupt in the ISR with one of the disable commands above? Or is there a better way to turn it on and off?
Thanks!
Sam