Redefinable CALCB1_16MHZ.
[goodfet] / firmware / lib / msp430x1612.c
index e69d209..386119f 100644 (file)
@@ -6,7 +6,6 @@
 #include <io.h>
 #include <iomacros.h>
 
-
 //! Receive a byte.
 unsigned char serial_rx(){
   char c;
@@ -31,7 +30,6 @@ unsigned char serial1_rx(){
   return c;
 }
 
-
 //! Transmit a byte.
 void serial_tx(unsigned char x){
   while ((IFG1 & UTXIFG0) == 0); //loop until buffer is free
@@ -44,6 +42,14 @@ void serial1_tx(unsigned char x){
   TXBUF1 = x;
 }
 
+/** Later, add support for the EZ430/FETUIF with 12MHz crystal
+    UBR00=0xE2; UBR10=0x04; UMCTL0=0x00; // uart0 12000000Hz 9600bps
+    UBR00=0x71; UBR10=0x02; UMCTL0=0x00; // uart0 12000000Hz 19200bps
+    UBR00=0x38; UBR10=0x01; UMCTL0=0x55; // uart0 12000000Hz 38400bps
+    UBR00=0xD0; UBR10=0x00; UMCTL0=0x4A; // uart0 12000000Hz 57581bps
+    UBR00=0x68; UBR10=0x00; UMCTL0=0x04; // uart0 12000000Hz 115273bps
+ */
+
 //! Set the baud rate.
 void setbaud(unsigned char rate){
   
@@ -118,6 +124,24 @@ void msp430_init_uart(){
 }
 
 
+/** For EZ430/FETUIF
+ void msp430_init_dco() {
+  WDTCTL = WDTPW + WDTHOLD; //stop WDT
+
+  BCSCTL1 = 0;
+
+  do {
+    int i;
+    IFG1 &= ~OFIFG;
+    for (i=0; i<1000; i++);
+
+  } while (IFG1 & OFIFG);
+
+  BCSCTL2 = SELM1 | DIVM1 | SELS;
+
+}
+ */
+
 void msp430_init_dco() {
 /* This code taken from the FU Berlin sources and reformatted. */
   //