I have a square wave signals on these pins, PP0, PP1, PP2, PP3, PP4 and PP5. I want an interrupt on both edges. I do not want to count or time the edges. I want to mirror the signals onto pins PT0, PT1, PT2, PT3, PT4 and PT5.
I have tried to use ECT in Xgate, but the Interrupts do not work for me. I see there is a Port P Interrupt vector in XGate. Will this interrupt on all edges on all port P Pins.
Ray.
Hi Ray,
Thank you for let us know the root cause.
Best Regards,
RadekS
Hi Ray,
pin interrupt works always only for one type of edge, despite on fact whether this interrupt is handled by CPU or XGATE.
So, you could modify edge settings at every edge or externally route these signals to port T pins and use input capture feature for ECT.
Could you please share here your configuration of ECT and XGATE interrupt routines for a short check?
The typical issue in the case of multiple timer channels is flag clearing mechanism.
Please use “ECT_TFLG1 = 0x01;” or “ECT_TFLG1 = ECT_TFLG1_C0F_MASK;” instead “ECT_TFLG1_C0F=1;” command. The command “ECT_TFLG1_C0F=1;” is read/modify/write command which will clear all pending flags in this register.
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Ray,
I shortly looked at your code, and…:
Radek,
I have found the reason the ECT interrupts are not working. I should be using the TIM input capture. This interrupts on Port P pins and not the ECT input capture which uses Port T.
I will change the code so I am using the correct timer.
Ray.