Im using msp430-rf2500-seh tool
Im trying to program an receive interrupt to get an integer from a anther board.
Here comes the problems:
-
If i wanna enable an interrupt, i need to use P3SEL=0x30 (To select UART port P3.5).
-
If i use P3SEL=0x30, End-device cant not transmit out. Everytime when i push the push button, the green led lights. But soon both leds light which means transmission failed.
I dunt understand why this simple interrupt can not be generated. Anybody can help me figure out what is gg on??? Tks in advance!
Plus, since im using the msp430rf2500 tool with solar panel, the P3.5 is reserved for detecting inner-battery flag. So Im juz diabling all the code related with inner-battery and fix a mode for msg locations.
Here is my code:
linkTo()
{
…
P3SEL = 0x3f; // If i put this one here, transmission will fail
BCSCTL1 = CALBC1_1MHZ; // Set DCO = 1MHz
DCOCTL = CALDCO_1MHZ;
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 0x68; // 1MHz 9600
UCA0BR1 = 0; // 1MHz 9600
UCA0MCTL = UCBRF_0 + UCBRS_1 ; // Modulation UCBRSx = 1
UCA0CTL1 &= ~UCSWRST; // Initialize USCI state machine
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
__enable_interrupt();
…
}
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
aNumber = UCA0RXBUF; // TX → RXed character
IE2&=~UCA0RXIE;
}