The problem of determining whether a set of periodic tasks can be assigned to a set of heterogeneous processors in such a way that all timing constraints are met has been shown, in general, to be NP-hard. This paper presents a modified algorithm based on the Particle Swarm Optimization (PSO) heuristic for solving this problem. The modified version is called Re-Excited PSO. Experimental results show that our approach outperform the major existing methods. In addition to being able to search for a feasible assignment solution, our PSO approach can further optimize the solution to reduce its energy consumption as well as to obtain good tradeoff between minimizing the design makespan as well as energy consumption.