I'm working on a little project using micro controllers (PIC 16f84A) and got stuck at a point. I have 4 switches and those are the external interrupts now the idea is I don't understand how can I know which switch caused the interrupt to occur?
Say I have four switches SW1 , SW2 , SW3, SW4 now all those have a common external interrupt mode and flag RBIE and RBIF. If someone pushes the SW2 switch then I should do a function "2" how can I know that SW2 was the one pushes and not SW1 ?