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.
Hi All,
我使用MSP430G2452将USI配置为SPI进行单向通讯时,一旦发送数据第8位(bit 7)为1,即超过0x80时,SPI的MOSI端会出现下图红色框标注的波形,请问这样是正常的吗?
注:上图中发送的数据为0xA0
以下是我的配置文件。
USICTL0 |=USIPE6+USIPE5+USIMST+USIOE;
USICTL1 |=USICKPH+USIIE;
USICKCTL =USISSEL_2;
USICNT =8;
#pragma vector=USI_VECTOR
__interrupt void universal_serial_interface(void)
{
P2OUT |=(0x01<<LCD_CE);
}
void LCD_write_byte( unsigned char dat, unsigned char command)
{
P2OUT & = ~(0x01<<LCD_CE);
if(command ==0)
P2OUT & = ~(0x01<<LCD_DC);
else
P2OUT | = ~(0x01<<LCD_DC);
USISRL=dat;
USICNT=8;
USICTL0 &=~USISWRST;
}
你好,
理论上是不会有问题,因为只有在clk上升沿或者下降沿采用MOSI信号。
我怀疑你这个问题和你周边硬件电路有关。
你是不是在SPI上加了上拉电阻?
另外你的程序当中我没有看到你的SPI管脚的初始化。