The knowledge of accurate stellar parameters is a keystone in several fields of stellar astrophysics, such as asteroseismology and stellar evolution. Although the fundamental parameters can be derived both from spectroscopy and multicolour photometry, the results obtained are sometimes affected by systematic uncertainties. In this paper, we present a self-consistent spectral analysis of the pulsating star RR Lyr, which is the primary target for our study of the Blazhko effect. We used high-resolution and high signal-to-noise ratio spectra to carry out a consistent parameter determination and abundance analysis for RR Lyr. We provide a detailed description of the methodology adopted to derive the fundamental parameters and the abundances. Stellar pulsation attains high amplitudes in RR Lyrae stars, and as a consequence the stellar parameters vary significantly over the pulsation cycle. The abundances of the star, however, are not expected to change. From a set of available high-resolution spectra of RR Lyr we selected the phase of maximum radius, at which the spectra are least disturbed by the pulsation. Using the abundances determined at this phase as a starting point, we expect to obtain a higher accuracy in the fundamental parameters determined at other phases. The set of fundamental parameters obtained in this work fits the observed spectrum accurately. Through the abundance analysis, we find clear indications for a depth-dependent microturbulent velocity, that we quantified. We confirm the importance of a consistent analysis of relevant spectroscopic features, application of advanced model atmospheres, and the use of up-to-date atomic line data for the determination of stellar parameters. These results are crucial for further studies, e.g., detailed theoretical modelling of the observed pulsations.