GS-BT2416C1.AT1 Bluetooth(R) class 1 module with embedded SPP SW Features Bluetooth(R) specification V.1.2 compliant Transmission rate up to 721 Kbps Output power class 1 (20 dBm max) Working distance up to 100 meters ACL and SCO links AFH interference resistance Supports USB (1.1) /UART/PCM (pulse code modulation)/SPI/ IC interfaces Optimized link manager and control Support wireless LAN coexistence in collocated scenario Integrated 4 Mbit Flash, 64 Kbytes RAM, 4 Kbytes ROM 3.3 V single supply voltage Hardware based UART flow control Applications Description Serial cable replacement Industrial control Laptops POS terminals Data acquisition equipment Internet access points Machine control Sensor monitoring Robotic and bionic control Security control Patient monitoring Audio gateway applications Hands-free sets Wireless printers Cordless terminals Laptops, PCs and accessories Hand held devices and accessories HID devices (keyboard, mouse, joystick, game controller...) u d o r P e t e l o s b O May 2008 o r P ST Bluetooth(R) modules are highly integrated for easy implementation in embedded applications. Class 1 modules enable wireless communication with other Bluetooth(R) enabled devices up to 100 m away. The GS-BT2416C1.AT1 integrates on a unique FR4 PCB support: BT 1.2 radio and baseband, memory, 32 kHz and 13 MHz oscillator, Vreg as well PA function. The module embeds a complete lower and upper Bluetooth(R) stack up to the application support layers including the generic port profile (GAP) and serial port profile (SPP), as well the AT command Interpreter. The antenna has not been included in order to grant a degree of freedom to the user in selecting the most suitable design and placement between external and integrated antenna that could be SMA aerial or a low cost antenna trace designed on PCB. For more details pleas refer to GS-BT2416C1DBAT1 application note. The GS-BT2416C1.AT1 is the SPP with AT command module of the GS-BT2416C1.xx series. GS-BT2416C1.AT1 is BQB pre-qualified. Conformance testing through Bluetooth(R) qualification program enables a fast time to market after system integration by ensuring a high degree of compliance and interoperability. e t le o s b O - ) s ( ct c u d ) s t( Rev 2 1/38 www.st.com 38 Contents GS-BT2416C1.AT1 Contents 1 Certifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 Maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3 2.1 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 Operating ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.1 4 DC I/O specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Bluetooth(R) section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.1 5 ) s t( RF performance characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 c u d 6 Integrate software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 o r P 5.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 5.2 Command interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 5.3 Usage scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 e t le o s b O - Application information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 6.1 Antenna reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 ) s ( ct 7 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 8 Pin settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 r P e 8.1 8.2 9 t e l o s b O 10 2/38 u d o Pin connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Soldering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Mechanical dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 GS-BT2416C1.AT1 Contents Appendix A AT command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 A.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 10.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 A.2 Modes of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 A.3 Interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 A.4 Bluetooth(R) features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 A.5 AT command reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 A.6 AT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 A.7 AT + BTCMODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 A.8 AT+BTDMODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 A.9 AT+BTPMODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 A.10 AT+BTSECMODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 A.11 AT+BTENCMODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 A.12 AT+BTPINCODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 A.13 AT+BTERASELK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 A.14 AT+BTNAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 A.15 AT+BTCLASS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 A.16 AT+BTSETTINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 A.17 AT+BTINQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 A.18 AT+BTRPORTS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 A.19 AT+BTREGPORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 A.20 AT+BTMACROSTART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 A.21 AT+BTMACROSTOP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e A.22 AT+BTMACROCLEAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 A.23 AT+BTCONNECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 s b O t e l o A.24 AT+BTDISCONNECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 A.25 AT+ECHO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 A.26 AT+UARTSETUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 A.27 AT+UARTSETUP=? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 A.28 AT+VER. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3/38 Contents GS-BT2416C1.AT1 Appendix B AT event reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 B.1 +BTSETTINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 10.2 +BTRPORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 B.2 +BTINQRES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 B.3 +UARTSETUP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 B.4 +VER. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 B.5 +READY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Appendix C Application examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 11 Ordering information scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 12 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 c u d e t le ) s ( ct u d o r P e t e l o s b O 4/38 o s b O - o r P ) s t( GS-BT2416C1.AT1 1 Certifications Certifications CE compliant (IMQ exp. opinion 0081-AREF00017) - Safety EN60950-1 (2001) - EMC EN301 489 17V1.2.1 - Radio ES 300 328 V1.6. - FCC certified on GS-BT2416C1DBAT1 (for a more exhaustive explanation, please refer to GS-BT2416C1DBAT1 application note) - FCC ID: S9NBT2416C1DB BQB compliant c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e t e l o s b O 5/38 Maximum ratings GS-BT2416C1.AT1 2 Maximum ratings 2.1 Absolute maximum ratings Absolute maximum ratings (see Table 1) indicate limits beyond which damage to the device may occur. Sustained exposure to these limits will adversely affect device reliability. Operating ranges (see Table 2) define the limits for functional operation and parametric characteristics of the module. Functionality outside these limits is not implied Table 1. Absolute maximum ratings Values Symbol Parameter Unit Min 2.2 VDD Module supply voltage VIN Input voltage on any digital pin Tstg Storage temperature Tsold Soldering temperature Symbol Parameter VDD Module supply voltage Tstg Operating ambient temperature t c u t e l o s b O (s) V Vss1-0.5 Vdd+0.3 -40 +85 c u d 240 e t le Operating ranges d o r P e 6/38 4 Operating ranges Table 2. Max so ) s t( b O - C o r P Values Conditions - 20 C < T < 70 C V Unit Min Typ Max 3.13 3.3 3.47 V +70 C -20 GS-BT2416C1.AT1 Electrical characteristics 3 Electrical characteristics 3.1 DC I/O specification Table 3. DC input / output specification Values Symbol Parameter Conditions Unit Min Low level input voltage 3.13 V < VDD < 3.47 V Vih High level input voltage 3.13 V < VDD < 3.47 V 2 V Vhyst Schmitt trigger hysteresis 3.13 V < VDD < 3.47 V 0.4 V Vol Low level output voltage Io load = pin drive capability Voh High level output voltage Io load = pin drive capability Table 4. Bluetooth(R) section Symbol Parameter ) s ( ct CHs Channel space Hop Hopping 13M CK s b O e t le o s b O - 0.15 VDD0.15 u d o V Values Unit Min Typ Max 1 MHz 1600 Hops/ sec 13 MHZ - 20 Low power clock Low power clock accuracy V ) s t( Conditions - 20 C to 70 C V o r P System clock System clock stability LP CK 0.8 c u d r P e t e l o Max Vil Bluetooth(R) section 4 Typ 20 kHz 32 - 200 ppm 200 ppm Tra Transmission rate asynchronous 721 kbits/ sec Trs Transmission rate synchronous 432 kbits/ sec Operation current TX mode 180 mA Operation RX mode 60 mA Iop 7/38 Bluetooth(R) section 4.1 GS-BT2416C1.AT1 RF performance characteristics In the performance characteristics table the following applies: Test condition: nominal - Voltage typical Vdd = 3.3 V - Temperature typical TA = 25 C Parameters are given at antenna pin Table 5. Transmitter and receiver performance characteristics Symbol TX Pout ACP RX sens Table 6. Parameter TX output power TX output spectrum adjacent channel power Receiver sensitivity Parameter RF in RF out Input and output frequency range TX out TX output spectrum at -20 dB Bandwidth lF -pn l t e l o 8/38 Typ Max Unit 2.402 GHz 18 20 dBm 2.441 GHz 18 20 dBm 2.480 GHz 18 20 dBm lM-Nl = 2 - 36 lM-Nl 3 - 44 @BER 0.1% - 84 c u d (t s) TX carrier frequency drift Min dBm Typ ) s t( dBm uc d o r P e let Conditions dBm Max Unit 2480 MHz 1000 kHz 75 kHz DH1 data packet 25 kHz DH3 data packet 40 kHz DH5 data packet 40 kHz Drift rate 20 Hz 2402 o s b O - TX initial carrier frequency tolerance o r P e lF/50sl Min Synthesizer performance characteristics Symbol F s b O Conditions - 75 920 GS-BT2416C1.AT1 5 Integrate software Integrate software The GS-BT2416C1.AT1 implements the following Bluetooth(R) protocols and profiles: L2CAP RFCOMM SDP Generic access profile (GAP) Serial port profile (SPP) Operated through AT command interpreter. Figure 1. AT1 software implementation AT command interpreter SPP Bluetooth Protocols and Profiles GAP RFCOMM L2CAP HCI FIRMWARE HCI Bottom Layer Hardware Layer 5.1 ) s ( ct Features c u d SDP LINK MANAGER e t le BASEBAND HW RF H W ) s t( o r P o s b O - The module with AT1 implements all Bluetooth(R) core protocols and serial port profile (SPP) to replicate UART traffic over a Bluetooth(R) link. 5.2 u d o r P e Command interface t e l o The module can be fully controlled using AT commands. The AT commands and few application examples are listed and commented in appendix A. s b O 5.3 Usage scenarios The module with AT command is dedicated to implement serial cable replacement. An automatic point to point connection takes place when modules are switched on. Modules are configured via macro instruction to play the role of master or slave. 9/38 Application information 6 GS-BT2416C1.AT1 Application information Here below there are some suggestions to better implement the module in the final application. Module is usually put on a motherboard, avoid that traces with switching signals are routed below the module. The best would be to have a ground plane underneath the module Connect the supply voltage ground of the module with the other grounds present on the motherboard in a star way. Keep the RF ground separate from the module supply voltage ground; the two grounds are already connected inside the module in one point, see below a possible implementation. Figure 2. Module foot print Supply voltage GND e t le ) s ( ct u d o r P e t e l o s b O 10/38 c u d RF gnd Module foot print o s b O - o r P ) s t( GS-BT2416C1.AT1 6.1 Application information Antenna reference RF output pin must be connected to an antenna which could be: Figure 3. Antenna directly printed on the PCB (Figure 3.) Integrated antenna as, for example, antenova(R) 30-30-A5839-01, Murata ANCV12G44SAA127, pulse W3008, Yageo CAN4311153002451K. (Figure 4.) External antenna connected by means a SMA connector (Figure 5.) Antenna on PCB Figure 4. Antenna examples SMA connector for external antenna c u d ) s t( o r P Despite of the type of antenna chosen, the connection between the RF out pin and the antenna must be executed in such a way that the connection trace must be matched to have characteristic impedance (Z0) of 50 to get the maximum power transfer. Matching for 50 is depending on the various factors, elements to be taken into consideration are: e t le o s b O - - Type of material, i.e. FR4 - The electrical characteristics of the material,i.e. the r, electric constant at 2.4 GHz - Mechanical dimensions of the PCB and traces, i.e. PCB thickness, trace/ reference ground thickness, trace width, trace thickness - Just to give an example, using a 1 mm thick FR4 board, with an r = 4.3 at 2.4 GHz, with Cu thickness of 41 m, the resulted width of 50 strip-line is 1.9 mm (Microstrip type calculation). ) s ( ct u d o r P e Figure 6. Parameters for trace matching t e l o Trace width s b O Figure 5. PCB thickness Trace thickness r (Dielectric constant) Reference ground Tools for calculating the characteristic impedance, based on the physical and mechanical characteristics of the PCB, can be easily found on the web. 11/38 Block diagram 7 GS-BT2416C1.AT1 Block diagram Figure 7. Block diagram RF antenna 32kHz XTAL UART 32kHz XTAL USB PCM PA SPI STLC2416 Baseband ARM7 proc IC GPIO STLC2150 Radio chip SW Filter LNA c u d e t le ) s ( ct u d o r P e t e l o s b O 12/38 o s b O - o r P ) s t( GS-BT2416C1.AT1 Pin settings 8 Pin settings 8.1 Pin connections Figure 8. Pin connection diagram c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e t e l o s b O 13/38 Pin settings GS-BT2416C1.AT1 8.2 Pin descriptions Table 7. Pin descriptions Pin N Name I/O Description Power, ground and system signal 1 Vss1 --- GND 2 Vdd --- Module supply voltage - single 3.3 V 41 1V8 O 1.8 V digital supply out (test purpose) to be left not connected 42 3V3 O 3.3 V I/O power supply out (test purpose) to be left not connected 43 Vss1 --- GND (test purpose) to be left not connected 44 2V7 O 2.7 digital core supply out (test purpose) to be left not connected 45 RESET I Reset pin (active low) 46 BOOT I External downloading enable (active low) internally pull-upped to 1.8 V by 10 k 13 LP CLOCK OUT O 32 kHz out 26 INT1 (1) External interrupt signal internally connected to VSS1 with 10 k / if not used connect to VSS1 c u d General purpose signals 3 GPIO0 (1) 4 GPIO1 I Bluetooth(R) link present 5 GPIO2 (1) General purpose I/O line 6 GPIO3 I 7 GPIO4 (1) General purpose I/O line GPIO5 (1) General purpose I/O line 10 GPIO7 (1) General purpose I/O line 11 GPIO8 (1) General purpose I/O line GPIO9 (1) General purpose I/O line GPIO11 (1) General purpose I/O line ---- (1) Not to be used internally used for RX/TX switch ---- (1) Not to be used internally used for TX gain setting ---- (1) Not to be used internally used for TX gain setting 17 ---- (1) Not to be used internally used for TX gain setting 18 ---- (1) Not to be used internally used for TX gain setting 8 12 14 General purpose I/O line e t le o s b O - Command/data mode input ) s ( ct u d o r P e No connect signals t e l o 9 bs 15 O 16 14/38 o r P ) s t( GS-BT2416C1.AT1 Table 7. Pin N Pin settings Pin descriptions (continued) Name I/O Description Test interface signals TDI (1) JTAG pin TDO (1) JTAG pin TMS (1) JTAG pin 22 NTRST (1) JTAG pin 23 TCK (1) JTAG pin If not used connect to VSS1 I2C_dat (1) I2C bus interface data to be connected to VDD with 10 k resistor I2C_clk (1) I2C bus interface clock to be connected to VDD with 10 k resistor PCM_SYNC (1) PCM 8 kHz synch PCM_CLK (1) PCM clock 29 PCM_A (1) PCM data in/out 30 PCM_B (1) PCM data in//out USB_DN (1) USB data - If not used connect to VSS1 USB_DP (1) USB data + If not used connect to VSS1 19 20 21 I2C interface signals 24 25 PCM interface signals 27 28 c u d USB interface signals 31 32 e t le UART interface signals ) s t( o r P o s b O - 33 UART2_RXD I UART2 data input If not used connect to VDD 34 UART2_TXD O UART2 data output 35 UART2_I1 I UART2 clear to send input If not used connect to VDD 36 UART2_02 O UART2 ready to send output UART10_TXD (1) UART1 data output UART11_RXD (1) UART1 data input If not used connect to VDD SPI_FRM (1) Synchronous serial interface frame synch SPI_CLK (1) Synchronous serial interface clock SPI_TXD (1) Synchronous serial interface transmit data SPI_RXD (1) Synchronous serial interface receive data if not used connect to VSS1 47 48 ) s ( ct u d o r P e SPI interface signals t e l o 37 bs 38 O 39 40 Antenna signals 49 Vss2 (RF GND) --- RF GND 50 +ANTENNA --- Antenna out 51 Vss2 (RF GND) --- RF GND 1. Not used with AT command 15/38 Soldering 9 GS-BT2416C1.AT1 Soldering Soldering phase has to be execute with care: in order to avoid undesired melting phenomenon, particular attention has to be take on the set up of the peak temperature. Here following some suggestions for the temperature profile based on IPC/JEDEC J-STD-020C, July 2004 recommendations. Table 8. Soldering Profile feature PB free assembly Average ramp up rate (TSMAX to TP) 3 C / sec max Preheat Temperature min (TS min) Temperature max (TS max) Time (tS min to tS max) (tS) 150 C 200 C 60 - 100 sec Time maintained above: Temperature TL Time tL 217 C 40 - 70 sec c u d Peak temperature (Tp) Time within 5 C of actual peak temperature (tP) 10 - 20 sec e t le Ramp down rate Time from 25 C to peak temperature Figure 9. Soldering ) s ( ct u d o r P e t e l o s b O 16/38 o r P 240 + 0 C o s b O - 6 C / sec 8 minutes max ) s t( GS-BT2416C1.AT1 10 Mechanical dimensions Mechanical dimensions In order to meet environmental requirements, ST offers these devices in ECOPACK(R) packages. These packages have a lead-free second level interconnect. The category of second level interconnect is marked on the package and on the inner box label, in compliance with JEDEC Standard JESD97. The maximum ratings related to soldering conditions are also marked on the inner box label. ECOPACK is an ST trademark. ECOPACK specifications are available at: www.st.com. Figure 10. Mechanical dimensions c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e t e l o s b O 17/38 Mechanical dimensions GS-BT2416C1.AT1 Figure 11. Land pattern and connection diagram c u d e t le ) s ( ct u d o r P e t e l o s b O 18/38 o s b O - o r P ) s t( GS-BT2416C1.AT1 Appendix A AT command AT command SPP embedded Bluetooth(R) firmware for STLC2416 based modules version 1.2.1.8 A.1 Introduction AT command interpreter OBSTFW-101 has been developed by Sycom on its proprietary Bluetooth(R) stack Following data are disclosed with Sycom permission and agreement. All these information are subject to usual ST reproduction and disclosure rules stated on the last page of the present document. 10.1 Description c u d ) s t( (R) Sycom firmware OBSTFW-101, from now on named .AT1, implements all Bluetooth core protocols and serial port profile (SPP) to replicate UART data traffic over a Bluetooth(R) link. The module can be fully controlled using AT commands. The throughput over-the-air is up to ~290 Kbps. A.2 e t le Modes of operation o r P o s b O - The module has two modes of operation: COMMAND MODE: this mode allows the module to accept AT commands from the UART. AT commands are used to control any property of the module (Bluetooth(R) name, visibility, etc.) as well as to trigger any operation (connection set-up, tear-down, discovery, etc.) DATA MODE: this mode allows the module to send and receive raw data over a Bluetooth(R) SPP link. When in DATA MODE each byte transmitted over the UART is replicated onto the existing Bluetooth(R) SPP link, and each byte received from the remote Bluetooth(R) device is replicated onto the UART port. DATA MODE should be activated only if a Bluetooth(R) link has already been setup using AT commands in COMMAND MODE. ) s ( ct u d o r P e t e l o To notice that there is not a default MODE, regardless connection status: this mean that the active MODE is always established by GPIO3 status. O bs The external MCU can switch the mode of operation of the module using GPIO3. Both when the module is turned on or it is switched from DATA MODE to COMMAND MODE a +READY event is generated. This event informs the external MCU that the module is ready to accept AT commands. Before the +READY event is generated, no AT commands can be issued to the module. 19/38 AT command GS-BT2416C1.AT1 Moreover it is possible to store a startup commands sequence directly into flash memory. The sequence can be long up to 512bytes. If a macro sequence is present, in startup phase, some OK events are generated, one for every command of the sequence, before the +READY event. This behavior can be avoided setting a AT+ECHO = OFF command starting the macro (avoiding the +READY too). The sequence execution is stoppable changing the state of GPIO3 in startup phase. A.3 Interfaces The module must be controlled by an external MCU using the UART and 2 GPIOs. UART: used to control the module with AT commands (COMMAND MODE), or send/receive serial data to be transmitted over the SPP Bluetooth(R) link (DATA MODE). The first time that the module is powered up, the default UART settings are as following (saved in flash memory): Baud rate: (bps) 9600 c u d Data bits: 8 Parity: None Stop bits: 1 Flow control: None e t le ) s t( o r P When these settings are changed by the AT+UARTSETUP command, they are stored in the flash memory to be reloaded when the module is powered up the next time. o s b O - GPIO1: configured as output. GPIO1 is high when an SPP Bluetooth(R) link to a remote device is present. GPIO1 is low when no Bluetooth(R) link is present. GPIO3: configured as input. If GPIO3 is set to high the module switches its mode of operation to DATA MODE. ) s ( ct If GPIO3 is set to low, the module switches its mode of operation to COMMAND MODE. u d o r P e t e l o s b O 20/38 GS-BT2416C1.AT1 AT command Bluetooth(R) features A.4 .AT1 implements the following Bluetooth(R) protocols and profiles: L2CAP RFCOMM SDP Generic access profile (GAP) Serial port profile (SPP) The embedded SPP can be used in two modes: SERVER MODE: This mode allows the module to be connected by other devices. In this configuration the local module does not initiate a Bluetooth(R) SPP connection, but simply exposes an SPP service that can be connected by other devices. In order to expose an SPP service the AT+BTREGPORT must be used. CLIENT MODE: This mode is used to initiate an SPP connection to an SPP service exposed by a remote Bluetooth(R) device. To set-up an SPP Bluetooth(R) link the AT+BTCONNECT must be used. c u d ) s t( o r P The two modes of operation are fully interoperable and the same module can be configured simultaneously both as a CLIENT and SERVER device. The module only allows a single Bluetooth(R) SPP connection to exist at the same time. e t le When an active connection is present (GPIO1 high) the module is set as "Non-Connectable" and "Non-Discoverable", to reduce affection of inquiry scan or connection establishment attempt. o s b O - When no more connection is active the module reset its modes to those previously stored by "+BTCMODE" and "+BTDMODE" commands. ) s ( ct u d o r P e t e l o s b O 21/38 AT command A.5 GS-BT2416C1.AT1 AT command reference AT commands are used to configure the module and trigger operations. AT commands are transmitted over the UART channel from the external MCU to the Bluetooth(R) module. AT commands have the following syntax: AT + CMD = parameter0, parameter1, ...\0x0D\0x0A AT + CMD\0x0D\0x0A Each line must be always terminated by the 0x0D 0x0A characters and only a single command per line is allowed. The response to an AT command can be OK if the command was successfully executed, or ERROR if an error occurred and has the following syntax: \0x0D\0x0AOK\0x0D\0x0A \0x0D\0x0AERROR\0x0D\0x0A c u d ) s t( o r P Some AT commands can generate events. Events are always reported as follows: e t le \0x0D\0x0A+EVENT: parameter0, ...\0x0D\0x0A o s b O - Each event is always bounded by the characters 0x0D 0x0A and can have zero or more parameters. The command syntax is case insensitive. A.6 ) s ( ct AT Test the UART communication channel to the Bluetooth(R) module u d o Syntax: AT r P e Return value: OK t e l o s b O 22/38 GS-BT2416C1.AT1 A.7 AT command AT + BTCMODE Indicate if the module can be contacted by other Bluetooth(R) devices. This command does not register any SPP service. Syntax: AT+BTCMODE=<0,1> Parameters: 0: The module cannot be contacted by other Bluetooth(R) devices (default) 1: The module can be contacted by other Bluetooth(R) devices Return value: A.8 AT+BTDMODE ) s t( Indicate if the module can be discovered when an inquiry procedure is performed by other Bluetooth(R) devices. c u d Syntax: AT+BTDMODE=<0,1> e t le Parameters: o r P o s b O - 0: The module cannot be discovered by other Bluetooth(R) devices (default) 1: The module can be discovered by other Bluetooth(R) devices Return value: Parameters 0: The module does not accept pairing requests from a remote Bluetooth(R) device (default) 1: The module accepts pairing requests coming from a remote Bluetooth(R) device Return value: A.10 AT+BTSECMODE Indicate if the module requests the authentication upon the setup of a Bluetooth(R) SPP link. An authentication request translates into a pairing request if two devices have never been paired before. Syntax: AT+BTSECMODE=<0,1> c u d Parameters: 0: The module does not request authentication e t le 1: The module requests authentication Return value: A.11 AT+BTENCMODE ) s ( ct o s b O - ) s t( o r P Indicate if the module requests an encrypted link upon the setup of a Bluetooth(R) SPP link. u d o Syntax: AT+BTENCMODE=<0,1> r P e Parameters: t e l o s b O 24/38 0: The module does not request encryption 1: The module requests encryption Return value: GS-BT2416C1.AT1 A.12 AT command AT+BTPINCODE Set the pin code of the local module. The module's pin code is used during a pairing procedure. In order to be successful, the module's pin code and the connection pin code specified during a connection set-up must be identical. See AT+BTCONNECT for more information. Syntax: AT+BTPINCODE="Pincode" Parameters: Pincode: 4 to 16-byte string representing the module's pin code Return value: A.13 AT+BTERASELK c u d ) s t( Erase all link-keys. When all link-keys are erased the module is unpaired from all previously paired devices. Syntax: AT+BTERASELK e t le Return value: A.14 AT+BTNAME ) s ( ct o r P o s b O - Set the local Bluetooth(R) name. This name is the string shown to all other Bluetooth(R) devices. u d o Syntax: AT+BTNAME="DeviceName" r P e Parameters: s b O t e l o DeviceName: A string representing the name of the local device. This string can be long up to 128 characters. Return value: 25/38 AT command A.15 GS-BT2416C1.AT1 AT+BTCLASS Set the local Bluetooth(R) Class ID. The Class ID is a 24-bit integer value identifying the type of device (PC, PDA, Headset, etc.) Syntax: AT+BTCLASS=DeviceClass Parameters: DeviceClass: 24-bit integer value indicating the local device class. This value is interpreted as an unsigned hexadecimal 24-bit value Return value: A.16 AT+BTSETTINGS ) s t( Requests the current module settings. The command generates a +BTSETTINGS event. c u d Syntax: AT+BTSETTINGS=? Return value: +BTSETTINGS, A.17 e t le AT+BTINQ o r P o s b O - Start an inquiry procedure. The inquiry process allows discovering the list of nearby Bluetooth(R) devices. For each device that is found in range a +BTINQRES event is generated. ) s ( ct Syntax: AT+BTINQ=InqDuration u d o Parameters: r P e InqDuration: Duration in seconds of theinquiry process t e l o s b O A.18 26/38 Return value: [+BTINQRES], AT+BTRPORTS Query a remote device for SPP services. This command instructs the module to connect to a remote device and query its SDP (Service Discovery Protocol) Server in order to find SPP services. For each SPP service found a +BTRPORT event is generated. GS-BT2416C1.AT1 AT command Syntax: AT+BTRPORTS=BdAddress Parameters: BdAddress: Bluetooth(R) address of the remote device. This value is specified as a 6-byte hexadecimal value: i.e. AT+BTRPORTS=00230A01F0A5 Return value: [+BTRPORT], A.19 AT+BTREGPORT Register a local SPP service that can be opened by other remote Bluetooth(R) devices. Syntax: AT+BTREGPORT="PortName" c u d Parameters: ) s t( o r P PortName: A string representing the name of the local SPP port. This name appears to remote devices when browsing local services. This string can be long up to 128 characters. o s b O - Return value: A.20 AT+BTMACROSTART ) s ( ct e t le Set the device in a programmable way. Every AT command coming after, with own parameters, will not be executed but will be stored in the very insertion order. u d o This command will be available only if the device is set to COMMAND MODE. To notice that starting a macro storing sequence will erase any previous present sequence. r P e t e l o Syntax: AT+BTMACROSTART Return value: s b O 27/38 AT command A.21 GS-BT2416C1.AT1 AT+BTMACROSTOP Stop the programmable status and store the commands sequence inserted so far into the flash memory of the module. If the sequence is larger then memory block available an error will be raised. The command will be available only if a device is set to COMMAND MODE and only if it come after an AT+BTMACROSTART command. Due to internal time needed to write a flash memory area a little time delay is possible before any return value. Syntax: AT+BTMACROSTOP Return value: A.22 AT+BTMACROCLEAR ) s t( Erase any possible commands sequence present into the flash memory. This operation is non-reversible. c u d Syntax: AT+BTMACROCLEAR Return value: A.23 AT+BTCONNECT e t le o r P o s b O - Initiate an SPP connection to a remote Bluetooth(R) device. When the connection has been successfully established the command returns an OK message and GPIO1 is set to high. ) s ( ct It is possible to specify a number of attempts and a time interval between any retry. It also possible to stop a sequence of connections retry changing the state of GPIO3 (as with the startup Macro). u d o Note: When connected with another device the module become "Non-Connectable" and "NonDiscoverable". r P e t e l o s b O 28/38 GS-BT2416C1.AT1 AT command Syntax: AT+BTCONNECT=BdAddress,PortN, "PinCode",NRetry, TimeRetry Parameters: BdAddress: Bluetooth(R) address of the remote device. This value is specified as a 6-byte hexadecimal value: i.e. AT+BTCONNECT=00230A01F0A5 PortN: Port number of the remote SPP port. A value of "0" force the device to query the remote device for a SPP service port and to get the first valid port; this behavior is useful for programmed automatic recursive connect. PinCode: 4 to 16-byte string representing the connection pin code NRetry: number of possible attempts if the connection fail. A "0" set the device for infinite attempts. Value range is 0 - 255. TimeRetry: time interval between attempts in seconds. Value range is 0 - 65535 Return value: A.24 c u d AT+BTDISCONNECT ) s t( o r P Disconnect the current existing SPP Bluetooth(R) link. When the link has been closed, the command returns an OK message and GPIO1 is set to low. Note: e t le See AT+BTCONNECT o s b O - Syntax: AT+BTDISCONNECT Return value: ) s ( ct u d o A.25 AT+ECHO r P e Enable or disable the output of events and functional messages by the module. s b O t e l o Syntax: AT+ECHO= Parameters: ON: The ECHO mode is enabled and every message or events by the module will be outputted. (default) OFF: The ECHO mode is disabled and no output will be generated. Return value: 29/38 AT command A.26 GS-BT2416C1.AT1 AT+UARTSETUP Set the local UART settings. The changes take affect immediately after the OK response. It is advisable to issue an AT command after the AT+UARTSETUP in order to make sure the MCU is synchronized up correctly with the new settings. The new settings are used both for the COMMAND MODE and DATA MODE. Use the command AT+BTMACROSTART to store a startup setting for the UART. Is not allowed to use AT+UARTSETUP command in a macro! Due to internal time needed to write a flash memory area a little time delay is possible before any return value. Syntax: AT+UARTSETUP=BaudRate, DataBits, Parity, Stopbits, Fc Parameters: Baud Rate: UART baud rate in bps. Possible values are: 300, 1200, 2400, 4800, 9600 (default), 19200, 38400, 57600, 115200, 153600, 230400, 460800. DataBits: possible values are 5, 6, 7, 8 (default) Parity: possible values are None (default), Even, Odd c u d StopBits: possible values are 1 (default), 2 Fc: flow control. Possible values are None (default), Hardware Return value: A.27 AT+UARTSETUP=? e t le ) s t( o r P o s b O - Output the current UART configuration settings. The command generates an +UARTSETUP message with the configuration parameters of the module's UART. For the parameters list, see the AT+UARTSETUP command. ) s ( ct Syntax: AT+UARTSETUP=? u d o Return value: +UARTSETUP, A.28 r P e AT+VER t e l o Requests the ID, version number and revision date of the firmware. The command generates a +VER event. s b O 30/38 Syntax: AT+VER Return value: +VER, GS-BT2416C1.AT1 Appendix B B.1 AT event reference AT event reference +BTSETTINGS Outputs the current configuration parameters of the module. Syntax: +BTSETTINGS: BdAddress, DeviceClass, "DeviceName", "PinCode", ConnectableMode, DiscoverableMode, PairableMode, SecurityMode, EncryptionMode Parameters: BdAddress: Bluetooth(R) address of the local module. This value is specified as a 6byte hexadecimal value: i.e. +BTSETTINGS=00230A01F0A5, ... ) s t( DeviceClass: 24-bit integer value indicating the local device class. This value is interpreted as an unsigned hexadecimal 24-bit value c u d DeviceName: A string representing the name of the local device. This string can be long up to 200 characters. o r P PinCode: 4 to 16-byte string representing the module's pin code ConnectableMode: Indicates if the module cannot(=0) / can(=1) be contacted by other Bluetooth(R) devices e t le DiscoverableMode: Indicates if the module cannot(=0) / can(=1) be discovered by other Bluetooth(R) devices o s b O - PairableMode: Indicates if the module does not accept(=0) / accepts(=1) pairing requests from a remote Bluetooth(R) device SecurityMode: Indicates if the module does not request(=0) / requests(=1) authentication ) s ( ct EncryptionMode: Indicates if the module does not request(=0) / requests(=1) encryption u d o r P e t e l o s b O 31/38 AT event reference 10.2 GS-BT2416C1.AT1 +BTRPORT The event is generated only in response to an AT+BTRPORTS command. A +BTRPORT event is generated for each SPP service found on a remote device. So, for example, if a remote device exposes two SPP ports, two different +BTRPORT events are generated. Syntax: +BTRPORT: "ServiceName", PortN Parameters: "ServiceName": A string representing the name of the SPP service as it has been registered on the remote Bluetooth(R) device. PortN: An integer value representing the port number of the remote SPP service. B.2 +BTINQRES c u d ) s t( The event is generated only in response to an AT+BTINQ command. A +BTINQRES event is generated for each device found during an inquiry process. Syntax: +BTINQRES: BdAddress, "BdName" e t le Parameters: (R) o r P o s b O - BdAddress: Bluetooth address of the remote device. This value is specified as a 6-byte hexadecimal value: i.e. ) s ( ct AT+BTINQ=00230A01F0A5 "BdName": A string representing the name of the remote Bluetooth(R) device B.3 u d o +UARTSETUP r P ete Outputs the UART current configuration parameters. l o s b O Syntax: +UARTSETUP: BaudRate, DataBits, Parity, StopBits, Fc Parameters: BaudRate: UART baud rate in bps. Possible values are: 300, 1200, 2400, 4800, 9600 (default), 19200, 38400, 57600, 115200, 153600, 230400, 460800. DataBits: possible values are 5, 6, 7, 8 (default) Parity: possible values are None (default), Even, Odd StopBits: possible values are 1 (default), 2 Fc: flow control. Possible values are None (default), Hardware 32/38 GS-BT2416C1.AT1 B.4 AT event reference +VER Indicates the ID, version number and revision date of the firmware. Syntax: +VER: ID, Ver, RevDate Parameters: ID: Firmware ID indicating the model Ver: Version of the firmware RevDate: Firmware revision date in DDMMYY format. B.5 +READY Indicates the module is ready to accept AT commands. c u d ) s t( The +READY message is generated when the module is started and when the mode is switched from DATA MODE to COMMAND MODE. e t le Syntax: +READY ) s ( ct o r P o s b O - u d o r P e t e l o s b O 33/38 Application examples Appendix C GS-BT2416C1.AT1 Application examples The following section provides two application examples demonstrating how two .AT1 equipped modules can be configured in order to act as a CLIENT and as a SERVER and connect to each other using the SPP service. The CLIENT has the Bluetooth(R) address 00800010AA01, while the SERVER has the Bluetooth(R) address 00800010AA02. Configuring the SERVER: this AT command list sets the module discoverable and connectable by other devices. It enables security and creates an SPP service called "SPP Port". AT OK AT+BTCMODE=1 OK AT+BTPMODE=1 OK c u d AT+BTDMODE=1 OK AT+BTSECMODE=1 OK e t le AT+BTENCMODE=0 OK AT+BTPINCODE="1234" OK ) s t( o r P o s b O - AT+BTNAME="SPP Server" ) s ( ct OK AT+BTCLASS=52020C OK u d o AT+BTREGPORT="SPP Port" OK r P e t e l o bs O 34/38 Configuring the CLIENT: this AT command list configures the module as a CLIENT. GS-BT2416C1.AT1 Application examples AT OK AT+BTCMODE=0 OK AT+BTPMODE=1 OK AT+BTDMODE=0 OK AT+BTSECMODE=1 OK AT+BTENCMODE=0 OK AT+BTNAME="SPP Client" OK AT+BTCLASS=52020C c u d OK ) s t( o r P The following AT commands are issued on the CLIENT module to set-up a connection to the server module: in this example only one connection attempt is required, the TimeRetry parameter is ignored. First, an inquiry is performed to discover nearby Bluetooth(R) devices. Once all devices have been found a connection is made to the found device (SERVER). e t le AT+BTINQ=10 o s b O - +BTINQRES: 00800010AA02, "SPP Server" ) s ( ct OK AT+BTRPORTS=00800010AA02 u d o +BTRPORT: "SPP Port", 1 r P e OK t e l o AT+BTCONNECT=00800010AA02, 1, "1234", 1, 0 OK s b O 35/38 Ordering information scheme 11 GS-BT2416C1.AT1 Ordering information scheme Table 9. Ordering information scheme GS-BT 2416 C1 AT1 Bluetooth(R) modules V 1.2 compliant Class 1 SPD plus AT command c u d e t le ) s ( ct u d o r P e t e l o s b O 36/38 o s b O - o r P ) s t( GS-BT2416C1.AT1 12 Revision history Revision history Table 10. Documet revision history Date Revision Changes 03-Sep-2007 1 First release 27-May-2008 2 Updated: Cover page Added: Section 9 on page 16 c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e t e l o s b O 37/38 GS-BT2416C1.AT1 Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ("ST") reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST's terms and conditions of sale. ) s t( Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. c u d No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. e t le o r P UNLESS OTHERWISE SET FORTH IN ST'S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. o s b O - UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER'S OWN RISK. ) s ( ct u d o Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. r P e t e l o ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. bs The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. O (c) 2008 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan Malaysia - Malta - Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com 38/38