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.

msp430f149程序跑飞(怪怪怪问题)

Other Parts Discussed in Thread: MSP430F149

用msp430f149驱动OLED,当程序运行到某一个地方的时候就会跑飞,我跟踪发现会在Delay_Us(10);以后跑飞,我非常奇怪的是,我一步一步跟踪时就不出现了,但是全速跑的话肯定出现,而且,我在Delay_Us(10);后面随便添一条语句,或在这条之前随便加一条语句都不跑飞。

void WriteByte(U8 ch)
{
_NOP();
_NOP();
_NOP();
_NOP();
while(OLED_BUSY == BIT2);
_NOP();
_NOP();
_NOP();
_NOP();
CS_L;
_NOP();
_NOP();
_NOP();
_NOP();
for(b = 0;b < 8;b ++)
{
if((ch&0x80) == 0x80)
{
SDI_H;
}
else
{
SDI_L;
}
_NOP();
_NOP();
_NOP();
_NOP();
SCLK_L; //上升沿读取数据
Delay_Us(4);
SCLK_H;
ch <<= 1;
_NOP();
_NOP();
_NOP();
_NOP();
}
CS_H;
/* _NOP();
_NOP();
_NOP();
_NOP();*/
Delay_Us(10);
}