Hello everyone,
I get errors on every line. For e.g. Error[Pe020]: identifier "U0CTL" is undefined.
Why? Does FG4618 not support USART in UART mode? I did check up the product search.
Krishna.
_________________________________________________________________________________________________________________________
#include <stdint.h>
#include <intrinsics.h>
#include <msp430xG46x.h>
#define UART_BAUD 0x0068
#define MODULATION_VAL 0x08
void main(void)
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW | WDTHOLD;
U0CTL = CHAR | SWRST; //MM=0
U0TCTL |= SSEL0;
U0BR0 = UART_BAUD & 0xff; // Configure baud rate
U0BR1 = (UART_BAUD >> 8) & 0xff;
UMCTL0 = MODULATION_VAL; // Enable modulation
ME2 |= UTXE0 | URXE0; // Enable UART TXD/RXD
UCTL0 &= ~SWRST; // Release USART
IE2 |= URXIE0; // Enable USART RX interrupt
while(1)
{
while(!(URCTL0 & RXWAKE));
URXWIE = 0;
UTXIFG = 1;
UTCTL = TXWAKE;
U0TXBUF = data;
}
}
#pragma vector=USART0RX_VECTOR
__interrupt void UART0_recv_handler(void)
{
unsigned char rx_data;
// Read the UART receive buffer
rx_data = RXBUF0;
}
___________________________________________________________________________________________________________________________