# RN42 Bluetooth Module - Entering command mode from C code

I am using a PIC32MX795F12 microcontroller together with a RN42 bluetooth to UART module.

I can send text to the UART with no problem at 115200 baud. Using Putty I can also enter the command $$to enter the command mode and get the CMD response. Unfortunately I've not been able to enter the command mode using the C code. My command to do this is as follows: "UART3WriteString("$$$");" where the function is defined as: void UART3WriteString(const char * str) { while( *str ) { U3TXREG = *str++; while( U3STAbits.TRMT == 0 ); //wait for the transmission to be done) }  } When I do this, the RN42 does not go into the command mode. It just outputs $$without the CMD response. Any ideas? Thanks! • Maybe you need CR and/or LF too? Try UART3WriteString("$$$\r\n") – Roger Rowland May 22 '17 at 11:54
• I've tried that before. Actually in the putty as soon as you type the third '\$' the CMD response comes up. – Renato May 22 '17 at 11:56