+//! Set the baud rate.
+void setbaud(unsigned char rate){
+
+ //http://mspgcc.sourceforge.net/baudrate.html
+ switch(rate){
+ default:
+ case 0:
+ case 1://9600 baud
+ UBR00=0x00; UBR10=0x01; UMCTL0=0x00;
+ break;
+ case 2://19200 baud
+ UBR00=0x00; UBR10=0x02; UMCTL0=0x00;
+ break;
+ case 3://38400 baud
+ UBR00=0x40; UBR10=0x00; UMCTL0=0x00;
+ break;
+ //TODO
+ case 4://57600 baud
+ case 5://115200 baud
+ break;
+ }
+}