2013-11-14 05:55 AM
I plan to use an UART interface to communicate with my bluetooth module and I plan to wire the RTS, CTS, RX and TX pins to my uC, and until the components arrive, I would like to build some code to test it.
SPBT2632 Bluetooth datasheet mentions to leave unused pins not grounded, disconnected, my question is that if I wire the those four pins , will I still be able to communicate with my Bluetooth with an UART configured with hardware control = none, RTS and CTS wired but not functional? This is for testing purposes. I would also appreciate some directions regarding AT2 commands through an UART interface, from the information I have gathered I believe it should be something along these lines: For example, for AT2 command EnableBond: send_data(''AT+AB EnableBond''); Where send_data is a function which calls the USART_SendData() and checks the appropiate transmission flag. What troubles me is the correct syntax of the parameter I should give to send_data to make it recognizable for the Bluetooth as a AT2 command. Thanks in advance!2013-11-14 06:28 AM
void SendString(char *s)
{
while(*s)
{
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET); // Wait for Empty
USART_SendData(USART1, *s++);
}
}
SendString(''AT+CREG?
''); // Delimit command with CR/LF