In the classic method for calculation of energy-band structure of photonic crystal the electromagnetic field of wave that propagates in crystal is expanded in plane waves. The determination task of the allowed frequencies at certain wave vector in the first Brillouin zone leads to the finding of eigenvalues and eigenvectors of the corresponding matrix equation with dimension, which provides the necessary precision of determination of the allowed frequencies. Because of slow convergence of expansion in plane waves, it is necessary to solve the matrix equation of high dimension that requires considerable computation time. The proposed method of determination of the allowed frequencies is based on the coupled wave method (CWM) at the corresponding definition of boundary periodic conditions. Especially, this method is simple for 1D photonic crystals, that comes to the eigenvalue problem of the matrix equation of 2x2 dimension. For 2D photonic crystals the solution also leads to the eigenvalue problem, but of 2Nx2N matrix, where N is number of the coupled waves. Frequency will be allowed, if absolute value of eigenvalue is equal to one. In the proposed method the 2Nx2N dimension of the matrix equation is equivalent to the dimension of N2xN2 of classic method. The stable S-algorithm of computation is developed. The computations of energy-band structure of 1D and 2D photonic crystals of the simplest structure are conducted. The dependencies of computation precision on the number of coupled waves at change of N from 1 to 29 are obtained.