chintan_gaurav8
Newbie level 2
Hi, I write following program for UART transmission for MSP430. but it shows me error at "UCTL0 &= ˜SWRST;" that is "unrecognized token". Is it need to define any other library?
Code:
#include "io430.h"
int main( void )
{
// Stop watchdog timer to prevent time out reset
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
P3SEL |= 0x30; // P3.4,5 = USART0 TXD/RXD
ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD
UCTL0 |= CHAR; // 8-bit character
UTCTL0 |= SSEL0; // UCLK = ACLK = 32.768kHz
UBR00 = 0x03; // 32.768kHz/9600 - 3.41
UBR10 = 0x00;
UMCTL0 = 0x4a; // Modulation
UCTL0 &= ˜SWRST; // Initialize USART state machine
IE1 |= URXIE0 + UTXIE0; // Enable USART0 RX/TX interrupt
return 0;
}