Two-dimensional model of diatomic crystal is proposed in the present work for the investigation of martensitic transformation under thermomechanical treatment, i.e. the proposed modell allows to simulate temperature effect as well as external loading, like tension, plastic deformation, ets. The model, based on the Morse potential, which are used for the simulation of the diatomic crystal of NiTi type, which is well known as an alloy with the martensitic transformation. This model allows one to define the main characteristics of different phases as the function of one of the potential parameter at 0 K. Potential parameters for the realization of forward and reverse martensitic transformation at finite temperatures are found by the careful checking of all the values. The appearance of one preferable martensite phase is shown despite there are two possible martensite phases. The appearance of the domain boundaries is shown for the martensite phase because of the realization of two opposite direction of martensite growth. The starting and finishing temperatures of the martensitic transformation are obtained. The effect of external stresses on the course of the martensitic transformation is investigated. The potential present in this work can be perspectively used for the investigation of such processes as phase hardening in diatomic crystals.