unsigned char MST_Data[4]={0x8B,0xFB,0x00,0x00}
unsigned char SLV_Data[4]={0x00,0x00,0x00,0x00};
volatile unsigned int i,j;
int main(void)
{
j = 0;
CSL_init();
P1OUT |= BIT5;
P1OUT &= ~BIT5;
__delay_cycles(75); // Wait for slave to initialize
UCA0TXBUF = MST_Data[j]; // Transmit first character
P1OUT |= BIT6;
__bis_SR_register(LPM0_bits + GIE);
}
void USCIA0RX_ISR(void)
{
P1OUT |= BIT0;
while (!(IFG2 & UCA0TXIFG)); // USCI_A0 TX buffer ready?
SLV_Data[j]=UCA0RXBUF;
j++;
if(4==j)
{
j=0;
}
UCA0TXBUF = MST_Data[j]; // Send next value
__delay_cycles(50); // Add time between transmissions to
}
void USCI_A0_init(void)
{
UCA0CTL0 = UCMSB + UCMST + UCMODE_2 + UCSYNC;
UCA0CTL1 = UCSSEL_2 + UCSWRST;
UCA0BR0 = 2;
UCA0CTL1 &= ~UCSWRST;
}
为什么红色标注的UCMODE_2(0x04,即4线制低有效)处改成UCMODE_0(0x00,即3线制)后,程序运行就可以进入中断(P1OUT |= BIT0;),否则就无法进入中断?
另外,程序是需要与ADS1118进行通讯的,哪位能帮我看看,程序是从CCS的例子改过来的。