Hello again,

I am still having trouble with the serial communication portion of my
code.  
From reading previous posts I composed the code bellow, which seems to be
correct, but the msp430f149 seems to have some peculiarities, so I am not
completely sure.

The code will hang on the clock initialization on both insight/gdb and
just running the thing on it's own power...I am pretty much out of ideas.

Please point out anything that might be wrong with this thing.

Thank you in advance.

helio

--------
                                                                                
void setup (void)
{
    unsigned int i;
                                                                                
    //port/pin setup for the specialCOMM
    P3DIR |= BIT4;
    P3SEL |= BIT4;              // Select pins to alternate function
                                                                                
    //clock setup
    BCSCTL1 |= 0x04;            //enable xtl2
    _BIC_SR(OSCOFF);
    do
    {
        IFG1 &= ~OFIFG;
        for(i = 255; i > 0; i--) __asm__ __volatile__("; loop");
    }
    while ((OFIFG & IFG1) != 0);
    BCSCTL2 = 0x88;
                                                                                
    //INITIALIZE serial port 0
    UCTL0 = CHAR | SWRST;       // 8 bit chars - leave in reset mode
    UTCTL0 = 0x20;              // uclk = smclk
    UBR10 = 0x01;               // 3.6864MHz/9600bps = 384 = 0x180
    UBR00 = 0x80;
    UMCTL0 = 0x00;
    ME1 |= UTXE0;               // Enable Tx0
    UCTL0 = CHAR;               // 8 bit chars - take out of reset
                                                                                
    IE1 |= UTXIE0;              //enable Tx0 interrupt
                                                                                
    eint();
}



Reply via email to