Your code looks OK with the exception , I think, that it is PORTB.2 that goes to the MAX232.

If I am wrong on that try the Serial Communicator built into MCS.