X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=firmware%2Flib%2Fmsp430x2618.c;h=6e8675ea174ff0caa2b90dbdd76ad58a4e2a5674;hb=1f8e984b38e60a3b2aa0609864f05250cc8df673;hp=814c8ef7ffa458810305a3c00fd48698df685c37;hpb=08c1c58408da4d21b9060430ef4a9d402eb70dd0;p=goodfet diff --git a/firmware/lib/msp430x2618.c b/firmware/lib/msp430x2618.c index 814c8ef..6e8675e 100644 --- a/firmware/lib/msp430x2618.c +++ b/firmware/lib/msp430x2618.c @@ -126,6 +126,18 @@ void msp430_init_uart(){ //IE2 |= UCA0RXIE; } +/* Info Flash Values +CALDCO_16MHZ 0xdc CALBC1_16MHZ 0x8e 2274-000.txt +CALDCO_16MHZ 0x74 CALBC1_16MHZ 0x8f 2618-000.txt +CALDCO_16MHZ 0x6c CALBC1_16MHZ 0x8f 2618-001.txt +CALDCO_16MHZ 0x97 CALBC1_16MHZ 0x8f 2618-002.txt +CALDCO_16MHZ 0x6c CALBC1_16MHZ 0x8f 2618-003.txt +CALDCO_16MHZ 0x95 CALBC1_16MHZ 0x8f 2618-004.txt +CALDCO_16MHZ 0xcc CALBC1_16MHZ 0x8e 2618-005.txt +CALDCO_16MHZ 0x87 CALBC1_16MHZ 0x8f 2618-006.txt +CALDCO_16MHZ 0x96 CALBC1_16MHZ 0x8f 2619-001.txt +*/ + //! Initialize the MSP430 clock. void msp430_init_dco() { if(CALBC1_16MHZ!=0xFF){ @@ -138,8 +150,14 @@ void msp430_init_dco() { default: case 0x6ff2: //f26f, the MSP430F2618 DCOCTL = 0x00; - BCSCTL1 = 0x8f; //CALBC1_16MHZ at 0x10f9 - DCOCTL = 0x7f; //CALDCO_16MHZ at 0x10f8 + #ifndef DCOVAL + #define DCOVAL 0x8f + #endif + BCSCTL1 = DCOVAL; //CALBC1_16MHZ at 0x10f9 + /** Observed DCOCTL values: + 2618: 7f, 97 + */ + DCOCTL = 0x83; //CALDCO_16MHZ at 0x10f8 break; } }