Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
learn:programmable-logic:tutorials:auto-connect-2-bt2_s:start [2016/08/04 22:58] Mikel Skreenlearn:programmable-logic:tutorials:auto-connect-2-bt2_s:start [2016/08/04 23:57] (current) – [Instructions] Mikel Skreen
Line 20: Line 20:
 ==== Instructions ==== ==== Instructions ====
  
-The general setup just needs the user to be able to connect and enter setup mode on the BT2's therefore this tutorial can be performed either using a Bluetooth compatible PC with a terminal program or a Bluetooth compatible smartphone (non IOS) with a terminal app.+The general setup just needs the user to be able to connect and enter setup mode on the BT2's therefore this tutorial can be performed either using a Bluetooth compatible PC with a terminal program or a Bluetooth compatible smartphone (non IOS) with a terminal app. All commands used in this tutorial can be found in the [[http://ww1.microchip.com/downloads/en/DeviceDoc/bluetooth_cr_UG-v1.0r.pdf|RN42's reference manual]].
  
 === 1. Initial Setup === === 1. Initial Setup ===
Line 31: Line 31:
  
 === 3. Slave Configuration === === 3. Slave Configuration ===
->3.1) Connect to your designated slave BT2 with your preferred device and send the command "$$$" through the terminal. If receive "CMD" back from the BT2 and the BT2's green led will begin flashing more rapidly you know that you have successfully entered "Command Mode".+>3.1) Connect to your designated slave BT2 with your preferred device and send the command "$$$" through the terminal. If you receive "CMD" back from the BT2 and the BT2's green led begins flashing more rapidly you know that you have successfully entered "Command Mode".
  
 >3.2) Next enter "D<cr>" to display the BT2's basic settings and verify that "Mode =Slav". If the mode is set to anything other than the slave then set the mode to slave by entering the command "SM,0<cr>" >3.2) Next enter "D<cr>" to display the BT2's basic settings and verify that "Mode =Slav". If the mode is set to anything other than the slave then set the mode to slave by entering the command "SM,0<cr>"
Line 42: Line 42:
 >4.1) Next up is to configure your master device. Using the same process to enter command mode as you did to the slave enter command mode of the master BT2.  >4.1) Next up is to configure your master device. Using the same process to enter command mode as you did to the slave enter command mode of the master BT2. 
  
->4.2) Send the commands "SA,0<cr>" and "Sm,3<cr>". These commands will disable authentication and set the BT2 into "Auto-Connect" mode.+>4.2) Send the commands "SA,0<cr>" and "Sm,3<cr>" separately. These commands will disable authentication and set the BT2 into "Auto-Connect" mode.
  
->4.3) Check to make sure that the device is in auto connect code and has no authenticationSend "D<cr>" and verify "Mode =DTRand "Authen=0".+>4.3) Next you'll need to tell the BT2 module which device to connect toWith the slave BT2 powered on send the "I,10<cr>" command to discover all PmodBT2 devices within range and their addressees will be returned. The address is a 12-digit hexadecimal number. It can also be found on the Pmod BT2's label as the MAC ID. Once the slave's device address is known send the command "SR,<address><cr>in order to save it to memory. For example if the slave's address was 00066676ABCD you would enter "SR,00066676ABCD<cr>".
  
->4.4) Reboot the device using the "R,1<cr>" command.+>4.4) Check to make sure that the device is in auto connect code, has no authentication, and has stored the correct slave address. Send "D<cr>" and verify "Mode =DTR", "Authen=0" and that "REM=ADDR" where ADDR is the slave's address. 
 + 
 +>4.5) Reboot the device using the "R,1<cr>" command.
  
 === 5. Test! === === 5. Test! ===
-> 5.1) Connect the BT2's to a power source close enough that they are within range of each other and power them up at the same time (plugging them both into one of our Digilent boards is an easy way to do this). Within few seconds you should see the green lights turn off on both of the BT2's. This means that you have successfully configured your PmodBT2'to auto connect with each other!+> 5.1) Connect the BT2's to a power source close enough that they are within range of each other and power them up at the same time (plugging them both into one of Digilent'boards is an easy way to do this). Within few seconds you should see the green lights turn off on both of the BT2s. This means that you have successfully configured your PmodBT2s to auto connect with each other!
  
-{{tag> pmodbt2}}+{{tag>tutorial, pmodbt2}}