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.
Hi Team,
Can you please help us with our customer's inquiry below.
I have got the H3_EchoToHost working on www.ti.com/.../MSP-TS430PZ100USB launchpad using MSP430F5632 mc and I added function to communicate over uart on port 8 P8.3 and port 8.4. It works correctly at Baud rate 57600 before USB_setup but after this function it outputs data at baud 115200. have you seen this issue before?
Attach is code.
void main (void)
{
WDT_A_hold(WDT_A_BASE); // Stop watchdog timer
// Minimum Vcore setting required for the USB API is PMM_CORE_LEVEL_2 .
PMM_setVCore(PMM_CORE_LEVEL_2);
USBHAL_initPorts(); // Config GPIOS for low-power (output low)
USBHAL_initClocks(4000000); // Config clocks. MCLK=SMCLK=FLL=4MHz; ACLK=REFO=32kHz
uartOpen() ;
uartSend(myTest, 5); /**hello world sent at 57600 baud
USB_setup(TRUE, TRUE); // Init USB & events; if a host is present, connect
uartSend(myTest, 5); //Hello world sent at 115200 baud
}
Narrowed issued in USB_Init() after USB_XT2Freq = USB_determineXT2Freq()
He sent another email below.
Hello, I got it working by modifying function in usb.c.
uint16_t USB_determineXT2Freq(void)
//removed following from above function.
// Set SMCLK = DCO
// UCS_initClockSignal(
// UCS_SMCLK,
// UCS_DCOCLK_SELECT,
// UCS_CLOCK_DIVIDER_1);
because we are using SMCLK from external xtal not DCO.
Is this a bug in above function?
Regards,
Danilo
Hi Danilo,
If I'm understanding correctly the UART and USB were using the same CLK source, in the USB initialization it seems that the CLK rate was changed. Since the 2 peripherals were using the smclk the UART speed also got doubled. The UART baud rate is based off the registers and a specific clock frequency, if you want to source from the same clk you can calculate the baud rate settings that should be with the new clock speed.
You can configure the clock sources and SMCLK can be sourced from the external clock instead of DCO. I would suggest using either MCLK or ACLK, or you can source from SMCLK on both but set your baud rate on the UART with respect to the external clock frequency.
Screen shot from the device User's Guide
Regards.
Luke
**Attention** This is a public forum