Part Number:MSP430FR2433
hi,
I'm using MSP-EXP430FR2433 to develop my FW, i found the system is not working if the Vdd is under 1.89V( I measure the Vdd PIN directly)
My MCLK is 1MHz, i try the 9600 baud UART, it only work after the Vdd is above 1.89V, my goal is using 1.80V Vdd,
is there anything wrong with my code:
below is my code:
intmain(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
// Configure GPIO
Init_GPIO();
Init_UART();
__bis_SR_register(GIE);
while (1)
{
xprintf("UART test\r\n");
}
}
voidInit_GPIO(void)
{
// Configure UART pins
P1SEL0 |= BIT4 | BIT5; // set 2-UART pin as second function
//P1.0 P1.1 P1.2 RGB LED output
P1DIR = 0x77; // 0:input 1:output =>P1.7 input UART CTS
P1REN = BIT5| BIT7; // pull-up register enable
P1OUT = 0x00 | BIT5| BIT7; // P1.5 P1.7 pulled-up //Input Configure 0b =pulled-dn , 1b = pulled-up //Output configure: 0b = Output is low.1b = Output is high.
P1IES |= BIT7; // P1.7 High to Low edge
P1IE |= BIT7; // P1.3 interrupt enabled
P2DIR = 0xF7; // 0:input 1:output =>P2.3 input (Button)
P2REN = BIT3; // pull-up register enable
P2OUT = 0x00| BIT3; //P2.3 pulled-up
P2IES |= BIT3 ; // P2.3 High to Low edge
P2IE |= BIT3 ; // P2.3 interrupt enabled
P3DIR = 0xFF;
P3REN = 0x00;
P3OUT = 0x00;
PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
P2IFG &= ~BIT3; // Clear P2.3 IFG //Button
P1IFG &= ~BIT7; // Clear P1.7 IFG //CTS
}
voidInit_UART(void)
{
// Configure UART
UCA0CTLW0 |= UCSWRST; // Put eUSCI in reset
UCA0CTLW0 |= UCSSEL__SMCLK;
//(See Table 21-5 in UG)
//115200 baud-rate
//BRCLK Baud Rate UCOS16 UCBRx UCBRFx UCBRSx
//1000000 115200 0 8 – 0xD6
//1. Calculate N = fBRCLK/Baud Rate [if N > 16 continue with step 3, otherwise with step 2]
//2. OS16 = 0, UCBRx = INT(N) [continue with step 4]
//3. OS16 = 1, UCBRx = INT(N/16), UCBRFx = INT([(N/16) – INT(N/16)] × 16)
//4. UCBRSx can be found by looking up the fractional part of N ( = N - INT(N) ) in Table 21-4
//UCAxMCTLW => Bit15-8 UCBRSx , Bit7-4 UCBRFx , Bit3-1 Reserved , Bit0 UCOS16
#if 0//1 // 115200 baud-rate TX Error= -7.36 ~ 5.6 % ; RX Error = -17.04 ~ 6.96 %
// Baud Rate calculation
UCA0BR0 = 8; // 1000000/115200 = 8.68
UCA0BR1 = 0;
UCA0MCTLW = 0xD600; // 1000000/115200 - INT(1000000/115200)=0.68
// UCBRSx value = 0xD6 (See UG)
#else // 9600 baud-rate TX Error = -0.48 ~ 0.64% ; RX Error = -1.04 ~ 1.04%
//BRCLK Baud Rate UCOS16 UCBRx UCBRFx UCBRSx
//1000000 9600 1 6 8 0x20
//UCAxMCTLW => Bit15-8 UCBRSx , Bit7-4 UCBRFx , Bit3-1 Reserved , Bit0 UCOS16
UCA0BR0 = 6;
UCA0BR1 = 0;
UCA0MCTLW = 0x2081;
#endif //baud-rate setting end
UCA0CTLW0 &= ~UCSWRST; // Initialize eUSCI
UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
}