Program freezes after a while

PeterH:
I thought you said you had solved the problem in the receiver. Is it the sender or receiver which is freezing now? Have you posted the current code for that? What hardware connections do you have to it?

Both are freezing when I am using some power supplies (although the receiver freezes more often). The code is probably irrelevant to the problem, but you can find the current code for the receiver at the first post.

The good news are that yesterday I used one of these regulator boards I have to power both the sender and the receiver board, and left RealTerm constantly sending a command to toggle an output. Right now is has sent the command 250.000 times and both the sender and the receiver board are still running.

So the problem probably was caused by the power supply, but I don't know exactly why. Even the power from the USB port of a macbook caused problems.