AbstractShape Memory Alloy (SMA) Ni–Ti thin films have attracted much interest as functional and smart materials due to their unique properties. However, there are still important issues unresolved like formation of film texture and its control as well as substrate effects. In this study, near-equiatomic films were obtained by co-sputtering from Ni–Ti and Ti targets in a process chamber installed at a synchrotron radiation beamline. In-situ X-ray diffraction during the growth of these films allowed establishing a relationship between structure and deposition parameters. The effect of a TiN layer deposited on top of the SiO2/Si(1 0 0) substrate prior to the deposition of the Ni–Ti films was analysed. These experiments show that TiN acts not only as a diffusion barrier, but also induces different crystallographic orientations. A TiN layer with ≈215 nm thickness induces the preferential growth of (1 1 0) planes of the Ni–Ti B2 phase parallel to the substrate from the beginning of the deposition with a constant growth rate during the whole deposition. For a TiN thickness of ≈15 nm, the diffraction peak B2(1 1 0) also appears from the beginning of the deposition but much less intense. In this latter case, the B2(2 1 1) peak was also detected having observed a crossover from left angle bracket1 1 0right-pointing angle bracket oriented grains dominating at small thicknesses, to left angle bracket2 1 1right-pointing angle bracket oriented grains taking over at larger thicknesses. The same orientations and similar intensities were observed for a Ni–Ti film deposited on a TiN layer with ≈80 nm.