EasyManua.ls Logo

Texas Instruments MSP430 User Manual

Texas Instruments MSP430
413 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #376 background imageLoading...
Page #376 background image
376
* UCSWRST -- Enabled. USCI logic held in reset state
*
* Note: ~<BIT> indicates that <BIT> has value zero
*/
UCA0CTL1 = UCSSEL_2 | UCSWRST;
/*
* Modulation Control Register
*
* UCBRF_0 -- First stage 0
* UCBRS_1 -- Second stage 1
* ~UCOS16 -- Disabled
*
* Note: ~UCOS16 indicates that UCOS16 has value zero
*/
UCA0MCTL = UCBRF_0 | UCBRS_1;
/* Baud rate control register 0 */
UCA0BR0 = 104;
/* Enable USCI */
UCA0CTL1 &= ~UCSWRST;
Right after initialization of all required hardware, the UART starts sending some strings.
UART_puts("\f");
UART_puts("MSP430G2553 UART Demo\n");
UART_puts("Shawon Shahryiar\n");
UART_puts("https://www.facebook.com/MicroArena\n");
The following functions transmit data via UART. The first one can transmit one character at a time
while the second can transmit a string of characters. In both cases, it is checked if the last character
has been successfully sent before sending a new character.
void UART_putc(char ch)
{
while(!(IFG2 & UCA0TXIFG));
UCA0TXBUF = ch;
}
void UART_puts(char *str)
{
while(*str != 0)
{
while(!(IFG2 & UCA0TXIFG));
UCA0TXBUF = *str++;
};
}
Since data recption interrupt is used, data received is extracted from UART reception ISR.
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR_HOOK(void)
{
rx = UCA0RXBUF;
}

Table of Contents

Other manuals for Texas Instruments MSP430

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
Program Memory TypeFlash
Clock SpeedUp to 25 MHz (depending on the specific device)
Flash MemoryUp to 512 KB (depending on the specific device)
RAMUp to 66 KB (depending on the specific device)
Operating Voltage1.8V - 3.6V (depending on the specific device)
ADC10-bit or 12-bit SAR ADC
Communication InterfacesUART, SPI, I2C, USB
DMAYes (depending on the specific device)
Operating Temperature-40°C to +85°C
Architecture16-bit RISC
Low Power ModesMultiple (LPM0 to LPM4)

Related product manuals