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.

MSP430G2755: Correct D1 and D2 values to change BSL UART baud rate to 38400

Part Number: MSP430G2755

I'm writing an internal tool for reprogramming the MSP430G2755 on our device using BSL. I can do this but it takes quite a while at 9600 baud, so I'd like to increase the baud rate. The app note doesn't give a lot of background on what the D1 and D2 bytes need to be for this. I tried the values given as examples for other processors and they don't work for this one. Anyone accomplish this with this processor, or a similar one?

  • Hello,

    In Section 2.4.4.8 Change Baud Rate in the MSP430 Flash Device Bootloader (BSL) User's Guide, the parenthesis include certain bits that can be changed in various registers. For example, D1 can change the DCOx bits in the DCOCTL register shown in Section 5.3.1 of the MSP430x2xx Family User's Guide. D2 adjusts the XT2OFF and RSELx bits in the BCSCTL1 register. You'll need to adjust these to make sure the CPU frequency is higher than 4.2 MHz. You can figure out these settings using the datatsheet, user's guide and code examples. D3 controls the Flash controller speed for writing to Flash memory.

    Regards,

    James

  • I am currently sending {0x80, 0x20, 0x04, 0x04, 0x60, 0xFB, 0x02, 0x0, 0x19, 0x20} which should equate to a clock frequency of 4.25Mhz per the table on page 27 of SLAS800 (MSP430G2X55 datasheet). I am still receiving a NACK from the device. 

  • Hello,

    Before sending any command to the BSL, did you send the synchronization character (SYNC) with its value of 0x80 to the BSL?

    Also, I would change the D2 byte from 0xFB to 0x8B. This would change CKH from 0x20 to 0x50. The examples all show bytes that only configure certain bits in the respective register while keeping the other bits equal to 0, not 1.

    Regards,

    James

  • Yes, I precede every command with the synchronization byte and get the ACK before sending the command. This all works well with erasing and writing to the flash, the baud rate command is the only one giving me an issue. Changing from 0x20 to 0x50 (and updating the checksum) still results in a NACK.

  • I just updated my code to unlock the BSL before attempting to change the baud rate. This appears to have fixed resolved the issue. I hadn't done this sooner because the BSL document said it wasn't a password protected command. Whatever, at least it works now.

**Attention** This is a public forum