This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can T3IN (P3.6) be used as external interrupt pin in C16x?

Hello All,

I have a short question, since got confused with "User's Manual, V2.0, Jul-2000, CS167CS Derivatives".

I have to use either P3.6 or P3.7 as general purpose external interrupt input. As per pin T2IN, the manual clearly stated the pin can be used when "the associated auxiliary timer T2 in block GPT1 is configured for capture mode" - then vector T2INT may be used. From the other side, no direct statement can be found on using T3IN as an external interrupt. Can the MCU be configured in a way the P3.6 being used as an interrupt source triggered by an external events?

Thank you,
Nikolay.

  • If you have the choice, then use P3.7!

    You could use also P3.6, but I don't see much sense in doing so. You end up using both T3 and T2 or T4 for the interrupt. But if you insist, here is how you could do it:

    Use timer T2 or T4 in reload mode and T3 in counter mode. If T3 count direction is up, use reload value FFFF and if down then reload value 0000. Use the same value for the initial count of T3. Trigger T2/T4 reload with the output toggle flag of T3, both edges. Set T3 input edge selection corresponding to when you want the interrupt form pin P3.6 to occur. You can use either T3 or T2/T4 interrupt control register to request an interrupt.

    This was just for the sake of the exersice, you are welcome to test if it actually works!

    Sauli

  • Sauli,

    Thank you! Happily, I can use the single P3.7 pin to fulfil requirements I have. It is enough to use the T2 in capture mode, I just ignore (since not interested in) contents of the core T3 timer that is supposed to be used in this context. As well, I did test T3IN through T3 being programmed in counter mode a step before overflowing (with 0xFFFF), it works but of course consumes MCU resources as you mentioned.

    Best regards,
    Nikolay.