Documente Academic
Documente Profesional
Documente Cultură
INDEX
SR. NO.
1. 2. 3. 4.
CONTENT
HOW TO USE APPLICATION BOARD BLUETOOTH OVERVIEW OVERVIEW OF OPERATION BLUETOOTH AND WI-FI SECURITY APPLICATION USER MODE HARDWARE CONNECTION PICTORIAL VIEW OF BLUETOOTH BOARD FUNCTIONING OF BLUETOOTH lM400 MODULE FEATURES CIRCUIT DIAGRAM AT COMMAND SET INDEX INTRODUCTION TO BLUETOOTH APLICATION BOARD HOW TO USE KEIL COMPILER HOW TO USE ECE FLASH MAGIC OPTIONAL BURNING TOOL
PAGE NO.
2 3 4 5 6 7 7 8 9 10 11 12 13 14 31 41 49 53
5.
6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18.
Page 1
Page 2
Page 3
Page 4
Page 5
SECURITY
Bluetooth security is defined by three main elements: availability, access, and confidentiality. It is important to distinguish between these elements because Bluetooth security is also highly configurable so that it can meet the needs of devices in many different scenarios. An understanding of the basics will provide the knowledge that you need to choose a security strategy for your device. The first important element of Bluetooth security is availability. If a device cannot be seen or connected with, it is obviously quite secure. Bluetooth defines both of these features as part of the security model and they are exposed by the EmbeddedBlue device through the set visible and set connectable commands. This is a very coarse level of control, but it is also quite effective and can be used in combination with other security features. The second and most complex element of Bluetooth security is access control. This type of security is only relevant when the module is connectable and is designed to provide protection in this case. The general idea is that remote devices must become trusted before they will be allowed to connect and communicate with the EmbeddedBlue module. In order to become trusted, a remote device must present a passkey that matches the stored local passkey. This only needs to be done once, as both devices will remember their trusted status and allow future connections with that specific device without exchanging passkeys again. The EmbeddedBlue module uses the set security command to configure access control. There are three possible settings for security, off, open, and closed. When security is turned off, connection attempts will be allowed from all remote devices. When security is set to open, connections are only allowed from trusted devices, but new devices can become trusted by presenting the correct passkey. Forming a trusted relationship is carried out automatically in this mode the first time that a remote device connects with the EmbeddedBlue module. When security is set to closed, only connections from trusted devices will be allowed and no new devices may become trusted. Closed security is the most restrictive setting and therefore the most secure. The last element of Bluetooth security is confidentiality. Once a link with a trusted device has been established, it may be important to know that the data being transmitted cannot be intercepted by a third party. All transmitted data can be encrypted by configuring the encrypt setting to on. This only has an effect when security is set to either open or closed. The EmbeddedBlue module supports 56-bit encryption by default, but 128-bit encryption is available. Due to export restrictions to certain countries, firmware supporting 128-bit encryption is only available with proper approval from A7 Engineering.
Page 6
USER MODES
COMMAND MODE
The lm400 supports two main operating modes: command mode and data mode. Upon power up, the lm400 enters command mode and is ready to accept serial commands. The factory default communication parameters are 9600 Baud, 8 Data Bits, 1 Stop Bit, No Parity, and No Flow Control. The lm400 supports commands to modify the baud rate and flow control settings. In this mode there are a number of commands that can be sent to change the baud rate, locate other devices that are in range, check the firmware version, etc. All commands are sent using visible ASCII characters (123 is 3 bytes 123). Upon the successful transmission of a command, the ACK string will be returned. If there is a problem in the syntax of the transmission then a NAK string is returned. After either the ACK or NAK, a carriage-return <CR> character is returned. When a prompt (<CR> followed by a >) is returned, it means that the lm400 radio is in the idle state and is waiting for another command. White space is used to separate arguments of the command and a carriage-return <CR> (ASCII 13) is used to mark the end of the command.
DATA MODE
Once the lm400 radio is connected to another Bluetooth device, the lm400 automatically switches into data mode. All data transmitted while in this mode will be sent to the remote device and, therefore, NO further commands can be sent until the lm400 radio is disconnected or switched back to command mode by use of the mode control I/O line or the Switch to Command Mode sequence. The connection status line of the lm400 module can be monitored to determine if there is an active connection. Additionally, whenever a connection is present, the Connection Status LED on the lm400 module will be on. ADVANCE TECHNOLOGY www.atechindia.com Page 7
HARDWARE CONNECTIONS
STEPPER MOTOR
4X4 KEYPAD
Page 8
Page 9
FUNCTIONING OF BLUETOOTH
BLUETOOTH SOFTWARE
USB PORT
BLUETOOTH DONGLE
BLUETOOTH LINK
PROCESSOR
BLUETOOTH MODULE
Page 10
BLUETOOTH MODULE
lm400 Module
Page 11
FEATURES
Bluetooth Ver. 2.0+ EDR certification Transmit Power up to +18dBm (Class1) Low current consumption: Hold, Sniff, Park, Deep sleep mode 3.0V to 3.6V operation Full Bluetooth Data rate over UART and USB Support up to 7 ACL links and 3 SCO links Enhanced Data Rate(EDR) compliant for both 2Mbps and 3Mbps modulation modes Interface: USB, UART&PCM( for voice codec) SPP pro_le comes as standard, HSP/HFP,HID,DUN are availabpro_les le Support for 802.11 Co - Existence RoHS Compliant Small outline: 30mm x 27mmX 2.8 mm Application Access point Domestics and Industrial applications Personal Digital Assistants(PDA) Serial Adapter G PS, PO S, Barcode Reader Digital camera, Printer& Cellular phone Cordless handset
Page 12
Page 13
2 AT command Set..................................................................................................................... 16 2.1 History ............................................................................................................... ..................16 2.2 Terminology ...................................................................................................... ..................16 2.3 Command format ............................................................................................................... .16 2.4 Command Response ........................................................................................................... .17 2.5 Host Events ............................................................................................................... ...........17 2.6 Operation Mode: ................................................................................................................ .17 2.7 Command Types ................................................................................................................. .18 2.8 Command Description ........................................................................................................ .18 2.8.1 AT ...................................................................................................................... ...............18 2.8.2 AT+VER ............................................................................................................. ............... 18 2.8.3 AT+ENQ ............................................................................................................ ............... 19
Page 14
Page 15
Page 16
2. AT COMMAND SET
2.1 HISTORY
The AT command set was developed by Hayes to control the operation of telephony modems. The command set has been extended to control bluetooth device primary operation such as inquiry, connection setup/ disconnection etc. Other AT commands are also available to control the serial port setup and other user friendly features. The Bluetooth device powers up in unconnected state and can be configured using UART interface similar to telephony modems. The device will act as Bluetooth slave by default and can be inquired/connect from other Bluetooth master device in neighborhood. The AT commands can be used to change the default behavior and settings for the current as well as future power up cycles.
2.2 TERMINOLOGY
Symbol <cr> <lf> <cr,lf> Description ASCII value (Hex) Carriage Return 0x0D Line Feed 0x0A Carriage return and 0x0D, 0x0A line feed 12 hexadecimal BD address sequence
XXXXXXXXXXXX
Page 17
Page 18
Page 19
This command allows the connected host device to check the availability of the Bluetooth device. The connected host device must have same serial port settings as configured for the Bluetooth device. 2.8.1.1 SYNTAX AT<cr> 2.8.1.2 RESPONSE <command_response> 2.8.2 AT+VER Returns the device firmware version
Page 20
2.8.3.1 SYNTAX AT+ENQ<cr> 2.8.3.2 RESPONSE <command_response> <cr,lf><Parameter Setting, Brief Description><cr,lf> for each parameter. e.g. device role setting will be listed as <cr,lf>ROLEM, MASTER ROLE <cr,lf>. All other settings and other device information is listed in similar manner.
2.8.4 AT+RESET This command is used to restore the default factory settings and perform device reboot. The default factory settings are listed in table [reference]
Page 21
2.8.5.1.1 RESPONSE <command_response> 2.8.5.2 AT+BAUD?<cr> 2.8.5.2.1 RESPONSE <cr,lf>BAUDb<command_response> if the command is successful. Here, b current baud rate setting. E.g on default setup, the response will be <cr,lf>BAUD14<command_response>
2.8.6 AT+STOP
The command is used to specify one or two stop bits for serial port communication. The current setting can also be retrieved by using the sending this command in query format. 2.8.6.1 AT+STOPn<cr> where n can be 1 or 2 depending on no of stop bits used
Page 22
2.8.6.3 AT+STOP?<cr> 2.8.6.3.1 RESPONSE <cr,lf>STOPn<command_response> if the command is successful. Here, n no of stop bits. E.g on default setup, the response will be <cr,lf>STOP1<command_response>
2.8.7 AT+PAR
The command is used to specify the parity type of serial port. The current setting can also be retrieved by using the sending this command in query format. 2.8.7.1 AT+PARn<cr> where n varies from 0 to 2 depending on the type of parity used
2.8.7.1.1 RESPONSE <command_response> 2.8.7.2 AT+PAR?<cr> 2.8.7.2.1 RESPONSE <cr,lf>PARn<command_response> if the command is successful. Here, n parity type. E.g on default setup, the response will be <cr,lf>PAR0<command_response>
2.8.8 AT+FLOW
The command is used to enable/disable the RTS/CTS flow control for the serial port. The current setting can also be retrieved by using the sending this command in query format. 2.8.8.1 AT+FLOWc<cr> Where parameter c is a character used to enable/disable the flow control
Page 23
2.8.9 AT+ECHO
The command is used to enable/disable the echo back of command characters from the Bluetooth device. The current setting can also be retrieved by using the sending this command in query format. 2.8.9.1 AT+ECHOc<cr> Where parameter c is a character used to enable/disable the echo back feature.
2.8.9.1.1 Response <command_response> 2.8.9.2 AT+ECHO?<cr> 2.8.9.2.1 Response <cr,lf>ECHOc<command_response> if the command is successful. Here, c current echo back setting. E.g on default setup, the response will be <cr,lf>ECHO+<command_response>
2.8.10.2.1RESPONSE <cr,lf>RESPc<command_response> if the command is successful. Here, c current command response setting. E.g on default setup, the response will be <cr,lf>RESP+<command_response> ADVANCE TECHNOLOGY www.atechindia.com
Page 24
The command is used to set the local device as Bluetooth Master/Slave. The current setting can also be retrieved by using the sending this command in query format. 2.8.11.1 AT+ROLEc<cr> Where parameter c is a character used to configure the local device type
Note, this command will cause the device to reboot. 2.8.11.1.1RESPONSE <command_response>
2.8.11.2 AT+ROLE?<cr> 2.8.11.2.1RESPONSE <cr,lf>ROLEc< command_response> if the command is successful. Here, c current device type setting. E.g on default setup, the response will be <cr,lf>ROLES< command_response>
2.8.12 AT+ADDR
This command is used to display the Bluetooth address of the local device. 2.8.12.1 AT+ADDR?<cr> 2.8.12.1.1 RESPONSE <cr,lf><XXXXXXXXXX>< command_response> if the command is successful. Here, XXXXXXXXXX is the Bluetooth address of local device
2.8.13 AT+FIND
This command is used to search for any Bluetooth device in the neighborhood within one minute. If any device is found, its name and address will be listed. Maximum limit of devices searched is 8. The search ends with a message Inquiry ends. xx device(s) found. This ADVANCE TECHNOLOGY www.atechindia.com Page 25
Inquire RSSI value for current bluetooth connection. This command is available in online command mode when the device is in connected state. 2.8.14.1 AT+RSSI<cr> 2.8.14.1.1RESPONSE <cr,lf><RSSI><command_response> <RSSI> can be STRONG/AVERAGE/WEAK depending on the received radio signal strength.
2.8.15 AT+NAME
This command is used to specify a name for the adaptor. You can specify a friendly name using 0 to 9, A to Z, a to z, space and , which are all valid characters. Note that first space or , last space or isnt permitted. The default name is Serial Adapter. The current device name can be retrieved by using the sending this command in query format. 2.8.15.1 AT+NAME=XXXX<cr> ADVANCE TECHNOLOGY www.atechindia.com
Page 26
Page 27
Note, this command will cause the device to reboot. 2.8.17.1.1RESPONSE <command_response> 2.8.17.2 AT+DCOV?<cr> 2.8.17.2.1RESPONSE <cr,lf>DCOVc<command_response> if the command is successful. Here, c current discoverability status setting. E.g on default setup, the response will be <cr,lf>DCOV+<command_response>
2.8.18 AT+CONN This command is used to establish a connection. It is available only when the local Bluetooth device is in the manual master role.
2.8.18.1 AT+CONN<cr> Connect the local bluetooth device to specified bonded bluetooth device. It is available only when "AT+BOND=xxxxxxxxxxxx" is executed.. 2.8.18.1.1RESPONSE <command_response><host_event> where <host_event> will be connection related event and depends on the connection attempt result. 2.8.18.2 AT+CONN= XXXXXXXXXXXX<cr> Connect the local bluetooth device to the bluetooth device address specified by XXXXXXXXXXXX. 2.8.18.2.1RESPONSE
Page 28
This command is used to drop connection from master or slave device. It is only allowed in online command mode when the device is in connected state.
2.8.19.1 AT+DROP<cr> Drop current connection when the device in online command mode. 2.8.19.1.1RESPONSE <command_response><host_event> where <host_event> will be disconnection event. 2.8.20 AT+BOND For security purpose, this command is used to specify a unique remote Bluetooth device to be connected. In the master role, the local device pairs and connects with the designated remote slave address. In the slave mode, this command is a filter condition to accept the connection request from the master device. The current bonded device address can be retrieved by using the sending this command in query format. 2.8.20.1 AT+BOND=XXXXXXXXXXXX<cr> 2.8.20.1.1RESPONSE <command_response>
2.8.20.2 AT+BOND<cr> Restore the status in which the local Bluetooth device can connect with any remote device. There is no device bonded with local device. ADVANCE TECHNOLOGY www.atechindia.com Page 29
2.8.21.1 AT+ACONc<cr> Where parameter c is a character used to enable/disable the auto connection feature.
Note, this command will cause the device to reboot. In Manual connect type, the local device (if master type) will need to use AT+FIND? command to find Bluetooth devices in neighborhood and then use AT+CONNn to connect to specific device. 2.8.21.1.1RESPONSE <command_response> 2.8.21.2 AT+ACON?<cr> 2.8.21.2.1RESPONSE <cr,lf>ACONc<command_response> if the command is successful. Here, c current connect type setting. E.g on default setup, the response will be <cr,lf>ACON+<command_response>
2.8.22 AT+ESC
This command Disable/Enable the handling of escape sequence +++. Note: The escape sequence must be sent with guard time of 1000 msec. The current setting can also be retrieved by using the sending this command in query format.
Page 30
Note: When the device is in data mode (connected state), it can be forced into online Command mode during active connection to the remote device. The "+++" escape sequence must be sent with guard time of 1000msec. The next AT command must be sent after waiting for the response "<cr,lf>OK<cr,lf>" to indicate switching from online data mode to online command mode. 2.8.22.1.1RESPONSE <command_response> 2.8.22.2 AT+ESC?<cr> 2.8.22.2.1RESPONSE <cr,lf>ESCc<command_response> if the command is successful. Here, c current status. E.g on default setup, the response will be <cr,lf>ESC+<command_response>
2.8.23 AT+AUTO The command directs the device to switch from online command mode to online data mode. This command is only allowed in connected state. 2.8.23.1 AT+AUTO<cr>
2.8.23.1.1RESPONSE <cr,lf>OK<cr,lf>
2.8.24 AT+RCFG This command enables or disables configuration from the remote device by executing the remote access hand shaking protocol. Please ask for separate document for remote configuration details. The current setting can also be retrieved by using the sending this command in query format. 2.8.24.1 AT+RCFGc<cr> Where parameter c is a character used to enable/disable the remote configuration
2.8.24.1.1RESPONSE <command_response> 2.8.24.2 AT+RCFG?<cr> 2.8.24.2.1Response <cr,lf>RCFGc<command_response> if the command is successful. Here, c current setting. E.g on default setup, the response will be <cr,lf>RCFG+<command_response> ADVANCE TECHNOLOGY www.atechindia.com Page 31
2.8.25.1 AT+SLEEPc<cr> Where parameter c is a character used to enable/disable the auto power saving feature
2.8.25.1.1RESPONSE <command_response> 2.8.25.2 AT+SLEEP?<cr> 2.8.25.2.1RESPONSE <cr,lf>SLEEPc<command_response> if the command is successful. Here, c current setting. E.g on default setup, the response will be <cr,lf>SLEEP<command_response>
Page 32
Page 33
CENTRAL PROCESSOR
Micro controller: - P89V51RD2 Crystal frequency: - 11.0592MHz Internal FLASH Memory: - 64K
MEMORY
4K memory which can be upgradeable to 516k is provided in EEPROM section.
PERIPHERALS
Part No. ADC0804CCN LM 35 DS1307 24C04 LCD BUZZER RELAY Stepper Motor Specifications 8-BIT 1-CHANNEL, 100s. 5V SERIAL I2C Real Time Clock. 4K serial EEPROM(). 16 x 2 character LCD 5V 5A/250V AC 5V, 6 wire
P89V51RD2
FEATURES
ADVANCE TECHNOLOGY www.atechindia.com Page 34
Page 35
JP1(P0)
JP11
JP1
JP4 JP9
Pin No. Signal Pin No. Signal 1 VCC 1 VCC 2 RX2 2 P0_0 3 TX2 3 P0_1 4 INT0 4 P0_2 5 INT1 5 P0_3 Pin No. Pin No. 6 6 7 7 8 8 9 9 10 10
JP6
Signal Signal T0 P0_4 T1 P0_5 WR P0_6 RD P0_7 GND GND
Pin No. Pin No. 1 1 Signal VCC 2 3 Pin No. 4 1 Signal 5 VCC
Signal Pin No. 2 3 4 VCC 6 P1_4 P1_5 P1_6 P2_0 7 P2_1 8 P2_2 2 3 9 4 P2_3 P1_1 P1_2 10 P1_0
Signal 5 6 P2_4 P1_7 GND P2_5 P2_6 JP10 P2_7 5 6 GND GND P1_3
JP8
Pin No. 1 2 3 4 5 6 Signal VCC INT0 INT1 T0 T1 GND
JP11
Pin No. 1 2 3 4 Signal RD WR ALE GND
Page 36
JP28
Pin No. Signal 1 2 3 4 VCC EOC RD SOC
E2PROM 24C04
FEATURES Low-voltage and Standard-voltage Operation 2.7 (VCC = 2.7V to 5.5V) 1.8 (VCC = 1.8V to 5.5V) Internally Organized 128 x 8 (1K), 256 x 8 (2K), 512 x 8 (4K), 1024 x 8 (8K) or 2048 x 8 (16K) 2-wire Serial Interface Schmitt Trigger, Filtered Inputs for Noise Suppression Bi-directional Data Transfer Protocol ADVANCE TECHNOLOGY www.atechindia.com Page 37
3.6V Battery
Page 38
EEPROM
The AT24C01A/02/04/08/16 provides 1024/2048/4096/8192/16384 bits of serial electrically erasable and programmable read-only memory (EEPROM) organized as128/256/512/1024/2048 words of 8 bits each. The device is optimized for use in many industrial and commercial applications where low-power and low-voltage operation are essential. The AT24C01A/02/04/08/16 is available in space-saving 8-lead PDIP,8-lead JEDEC SOIC, 8-lead MAP, 5-lead SOT23 (AT24C01A/AT24C02/AT24C04), 8-lead TSSOP and 8-ball dBGA2 packages and is accessed via a 2-wire serial interface. In addition, the entire family is available in 2.7V (2.7V to 5.5V) and 1.8V (1.8V to 5.5V)
LED SECTION
Page 39
JP32
JP24
JP27
Pin No. 1 Signal 2 3 RELAY2 4 RELAY1 5 BUZZER 6 GND_REL
JP30
Pin No. 1 2 Signal +12V_REL GND_REL
JP24
Pin No. Signal 1 NO 2 COM 3 NC
JP32
Pin No. 1 Signal NO 2 3 COM NC
STEPPER MOTOR
JP14
Page 40
JP16
JP12
JP12
Pin No. Signal 1 Vcc 2 ST1_0 3 ST1_1 4 ST1_2 5 ST1_3 6 NC 7 NC 8 NC 9 NC 10 GND
JP16
Pin No. Signal 1 STEP1_0 2 STEP1_1 3 STEP1_2 4 STEP1_3 5 +5V_ST 6 +5V_ST
LCD CONNECTIONS
Page 41
Function set (8-bit interface, 2 lines, 5*7 Pixels) Function set (8-bit interface, 1 line, 5*7 Pixels) Function set (4-bit interface, 2 lines, 5*7 Pixels) Function set (4-bit interface, 1 line, 5*7 Pixels) Entry mode set Scroll display one character right (all lines) Scroll display one character left (all lines) Home (move cursor to top/left character position) Move cursor one character left Move cursor one character right Turn on visible underline cursor Turn on visible blinking-block cursor Make cursor invisible Blank the display (without clearing) Restore the display (with cursor hidden) Clear Screen Set cursor position (DDRAM address) Set pointer in character-generator RAM (CG RAM address)
Page 42
JP35
Pin No. 1 2 Signal -5V GND
HOW TO USE KEIL COMPILER STEP: 1 Double Click on the icon present on the desktop.
Page 43
Page 44
STEP: 5 when you click on the save button, following window opens
Page 45
Page 46
STEP: 9 Write or copy your Bluetooth code there & save it with extension .c or .asm depending on your coding.
STEP: 10 Go to target & then source group, right click on there & click on the option add files to the project.
ADVANCE TECHNOLOGY www.atechindia.com Page 47
Page 48
STEP: 12 Go to the option for target, click on output &tick on create hex file option
Page 49
After performing all these steps the chip will be configured through Flash Magic .Let us hand on the steps of chip configuration through Flash Magic
Page 50
Page 51
Page 52
now set the parameters as shown below 4. click on communication and set high speed communication with baud rate 9600.
Page 53
Now select timeouts and set regular time 30 and long timeout 120. Now click ok and main window will appear.
6. After selection of the chip (P89v51RD) , Port (Com1), Osc.Mhz(11.0592) we can see the window as below:
ADVANCE TECHNOLOGY www.atechindia.com
Page 54
Select the blocks to erase, browse for the hex file to be loaded. Press Start 7. Within 5-6 seconds the message will be displayed FINISHED. 8. Set the jumper Switches 1, 3, and 5 ON.
OPTIONAL BURNING TOOL To burn chip 89V51RDRXX through ECE flash it required less.
ADVANCE TECHNOLOGY www.atechindia.com Page 55
Set baud rate 9600, select working comport of PC to hardware and software communication as shown below.
Now select hex file to burn in chip through browse option as shown below.
Page 56
Page 57
Now press reset switch on hardware board and flash will burn with 5-6 Seconds. Again press reset switch on hardware board to run your program or to see output. Double click on My Bluetooth Places on Desktop and detect all devices in range it will show lm400. *How to Connect with lm400 device
Open Hyper Terminal and connect it on the com port as assigned by the Bluetooth device.
ADVANCE TECHNOLOGY www.atechindia.com Page 58
Set 9600 baud rate, no parity, 1 stop bit . Click on the Settings and then on click on the ASCII setup.
Page 59
See the results on the hyper terminal. It shows continuous string for example: ADVANCE TECHNOLOGY BLUETOOTH DEVELOPMENT KIT This string is displayed through Bluetooth link.
Page 60