Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 21954

UART configuration - No data showing up on terminal (Putty)

$
0
0

#include <msp430fr6989.h>

/*
* main.c
*/
const char string[5]={"Hello"};
int i;
void main(void) {

i=0;
WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
UCA0CTL1 = UCSWRST; // Reset UCA0 to be configured

P2SEL0 = 0x00;
P2SEL1 = BIT1+BIT0; // Select Module 2 on Pins 2.0 and 2.1
P2DIR = BIT0;
PM5CTL0 = 0x00; //Disables Ports LPM

/* Configure */
UCA0CTL1 |= UCSSEL_2; //SMCLK
UCA0BR0 = 104; // 1MHZ 9600
UCA0BR1 = 0; // 1MHZ 9600
UCA0MCTLW = UCBRS0; //Select Modulation = 1;

UCA0CTL1 &= ~UCSWRST; // Remove Reset

UCA0IE |= UCTXIE; //Enable Interrupts for Transmitter

__bis_SR_register(LPM0_bits+GIE);

}

#pragma vector=USCI_A0_VECTOR
__interrupt void USCI0TX_ISR(void) {
UCA0TXBUF=string[i++]; //Move character to Buffer as i increases
if (i == 5){ //if i =5 then repeat message
i=0;
}
}

this is my code, Im using code composer the program runs, but Im not getting any data on the terminal, Ive verified that I have the correct connection when trying to use putty to view the data, but nothing shows up, I dont know what it is, am I missing a configuration setting. According to the datasheet Pins 2.0 and 2.1 Module 2 has UART  but is not working, I could really use some help


Viewing all articles
Browse latest Browse all 21954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>