Different Serial ports problem

For Mega my program runs nicely but not on Uno and Micro.

The Micro and the Leonardo use Serial to talk to the PC, and Serial1 to talk to the RX and TX pins. The Mega and the Uno use Serial to talk to the PC and the RX and TX pins.

If your code works on the Mega but not the Uno, there is something wrong with your code.

Of course, we can't see what that is, because you didn't post it.