Hello,
I have a ARM Cortex M3 Board and connected the Module, but when I use this Code, I dont see the BT Device in my Windows.
What Iām doing wrong ???
void SetupBT (void)
{
/* USART2 Clock an*/
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);
/*Init USART2 USART2: CTS PA0, RTS PA1, TX PA2, RX PA3 */
/* Configure USART2 RTS and USART2 Tx as alternate function push-pull */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/* Configure USART2 CTS and USART2 Rx as input floating */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_3;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);
USART_InitStructure.USART_BaudRate = 115200;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_RTS_CTS;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_Init(USART2, &USART_InitStructure);
USART_Cmd(USART2, ENABLE);
/* Init BT */
Delay(200);
send_string("\r\n+STWMOD=0\r\n");
send_string("\r\n+STNA=IMU200\r\n");
send_string("\r\n+STAUTO=0\r\n");
send_string("\r\n+STOAUT=1\r\n");
send_string("\r\n +STPIN=0000\r\n");
Delay(200);
send_string("\r\n+INQ=1\r\n");
Delay(200);
}