We introduce a lattice model of protein conformations which is able to reproduce second structures of proteins (alpha--helices and beta--sheets). This model is based on the following two main ideas. First, we model backbone parts of amino acid residues in a peptide chain by edges in the cubic lattice which are not parallel to the coordinate axes. Second, we describe possible contacts of amino acid residues using a discrete model of the Ramachandran plot. This model allows to describe hydrogen bonds between the residues in the backbone of the peptide chain. In particular the lattice secondary structures have the correct structure of hydrogen bonds. We also take into account the side chains of amino acid residues and their interaction. The expression for the energy of conformation of a lattice protein which contains contributions from hydrogen bonds in the backbone of the peptide chain and from interaction of the side chains is proposed. The lattice secondary structures are local minima of the introduced energy.