This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

external interrupts on output signal

Other Parts Discussed in Thread: CC2510, CC2540

WE work with CC2510 and we saw that we receive an interrupt from external port (P0,P1,P2) even if we toggle an output pin while the input pin is not changing at all?

Did someone experienced such a problem? What can be done except from disable interrupts while toggling the output (like LED)

 

Thanks Rona

 

  • Interrupts are generated on any pins, regardless whether they are configured as input or output or as a peripheral function. For P1, you should mask out interrupts on all pins that are not wanted as an interrupt source. On P0 and P2, you have to be careful with the use of the other pins as those ports do not have individual interrupt enable bits. You can still check the interrupt flag register to see which pin generated the interrupt.

    For this reason, it is best to place external interrupt sources on port 1. This applies to CC251x, CC111x, and CC243x. CC253x and CC2540 have individual interrupt enables on all ports.

  •  

    Thanks,

    So, if I understood correctly, if P2_1 in an input and P2 interrupts are enables. P2_2 is an output. LED for example, every toggle on P2_2 will generate an interrupt?

    What is better, disable the interrupts before toggling the LED and then enable them back, after clearing interrupt flags, or just get the interrupt and process it?

    We have many outputs that can cause interrupts, on mixed ports, and I am afraid it will damage our performance.

     

    Rona

     

  • Rona Arlinsky said:
    So, if I understood correctly, if P2_1 in an input and P2 interrupts are enables. P2_2 is an output. LED for example, every toggle on P2_2 will generate an interrupt?

    Yes, this is correct for every toggle with the selected polarity (i.e. every 0->1 toggle if positive edge interrupts are selected).

    Rona Arlinsky said:
    What is better, disable the interrupts before toggling the LED and then enable them back, after clearing interrupt flags, or just get the interrupt and process it?

    I think disabling the interrupt and clearing it is probably more efficient. This adds only a few lines of code, and you avoid the branch to an interrupt. On GPIO output signals, this is quite easily done. On peripheral signals, either input or output, this gets more tricky, as you may get interrupts very frequently, and you may not know when it happens (especially for inputs). I hope you are able to isolate any such signals.

  • Thanks, you are very helpful

    We will try solving this issue somehow.

    What about toggling an input that its interrupt is disabled? We see that even we do not get an interrupt and do not perform the ISR it affects on our performance. It looks like after many toggling operations our chip q software halts or stay in sleep mode.

     

  • Rona Arlinsky said:
    What about toggling an input that its interrupt is disabled? We see that even we do not get an interrupt and do not perform the ISR it affects on our performance. It looks like after many toggling operations our chip q software halts or stay in sleep mode.

    This should not matter. As long as a pin interrupt is disabled, no interrupt is generated to the CPU, and it will not wake the chip from power modes. You will however see that the corresponding interrupt flag in the PxIFG register becomes set. I do not know what happens in this case, but I believe it is not caused by the CPU hardware. Could it be that you check even for disabled interrupt flags in your ISR?

    If this does not help with your last issue, we will need some more details in order to help you further (which pin, what are the register settings, what does the ISR look like, in what way is your performance affected).

  • just to update: we solved the problem according to the advice above, each output toggle we do the following: 1. disable IO interrupts 2. toggle the output 3. clear interrupt flags 4. enable the interrupts it is not a good behavior and we had problems with it but it is the only solution. the system is working for about a month now on more then 50 devices. a good advice is - do not design inputs and outputs on the same port if you need to put your device into sleep mode. on devices without sleep mode the problem does not occur.. Many Thanks to everyone who helped us!