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.

MSP430 port interrupt

Other Parts Discussed in Thread: MSP430F5419

Hi

I am using msp430f5419 and port1 interrupt for four switches.  When i press individual switches, no matter how fast i press interrupts are recorded properly.  But when i start pressing two switches both at the same time,  the data is getting recorded in only one switch some times ( the frequency is 4 out of 10 attempts).  Even though the two individual pulses are coming to individual pins of msp430, read value from the interrupt  register is the same.  can anybody please let me know what could be the possible error ASAP.

 

Thanks & Regards

Aloka Hegde

  • Will you please attach your circuit?

  • Hi Hardik,

    I have attached the snapshot of the schematic.  I have checked in the scope the two individual pulses are coming the properly in the port pins but the read register in the ISR will be having the same value when this error occurs.

  • Hi,

    Can you post your code that processes the inputs?

    Barry

  • Aloka Hegde1 said:
    But when i start pressing two switches both at the same time,  the data is getting recorded in only one switch some times ( the frequency is 4 out of 10 attempts).

    Likely, your ISR is clearing all ISR bits in the P1IFG register, not just the one that it has just worked on.

    It is recommended (if the MSP provides this) to use the P1IV register to read the number of the highest pending interrupt. Reading this register will also at the same time clear the IFG bit of this one and leave the rest.

    Keep in mind that interrupts are not latched. If an IFG bit is cleared before the ISR is launched, no interrupt will be triggered. So if you get two IFG bits and clear them both inside the ISR, the ISR won't be called a second time.

    Since you didn't post your code yet, this is of course rather a guess and not an analysis of what's going on.

**Attention** This is a public forum