Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62446

Forum Post: RE: Reading Input pin and blinking LED

$
0
0
Hi Dennis Eichmann, First of all thank you for the help so far with the code and editing as well. I want to transmit HELLO to the hyperterminal using UART and below is the code for the same but the beow code does no display anything on the Hyperterminal. I am using MSP430F5528 for then same and the RX TX pins are connected at UCA1. What can be the reason for the same. #include "msp430.h" #include "msp430f5528.h" void UARTSendArray(char *TxArray, int ArrayLength); void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT P4DIR |= BIT7; // Set the LEDs on P4.7 as outputs P4OUT = BIT7; // Set P4.7 /* Configure hardware UART */ P4SEL = BIT4 + BIT5 ; // P1.1 = RXD, P1.2=TXD UCA1CTL1 |= UCSWRST; UCA1CTL1 |= 0X80; // Use SMCLK UCA1CTLW0 = 0X0080; UCA1BR0 = 0X6D; // Set baud rate to 9600 with 1MHz clock (Data Sheet 15.3.13) UCA1BR1 = 0; // Set baud rate to 9600 with 1MHz clock UCA1MCTL = 0X04; // Modulation UCBRSx = 1 UCA1CTL1 &= ~UCSWRST; // Initialize USCI state machine //IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt __bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled } void UARTSendArray(char *TxArray, int ArrayLength){ UARTSendArray("Hello", 5); while(ArrayLength--){ // Loop until StringLength == 0 and post decrement while(!(UCA1IFG & UCTXIFG)); // Wait for TX buffer to be ready for new data UCA1TXBUF = *TxArray++; //Write the character at the location specified by the pointer and post increment } } Thank you, Pratiksha Bhuta

Viewing all articles
Browse latest Browse all 62446

Trending Articles



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