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.

MSP430G2553: SEND AT COMMANDS WITH MSP430 TO CONFIGURE HC-05 BLUETOOTH MODULE

Part Number: MSP430G2553
Hi,
I am trying to configure HC-05 bluetooth module with MSP430G2553, i want to send AT command to change device name.But its not working.
I tested hardware connection that's fine.Also i tested the code with usb ttl and it has worked.

I am using IAR and the program is as below :

#include "io430.h" #define TXLED BIT0 #define RXLED BIT6 #define TXD BIT2 #define RXD BIT1 volatile unsigned int i; //Counter char string[]={"AT+NAME=ABC\r\n"}; void send_string(char string[]); void uart_init(void); int main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; DCOCTL = 0; // Select lowest DCOx and MODx settings BCSCTL1 = CALBC1_1MHZ; // Set DCO DCOCTL = CALDCO_1MHZ; uart_init(); __bis_SR_register(GIE); // Enter LPM0 w/ int until Byte RXed __delay_cycles(2000000); __delay_cycles(2000000); send_string(string); while(1) { } } #pragma vector=USCIAB0TX_VECTOR __interrupt void USCI0TX_ISR(void) { UCA0TXBUF = string[i++]; if(string[i]=='\n'){ UC0IE &= ~UCA0TXIE; //tx intrerrupt disabled } } #pragma vector=USCIAB0RX_VECTOR __interrupt void USCI0RX_ISR(void) { } void uart_init(void){ P1SEL |= RXD + TXD ; // P1.1 = RXD, P1.2=TXD P1SEL2 |= RXD + TXD ; // P1.1 = RXD, P1.2=TXD P1DIR |= RXLED + TXLED; P1OUT &= 0x00; UCA0CTL1 |= UCSWRST; UCA0CTL1 |= UCSSEL_2; // SMCLK UCA0BR0 = 26; //BAUD RATE 38400 UCA0BR1 = 0; //SMCLK/BAUDRATE=(UCAxBR0 + UCAxBR1 × 256) UCA0MCTL =0x00; //MODULATION VALUE = 0 FROM DATASHEET UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine** UC0IE |= UCA0RXIE; // Enable USCI_A0 RX interrupt } void send_string(char string[]){ i=0; UC0IE |= UCA0TXIE; //tx intrerrupt activated UCA0TXBUF = string[i]; }

Please help me and point out where I am going wrong. Thanks.

**Attention** This is a public forum