This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430G2553: proteus的msp430G2553的串口仿真出现P1 端口整体被配置为低电平

Part Number: MSP430G2553

各位大虾们:

                  你们好,个人在使用proteus8.6仿真msp430G2553的串口UART时,结果出现PI端口都为低电平,希望大家能够看一下,给点建议。(因疫情原因,购买的开发版不配送 ),下图为仿真的原理图;

代码:寄存器部分已经配置麻木了  参考他人代码也很难受

#include <msp430.h>


/**
* main.c
*/

#define uchar unsigned char
#define CPU_CLOCK 1000000

#define delay_us(us) __delay_cycles(CPU_CLOCK/1000000*(us))

#define delay_ms(ms) __delay_cycles(CPU_CLOCK/1000*(ms))

void SendData(uchar Data)
{

UCA0TXBUF = Data;
delay_ms(1000);

P1OUT &= 0XFE;

// TX -> RXed character
while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready?

if ((IFG2&UCA0TXIFG));
{
P2OUT = UCA0TXBUF ;
}

delay_ms(1000);
}

int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer

DCOCTL = CALDCO_1MHZ;
BCSCTL1 = CALBC1_1MHZ;

P2DIR |= BIT0;
P1DIR |= BIT0;

BCSCTL2 = 0;//SMCLK的时钟来源为DCOCTL 分频为1分频


//复位USCI_AX
UCA0CTL1 |= UCSWRST;

UCA0CTL0 =0;//USIC 选择USART

UCA0CTL1 = UCSSEL1+(UCSWRST); //配置为usic 时钟为 SMCLK

UCA0BR0 = 104;
UCA0BR1 = 0x00;
UCA0MCTL = 0X02;

//IO端口使能
P1SEL |= 0x06 ;
P1SEL2 |= 0x06;

UCA0CTL1 &= (~UCSWRST);

IE2 |= UCA0RXIE;

while(1)
{
P2OUT = 1 ;
P1OUT |= BIT0;

SendData(0x00);
delay_ms(1000);

}

最后在来个附件

}ppp.zip