I am using the PIC32MX795F512H device together with the RN42 bluetooth module both from Microchip.
I am noticing a weird behavior. From this C code snippet:
secs = G_CLOCK;
while(G_CLOCK-secs<300); // delay 300 ms
UART3WriteString("$$$");
secs = G_CLOCK;
while(G_CLOCK-secs<300); // delay 300 ms
UART3WriteString("gf\r\n");
secs = G_CLOCK;
while(G_CLOCK-secs<300); // delay 300 ms
strcpy(privData->btmac,result);
UART3WriteString("---\r\n");
secs = G_CLOCK;
while(G_CLOCK-secs<600); // delay 600 ms
UART3WriteString("Test 123\r\n");
UART3WriteString("Test 456\r\n");
UART3WriteString("Test 789\r\n");
UART3WriteString("Test abc\r\n");
Then I receive this ouptut:
Test 123
Test 456
Test 789
Test abc
CMD
50B7C3F7033A
END
The weird thing here is all the last 4 prints actually were outputted in the beginning. So what actually happened first? Was it the entering of command mode with the GF command? Or was it the 4 "Test xxxx" UART3WriteString commands?
Thanks