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.

MSP430F2419 DCO accuracy for 9600 UART baud rate

I am writing a bootloader program that communicates to a PC using the MSP430 UART operating at 9600 baud.  Our hardware includes a 32KHz clock crystal which, in the main program, is used to calibrate the DCO at 2.4 MHz via a counter interrupt.  The DCO is then used to generate 9600 baud for general PC communication (not bootloading).  This works well.  However, I would like generate 9600 baud in the bootloader code without the need to calibrate the DCO.  I tried using the DCO correction factors from Information A and they worked for some units but not others.  I also tried generating 9600 baud using the 32 KHz clock crystal.  This is a pretty inaccurate baud rate that causes too many byte errors(???).
I would like to know if there is a way of generating an accurate 9600 baud that works on all of our units and does not require the DCO calibration interrupt that we use in our main program.  I am wondering what the BSL code does as, in my experience, the BSL seems to communicate with the PC well at 9600 baud.

-Tom-

  • All older MSP430 with a "ROM based BSL" use Timer-UART. (Some of the newer "Flash base BSL" use this scheme too.)

    This scheme requires that the PC to send a sync byte to MSP430 first. The MSP430 measures the number of (default) DCO clocks per bit of the received sync byte to determine how to send at 9600 bps. This scheme works very well -- independent of the DCO differences between different chip, the Vcc, and the temperature. And the code is very simple.

    If the PC mistakenly uses a higher or lower baudrate, the MSP430 will also mimic that and the BSL will still work. The only potential problem is, the MSP430, without knowing, may try to erase/rewrite Flash at a higher or lower speed -- which is not desirable. Make sure the PC is using 9600 bps!

     

**Attention** This is a public forum