Set up a timer so it counts the cpu clock (divided down if necessary). One of the port pins will cause an interupt on change. On every interupt, copy the timer value into a ram location. If you want a delta time, then subtract the timer value on the previous edge from the present time. You can set it up to capture times between up-edges, down-edges, or each change regardless of direction, which would be more complicated. In the latter case, you might have to separate up-dn deltas from dn-up deltas by putting them in two lists. Since the timer value might have moduloed between two sucessive reads of the timer value, you might have to adjust for that.
Since there is not much ram, you might have to transmit the deltas off the chip using a comm channel rather than storing a long list.