Building trajectories for biped robot walking is a complex task considering all degrees of freedom (DOFs) commonly bound within the mechanical structure. A typical problem for such robots is the instability produced by violent transitions between walking phases in particular when a swinging leg impacts the surface. Although extensive research on novel efficient walking algorithms has been conducted, falls commonly appear as the walking speed increases or as the terrain condition changes. This paper presents a polynomial trajectory generation algorithm (PTA) to implement the walking on biped robots following the cubic Hermitian polynomial interpolation between initial and final conditions. The proposed algorithm allows smooth transitions between walking phases, significantly reducing the possibility of falling. The algorithm has been successfully tested by generating walking trajectories under different terrain conditions on a biped robot of 10 DOFs. PTA has shown to be simple and suitable to generate real time walking trajectories, despite reduced computing resources of a commercial embedded microcontroller. Experimental evidence and comparisons to other state-of-the-art methods demonstrates a better performance of the proposed method in generating walking trajectories under different ground conditions.