  We show that, in general, averaging at simple resonances a real--analytic,
nearly--integrable Hamiltonian, one obtains a one--dimensional system with a
cosine--like potential; ``in general'' means for a generic class of holomorphic
perturbations and apart from a finite number of simple resonances with small
Fourier modes;
  ``cosine--like'' means that the potential depends only on the resonant angle,
with respect to which it is a Morse function with one maximum and one minimum.
\\ Furthermore, the (full) transformed Hamiltonian is the sum of an effective
one--dimen\-sio\-nal Hamiltonian (which is, in turn, the sum of the unperturbed
Hamiltonian plus the cosine--like potential) and a perturbation, which is
exponentially small with respect to the oscillation of the potential. \\ As a
corollary, under the above hypotheses, if the unperturbed Hamiltonian is also
strictly convex, the effective Hamiltonian at {\sl any simple resonance} (apart
a finite number of low--mode resonances) has the phase portrait of a pendulum.
\\ The results presented in this paper are an essential step in the proof (in
the ``mechanical'' case)
  of a conjecture by Arnold--Kozlov--Neishdadt (\cite[Remark~6.8, p.
285]{AKN}), claiming that the measure of the ``non--torus set'' in general
nearly--integrable Hamiltonian systems has the same
  size of the perturbation; compare \cite{BClin}, \cite{BC}.
