0

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!

4

1 回答 1

0

在发送 $$$ 序列之前和之后,我都在等待。前后必须有至少 250 毫秒的等待时间。如果违反,RN42 模块将不会进入命令模式。

于 2017-05-23T12:58:56.270 回答