we are trying to display data on hyper terminal using UART with baud rate of 115200 and SMCLK of 1048576.
we are not getting any display.
a warning compilation comes which is :
Warning[Pe069]: integer conversion resulted in truncation G:\iar_workspaceaug29\disp br.c 14
our code is shown below:
#include "msp430f5438A.h"
int main(void)
{
unsigned int count;
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
// initialize Timer_A module
TA1CCTL0 = CCIE; // CCR0 interrupt enabled
// TA1CCR0 = 32768;
TA1CCR0 = 1048576;
TA1CTL = TASSEL__SMCLK + MC__UP + TACLR; // ACLK, up mode, clear TAR
// initialize USCI module
P5SEL |= BIT6 + BIT7; // P5.6,7 = USCI_A1 TXD/RXD
UCA1CTL1 |= UCSWRST; // **Put state machine in reset**
UCA1CTL1 |= UCSSEL__SMCLK; //
UCA1BR0 = 9; // Baud rate divider with 1048576hz = 1048576/115200 = ~9.1 (009h|01h)
UCA1BR1 = 0; //
UCA1MCTL = UCBRS_1+UCBRF_0; //
UCA1CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
for(count='A' ; count<='Z' ; count++)
{
while(!(UCA1IFG&UCTXIFG));
UCA1TXBUF = count;
}
__bis_SR_register(LPM3_bits+GIE); // Enter LPM3, enable interrupts
}