I’m trying to interface the LCD development board for the MSP430F169 (http://www.sparkfun.com/commerce/produc … cts_id=772) with the BlueSMiRF bluetooth module. I’ve connected the two with the UART1 on the MPS430, and tried to send the BlueSMiRF into idle mode with the ATCLU\r command.
However, the BlueSMiRF doesn’t go into idle mode. I know that the UART is working, because I connected the RX and TX ports together and it receives fine. My code is below. I’m not sure what the problem is. Any help would be much appreciated.
Thanks!
unsigned char BTInit(void){
unsigned char *init = “ATUCL\r”;
// Pin configuration
P3DIR_bit.P3DIR_6 = 1; // Output (Transmit)
P3DIR_bit.P3DIR_7 = 0; // Input (Receive)
// Pin select
P3SEL_bit.P3SEL_6 = 1;
P3SEL_bit.P3SEL_7 = 1;
// UART init
U1CTL = SWRST + CHAR; // set SWRST and CHAR and clear everything else
ME2 |= UTXE1 | URXE1; // enable UART receive and transmit
U1RCTL = 0;
U1TCTL = 32; // use smclk
//IE2 |= UTXIE1 | URXIE1;
U1BR0 = 0x41; // 9600 baud, 8MHz clock
U1BR1 = 0x3;
U1CTL &= ~SWRST; // clear SWRST
// BT device init
while(*init){
while(!(IFG2 & UTXIFG1)); // wait for tx buffer to empty
U1TXBUF = *init;
init++;
// //Used to check TX RX on UART
// while(!(IFG2 & URXIFG1)); // wait for rx buf full
// LCDChrXY(0,0,U1RXBUF);
// LCDUpdate();
}
while(!(IFG2 & URXIFG1)); // wait for rx buf full
LCDChrXY(0,0,U1RXBUF);
LCDUpdate();
return 0;
}