Entering RN52 command mode from terminal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Entering RN52 command mode from terminal

Da Bear
This post was updated on .
For those of you who are like me - curious of what really happens inside the "magic module" ;)

This is what I have done to directly communicate with the RN52.

I made my own adapter to convert my FTDI to talk UART directly with the RN52. Only 5 cables if you keep it at a minimum.



Remove the ATmega from your board.
Connect 3.3v and GND from your FTDI cable to the FTDI connector on the BT module.
Connect RX and TX from you FTDI cable to the UART connector on the BT adapter

Solder a switch between GND and PIO9 of RN52 to switch between command mode and data mode. (Or just connect GDN and PIO9 for constant command mode, as I have done in the picture below).


Download CoolTerm from http://freeware.the-meiers.org/
Set up CoolTerm to COM*x / 115200-8-N-1 *x = your COM port for the FTDI adapter



Connect everything, start up CoolTerm and connect.
Flip your switch to pull PIO9 LOW (GND) and you should see 'CMD' in the console.
Now you can talk/play directly to the RN52



These are the response codes I have right now. Please feel free to correct and fill in missing codes

0001 - Disconnect from _any_ BT device
0002 - Not connected to any BT device
0003 - Initializing connection to stored BT device
0483 - Connecting to stored BT device
0403 - Connected to BT device / Not playing media
040D - Connected to BT device / Playing media

If you want you can keep the ATmega mounted, but you wont be able to (sorta) directly communicate with the RN52 unless you use Karlis code. (Correct me if I'm wrong here).

Good luck!!!
Saab 9-5 Aero MY01 AS3 - 270hp/240hp Biopower
Saab 9-5 SE    MY00 AS1 - 210hp+
Reply | Threaded
Open this post in threaded view
|

Re: Entering RN52 command mode from terminal

Seth
Administrator
That's awesome :)

Yes, you have to remove the 328 because the RX/TX lines that you use to talk to the RN52 are also used by the 328. So you can either use "test code", or upload blank code, or remove the 328, all in order to talk to the rn52.

Just be careful what settings to choose to play with...things might not work right after :)

Here is the Command Reference Guide from Microchip.

It's not 100% right, as Karlis has found out, and some things in there aren't very descriptive. But for each "S" command to set a value, you can also replace the "S" with a "G" to read back what the set value is. ie,
SK,04 will set the connection mask to A2DP.
GK will return what the K value is set to (default is FF).
NC, USA