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端口配置为低

Guru**** 2386610 points
Other Parts Discussed in Thread: MSP430G2553
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1069612/msp430g2553-the-serial-port-emulation-of-the-msp430g2553-of-the-proteus-shows-that-the-p1-port-is-configured-as-low

部件号:MSP430G2553

大家好,团队

客户提出的问题可能需要您的帮助:

使用蛋白质8.6模拟 msp430G2553的串行 UART 时,PI 端口都很低,下图显示了模拟示意图:

代码如下:

#include <MSP4C.h>


/**
*主要
*

#define ucharunsigned char
#define CPU_clock 1000000

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

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

使 SendData 无效(uchar 数据)

UCA0TXBUF =数据;
延迟_ms (1000);

P1OUT 和= 0xFE;

// TX -> RXed 字符
当(!(IFG2&UCA0TXIFG);// USI_A0 TX 缓冲器准备就绪时?

IF ((IFG2&UCA0TXIFG));

P2OUT = UCA0TXBUF;
}

延迟_ms (1000);
}

Int main (无效)

WDTCTL = WDTPW | WDTHOLD;//停止看门狗计时器

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);//将辅助时钟配置为 SMCLK

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

//启用 IO 端口  
P1SEL |= 0x06;
P1SEL2 |= 0x06;

UCA0CTL1 &=(~UCSWRST);

IE2 |= UCA0RXIE;

While (1)(同时)

P2OUT = 1;
P1OUT |= BIT0;

SendData (0x00);
延迟_ms (1000);

}

请参阅以下链接:

/cfs-file/__key/communityserver-discussions-components-files/150/ppp.zip

请帮您检查此案例? 谢谢。

此致,

樱桃