Supplier eBooks

Microchip - Concept to Creation

Issue link: https://resources.mouser.com/i/1442841

Contents of this Issue

Navigation

Page 16 of 31

17 / 2. Plug in the RN-4870-SNSR using the micro USB port on the board. 3. The driver will install automatically when plugged in. Update Firmware To use the RN4870 with CoolTerm, it's recommended that we update the firmware using the firmware update tool (Figure 5). Voila! The firmware is updated. Configure CoolTerm CoolTerm is a great debugging tool to use with the RN4870. Since the RN4870 uses an ASCII command interface, everything the module can do we can do through CoolTerm. Find Bluetooth Address Due to technical limitations in the project code, we need to change a hard-coded Bluetooth address in usart.h to our RN4870's address. To do this, we will need to first find its address: 1. Plug in the RN4870 (not in developer mode). 2. Click Connect. Sometimes in the console you will see a ӱ character appear. It doesn't mean anything; but is a useful, but not definitive, indicator that the connection succeeded. 1. On the keyboard, type "$$$" (the characters will not appear in the console). 2. When a command prompt appears, type "D" (capital) then hit enter. 3. The console will populate with the device information. The address should be the 12-digit hexadecimal number beside BTA. When we find the address, we need to write it down in usart.h as the BLE_DEVICE_ADDRESS definition. This definition has no functional use, but it will help us remember what band has what address. To be able to connect other bands, we need to write that band's address in the BLE_PARTNER_ADDRESS definition. We can use the same process to get its address. Hacking the MIKROE-2543 The MIKROE-2543 does not have the luxury of a micro USB port and will not work with CoolTerm nor the firmware update tool; but if you already have at least one RN-4870-SNSR, you can trick the MIKROE-2543 into working: 1. Remove all jumper connectors in the UART pin grouping (J3) on the RN-4870-SNSR. 2. The pins connected to the micro USB port are on the inside of the UART pin grouping. Holding the module face up, here are the pins from bottom to top: RX, TX, CTS, and RTS: • Connect the SNSR RX pin to the 2543 RX pin. • Connect the SNSR TX pin to the 2543 TX pin. • Connect the SNSR CTS pin to the 2543 RTS pin (if flow control is enabled). • Connect the SNSR RTS pin to the 2543 CTS pin (if flow control is enabled). 3. Plug in the RN-4870-SNSR. The MIKROE-2543 now works like the RN-4870-SNSR. Figure 5: This is the UI for the RN4870 Firmware Update Tool. (Source: Mouser Electronics)> " " ...a vibration motor alarm would go off, letting them know that they've gone too far.

Articles in this issue

view archives of Supplier eBooks - Microchip - Concept to Creation