The measurement of the surface topography in dynamic mode (intermittent contact mode) is one of the most popular ways of imaging surfaces at nanoscale with atomic force microscopy. It also allows obtaining so called phase images which reveal the viscous-elastic non-homogeneities of the surface, therefore can be used for detecting the presence of different materials. It is, however, very difficult to interpret the phase map due to the origin of phenomena, method of signal detection and processing. Therefore one cannot determine whether the observed feature is caused by increase or decrease of any of specific mechanical properties of the surface. In this article we present the modified setup of commercially available AFM, where detection of torsional oscillation of the cantilever is used for the determination of mechanical properties such as: elasticity, adhesion, peak force and energy dissipation. By advanced signal processing, the reconstruction of the force spectroscopy curve and the calculation of mentioned parameters are performed. All the operations are done in real time regime. The developed method allows one to obtain much more complex information about measured surface. Test measurement results are also presented.