to detect the rising edge can be done by using external interrupt pin...
you can set it to positive(rising up) or negative(going down) triggering...