MSP430G2553 serial communication sending and receiving

Publisher:吾道明亮Latest update time:2018-07-14 Source: eefocusKeywords:MSP430G2553 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Data sending code:

void UartPutchar(unsigned char c)
{
while(!(IFG2 & UCA0TXIFG)); //Waiting to be sent is empty
UCA0TXBUF=c;
IFG2 &=~UCA0RXIFG;
}


Just change the value of the buf variable


Receive data


#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
while (!(IFG2&UCA0TXIFG)); // Waiting for sending to be completed
//UCA0TXBUF = UCA0RXBUF; // TX -> RXed character
temp=UCA0RXBUF;
// In this way, the read data is put into temp, and then write the judgment program below to complete the serial port control

}



This is the receive and send function code. There are many articles about other interrupt settings.


Keywords:MSP430G2553 Reference address:MSP430G2553 serial communication sending and receiving

Previous article:msp430f149 communicates with mobile phone via Bluetooth HC-05
Next article:MSP430G2253 generates PWM with adjustable duty cycle

Popular Resources
Popular amplifiers
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号