We numerically demonstrate the existence of optical bistability in a finite-size nonlinear bidimensional photonic crystal doped by a microcavity. The numerical results are obtained by a rigorous theory of diffraction. We provide a theoretical model allowing to predict and explain the bistability phenomena from the resonances of the structure.