For Multiple work, you can make Multiple interrupt (pin) on port c or d or b then ON INTERRUPT, you can do as you wish.

.