I have annealed TiN on glass and silicon surface and after doing XRD, I came to know that both are having totally different pattern and AFM also gives non-synchronous results. What does it suggest?
From the question i believe that, you have annealed 2 samples; one TiN coated Si and other TiN coated glass.
Due to the different annealing and melting temperatures of Si and glass, the substrate will change its topographical structure, this affects the front layer of TiN's AFM image.
I don't know what annealing temperature you used but you could also have created interface layers of TiOx (with glass) and TiSi with Si. They can appear in XRD as non-expected peaks. If the anneal was done in air you also form TiOx on top of the TiN which will can effect the surface topology.
Any chemical change at the interface btw Si and TiN depends on anneling temperature... you have to exceed an effective activation energy that accounts for Ti-N bond breaking and Si-Ti bond formation, also taking into account Ti diffusivity into the Si crystal (hence annealing time). TiN is used as a barrier to hydrogenated species towards the underlying silicon, and just because TiN is strong enaugh to keep its chemical structure under annealing phases that may follow its deposition (say up to about 500 degC). So if you have annealed your sample to T higher than (say) 600 degC you might have promoted some chemical change at the interface and a reshaping of the surface microstructure at the same time. If you kept the annealing T at values lower than 500 degC changes in AFM (and possibly also in XRD pattern) may be due to local plastic deformations induced by mechanical stress of the TiN layer exerted on the Silicon substrate (remind that layer stresses the substrate with a force that increases on increasing the same TiN film thickness).
In the case of TiN on glass I can not say much, but I would care the TiN adhesion versus annealing parameters