I am using MSP430F6779 with TI-RTOS and CCS 6.0 compiler. I try to run baud rate 115200 or 9600 with MCLK 23986000, the closest one to 24Mhz. The problem I run into is that UART_open always return "Error opening the UART". If I trace the code using CCS debug, I find that driver implementation function findBaudDividerIndex which search the following table can not find any entry because cpuFreq is 819200. But I have already have the following line in my .cfg file. Can you help me how to set cpuFreq to other value so UART_open will not return any error?
Thanks.
BIOS.customCCOpts = "-vmspx --near_data=none --code_model=large --data_model=restricted -q --advice:power=1 --program_level_compile -g";
BIOS.cpuFreq.lo = 23986000;
const UARTEUSCIA_BaudrateConfig uartEUSCIABaudrates[] = {
/* baudrate, input clock, prescalar, UCBRFx, UCBRSx, oversampling */
{115200, 23986000, 13, 0, 0x21, 1},
{57600, 23986000, 26, 0, 0x55, 1},
{9600, 23986000, 156, 2, 0x6b, 1},
{9600, 32768, 3, 0, 3, 0},
};
//////////////////UARTEUSCIA.C////////////////////////////////////////////////////////
static int32_t findBaudDividerIndex(UARTEUSCIA_BaudrateConfig const *table,
uint32_t tableSize,
uint32_t baudrate,
uint32_t clockFreq)
{
int32_t index;
Assert_isTrue((tableSize != 0) && (table != NULL), NULL);
for (index = 0; index < tableSize; index++) {
if ((table[index].outputBaudrate == baudrate) &&
(table[index].inputClockFreq == clockFreq)) {
return (index);
}
}
return (-1);
}