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.

MSP430F249 PROBLEM

Other Parts Discussed in Thread: MSP430F249

DEAR TI EMPLOYER,

I AM DOING A PROJECT WITH MSP430F249. I HAVE A QUESTION ABOUT PROGRAMING CODE VIA BSL. WHEN I PROGRAM CODE FROM PC TO MSP430 VIA BSL. DO I NEED PROVIDE CRYTAL 32KHZ OR NOT?

THANK YOU SO MUCH!

EVERYONE CAN HELP ME

  • lau lau said:
    I AM DOING A PROJECT WITH MSP430F249. I HAVE A QUESTION ABOUT PROGRAMING CODE VIA BSL. WHEN I PROGRAM CODE FROM PC TO MSP430 VIA BSL. DO I NEED PROVIDE CRYTAL 32KHZ OR NOT?

    You don't need a 32kHz Crystal to use BSL on F1xx/F2xx/F4xx family devices. (though having one should not cause problems).

    However, you need to have a HF crystal on XT2 (i.e. 4MHz) in order to use the USB BSL from the F5xx/F6xx family with USB module support.

    Regards,

    Mo.

  • HELLO,

    IF I DON'T NEED CRYSTAL, HOW CAN I SET BAUDRATE VALUE TO ACTIVATE USART. I SHOW YOU A SEGMENT CODE IN BSL SOURCE:

    YOU LOOK AT IN THIS LINE BELOW:

    // THIS LINE SET UP BAURATE VALUE WITH LOW FREQUENCY.

    BR = CBR_9600;  BCSCTL1 = 0x88; DCOCTL = 0x80; break;

    MOREOVER, WHEN I PROGRAM A CODE BY USING BSLDEMO2.EXE

    THE ERROR IS "SYNCHRONAZATION FAILED DEVICE WITH BSL LOADER CONNECTED?"

    I DON'T KNOW WHAT ERROR IS?

    HERE IS THE CODE I PICK UP ON BSL SOURCE, YOU PAY ATTENTION ON HIGHLINE

    if (toDo.SpeedUp) // 0:9600, 1:19200, 2:38400 (3:56000 not applicable)
        {
        DWORD BR;                     // Baudrate
        if ((devTypeHi == 0xF1) || (devTypeHi == 0x12)) // F1232 / F1xx
            {
            BYTE BCSCTL1, DCOCTL;         // Basic Clock Module Registers
            switch (speed)                // for F148, F149, F169
                {                                                 //Rsel DCO
                case 0:  BR = CBR_9600;  BCSCTL1 = 0x85; DCOCTL = 0x80; break;// 5    4    
                case 1:  BR = CBR_19200; BCSCTL1 = 0x86; DCOCTL = 0xE0; break;// 6    7
                case 2:  BR = CBR_38400; BCSCTL1 = 0x87; DCOCTL = 0xE0; break;// 7    7
                default: BR = CBR_9600;  BCSCTL1 = 0x85; DCOCTL = 0x80; speed = 0;
                }
            _addr = (BCSCTL1 << 8) + DCOCTL;// D2, D1: values for CPU frequency
            }
        else if (devTypeHi == 0xF4)
            {
            BYTE SCFI0, SCFI1;            // FLL+ Registers
            switch (speed)                // for F448, F449
                {                                                 //NDCO FN_x
                case 0:  BR = CBR_9600;  SCFI1 = 0x98; SCFI0= 0x00; break;// 19    0    
                case 1:  BR = CBR_19200; SCFI1 = 0xB0; SCFI0= 0x00; break;// 22    0
                case 2:  BR = CBR_38400; SCFI1 = 0xC8; SCFI0= 0x00; break;// 25    0
                default: BR = CBR_9600;  SCFI1 = 0x98; SCFI0= 0x00; speed = 0;
                }
            _addr = (SCFI1 << 8) + SCFI0; // D2, D1: values for CPU frequency
            }
        else if (devTypeHi == 0xF2 || devTypeHi == 0x25)
            {
            BYTE BCSCTL1, DCOCTL;         // Basic Clock Module Registers
            switch (speed)                // for F2xx
                {                                                 //Rsel DCO
                case 0:  BR = CBR_9600;  BCSCTL1 = 0x88; DCOCTL = 0x80; break;// 5    4    
                case 1:  BR = CBR_19200; BCSCTL1 = 0x8B; DCOCTL = 0x80; break;// 6    7
                case 2:  BR = CBR_38400; BCSCTL1 = 0x8C; DCOCTL = 0x80; break;// 7    7
                default: BR = CBR_9600;  BCSCTL1 = 0x88; DCOCTL = 0x80; speed = 0;
                }
            _addr = (BCSCTL1 << 8) + DCOCTL;// D2, D1: values for CPU frequency
            }
        _len    = speed;                // D3: index for baudrate (speed)
        
        if (BR != comGetBaudrate())     // change only if not same speed
            {
            printf("Change Baudrate ");
            error= bslTxRx(BSL_SPEED,     // Command: Change Speed
                _addr,        // Mandatory code            
                _len,         // Mandatory code        
                NULL, blkin);
            
            if (error == ERR_NONE)
                {
                printf("from %d ", comGetBaudrate());
                comChangeBaudrate(BR);
                delay(10);
                printf("to %d Baud (Mode: %d)\n", comGetBaudrate(),speed);
                }
            else
                {
                printf("command not accepted. Baudrate remains at %d Baud\n", comGetBaudrate());
                }
            }
        }

  • The BSL inside MSP430F249 is in ROM. The source code is not published by TI and is probably in assembly. What you looked and quoted are not related to MSP430F249.

  • lau lau said:
    IF I DON'T NEED CRYSTAL, HOW CAN I SET BAUDRATE VALUE TO ACTIVATE USART.

    First, please stop shouting. It hurts my eyes :)

    You should take a look at the users guide. The clock system chapter tells you everythign you need to know to set the system clock from which the USART derives the baudrate. It also tells you how to program the USART in its USART section.

    IN addition to this, there should be demo code available fom the MSP40F249 product page, which demonstrates the usage of the USART.

  • I BUILT CODE TO BOARD.

    THANK YOU SO MUCH!

**Attention** This is a public forum