Part Number:MSP430I2021
While troubleshooting a faulty UART communication on a board using the MSP430i2021 microcontroller, I found out the that fixed-frequency DCO on the MSP was actually running at about 11.86 MHz rather than at the datasheet specified 16.384 MHz. Any ideas what would cause this?
The UART code that I had been testing with was very basic (tried basic broadcast and echo programs). When using an oscilloscope to diagnose the issue, I could see that the UART waveform bits looked correct, and that altering the baudrate would scale the waveform appropriately, but the duration of each bit was slower than it should be. So then I set SMCLK = DCO (ie. divisor of 1) and output it on pin P1.1. After connecting the oscope there, I realized that the DCO was actually running at roughly 11.86 MHz (see oscope image below). Adjusting the registers to set the baud rate based on this clock frequency resulted in successful UART communication.
I am wondering what could have caused such a difference in the DCO. I am using the internal resistor mode for DCO, so I have tied ROSC to AVSS as per the datasheet recommendations. I know that there is a calibration register CSIRFCAL, so I'm wondering if this could be the cause of the slowed DCO. When debugging, I see that this register reads 0.. Is it necessary for me to perform some sort of frequency calibration? And if so, how do I go about doing this?
Please let me know what I could do to fix this. Thanks!