A compact high-resolution system consisting of an echelle spectrometer combined with an acousto-optic tunable filter (AOTF) for separation of diffraction orders is developed for space-borne studies of planetary atmospheres in the near IR range. This design allows to achieve a resolving power, λ/Δλ, of 20000-30000 within the mass budget of less than 4-5 kg with no moving parts. Only a small part of spectrum in one of high diffraction orders can be measured at a time, but thanks to flexibility of the AOTF that can be tuned by electrical command to a random wavelength various pieces of spectrum can be measured anywhere within the spectral range. This development can be used for accurate measurements of important atmospheric gases, such as CO2 in terrestrial atmosphere, measurements of isotopic ratios and minor gases. An instrument based on this principle, has high potential for solar occultation sounding of the atmosphere of Venus and for the studies of the Earth, in particular for measurements of isotopes of water in the lower atmosphere, either in solar occultation profiling (tangent altitude <10 km), or observing solar glint for integral quantities of the components. Also, the atmosphere of Mars has never been observed at local scales with high spectral resolution. A functional laboratory model, consisting of 275-mm echelle spectrometer with Hamamatsu InGaAs 512-pixel linear array and AOTF, demonstrating the principle of the instrument, is discussed. The spectral range is 1-1.7 μm, and the resolving power obtained at 1.39 μm is λ/Δλ =30000. The next set up will cover the spectral range of 2.5-4.5 μm, which is more adequate for measurements of HDO and organic molecules.