This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem in serial Communication MSP430p149

Other Parts Discussed in Thread: MSP430F149

Hello

i am using MSP430-P149 MPS430F149 DEVELOPMENT BOARD for serial communication.

i am downloading following example code but serial port not working . i am just receiving 0 in hex 3 time on serial port


#include  <msp430x14x.h>          // Standard Equations
int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;             // Stop watchdog timer
  P6DIR |= 0x01;                        // Set P1.0 to output direction
        UCTL0 &= ~SWRST;          //reset SWRST bit
        UCTL0 |= CHAR;
        URCTL0 &= ~URXWIE;       
        UBR00 = 0x45;             //baud = BRCLK / (UBR + (M7 + .. + M0) / 8)
        UBR10 = 0x00;             //UBR = 69 + 4/8
        UMCTL0 = 0x00;            //baud = 8000000/69.5 = 115108
        UTCTL0 = SSEL1 + TXEPT;  
        ME1 |= UTXE0 + URXE0;   
     //   IE1 |= UTXIE0 + URXIE0;  

        P3SEL |= BIT5 + BIT4;     //Pin P3.4,P3.5used by USART module
  //      P3DIR |= BIT4;            //Pin P3.4 is output

TXBUF0 = 'A';
 

}



  • This cannot work.

    The MSP430F149, by default, runs on DCO with a frequency around 600-800kHz. The DCO can be brought to ~6MHz, yet the code assumes that ACLK is running with 8MHz. THis can only be achieved with an 8MHz crystal on XT1 and XT1 in HF mode. Or with an 8MHz square-wave TTL signal attached to XTIN. SSince there is no configuration of the clock system in your code, I assume that the latter was the case when this code was 'created'.

    However, the comments don't match the code. The comment is talking about 8MHz/69.5, yet the code doesn't program UMCTL0, so it's just 8MHz/69 = 115942bd. Well, it's only 0.6% above 115200, so it should work - if the 8MHz are there.

**Attention** This is a public forum