Hi,
The system is first msp430 transmits a data then in some distance receiver receives that and does the work accordingly then it transmits an acknowledge signal it received by the msp430 receiver and it glows a status led. The code is
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P4SEL = BIT4+BIT5; // P4.4,5 = USCI_A1 TXD/RXD
UCA1CTL1 |= UCSWRST; // **Put state machine in reset**
UCA1CTL1 |= UCSSEL_2; // SMCLK
UCA1BR0 = 6; // 1MHz 9600 (see User's Guide)
UCA1BR1 = 0; // 1MHz 9600
UCA1MCTL = UCBRS_0 + UCBRF_13 + UCOS16; // Modln UCBRSx=0, UCBRFx=0,
// over sampling
UCA1CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA1IE |= UCTXIE + UCRXIE; // Enable USCI_A0 RX interrupt
__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled
__no_operation(); // For debugger
}
// Echo back RXed character, confirm TX buffer is ready first
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCI_A1_VECTOR
__interrupt void USCI_A1_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCI_A1_VECTOR))) USCI_A1_ISR (void)
#else
#error Compiler not supported!
#endif
{
switch(UCA1IV)
{
case 0:break; // Vector 0 - no interrupt
case 2: // Vector 2 - RXIFG
P4DIR |= BIT7;
P4OUT ^= BIT7;
break;
case 4:
UCA1TXBUF = 19;
break; // Vector 4 - TXIFG
default: break;
}
}
In this first msp430 is transmitting and it is being received in other side and an acknowledge signal also coming from other side but msp430 is not receiving. Please help....