We examine a spatial evolution of lightwaves in a nonlinear photonic crystal with a quadratic nonlinearity when simultaneously a second harmonic and a sum-frequency generation are quasi-phase-matched. We find the conditions of a transition to Hamiltonian chaos for different amplitudes of lightwaves at the boundary of the crystal. PACS: 42.65.Sf,05.45.Ac,42.70.Mp,42.65.Ky Wave mixing in nonlinear optical materials is a basis of modern optical sciences and technologies. Cascading several wave-mixing processes in the same low-loss material one can in principle achieve a high efficiency using a large value of the lowest-order optical nonlinearity. The theoretical investigations of cascading of several scalar optical three-wave-mixing processes in the bulk materials with χ (2) nonlinearity has a long history [1]. In particular, Akhmanov and co-workers have found the efficiency of a third harmonic generation (THG) via cascading of a second harmonic generation (SHG) and a sum-frequency mixing (SFM) in a quadratic medium [2], while Komissarova and Sukhorukov have described an efficient parametric amplification at a high-frequency pump in the same system [3]. Obviously, the observation of these nonlinear effects demands a simultaneous satisfaction of phase-matching conditions for several parametric processes as perfectly as possible. On other hand, it has been shown later that the systems, for which several optical wave-mixing processes can be simultaneously phase-matched, are in general nonintegrable; therefore a competition of two (or more) parametric processes can often result in a chaotic spatial evolution of lightwaves [4,5]. However, until nowadays it was unclear how to achieve a phase-matching for several processes in homogeneous medium employing traditional techniques, such as using a birefringence in ferroelectric crystals.The solution of this problem has been found rather recently [6,7,8]; it consists in an introduction of the different types of artificial periodicity of a nonlinear medium resulting in a formation of nonlinear 1D and 2D superstructures termed optical superlattices [9] or nonlinear * E-mail: Kirill.Alekseev@oulu.fi photonic crystals (NPCs) [10]. In NPCs there is a periodic (or quasiperiodic) spatial variation of a nonlinear susceptibility tensor while a linear susceptibility tensor is constant.In these engineering nonlinear materials a phase mismatch between the interacting lightwaves could be compensated by the Bragg vector of NPC. The idea of such kind of quasi-phase-matching (QPM) was introduced by Bloembergen and co-workers many years ago [11]. However, only recently the rapid progress in a fabrication of high quality ferroelectric crystals with a periodic domain inversion made the QPM method very popular [9,12]. We should stress that the conditions for QPM may be fulfilled for several wave-mixing processes simultaneously; the QPM also has an advantage as using of largest nonlinear coefficient.Nowadays there are several experiments on an observation of third and fourth harmonics i...