Semi Markov model for market microstructure