User's Manual

10
.
Connected Operations
Once the connection has been established and
service discovery is complete, you can perform
the following operations using joystick U1 on the
central device:
Read / Write Data
U1
UP
RSSI Monitoring
U1
DOWN
Connection Parameter Update
U1
RIGHT
Terminate Link
U1
IN
(towards the board)
1
1
.
Read / Write Data
P
ressing up on U1 will send a read request to the
peripheral device. One byte of data will be read,
and the value will be
displayed. Pressing up
again will send a write request, and one byte of
data will be written to the peripheral. The
peripheral’s LCD should display the written value
each time this is done
.
Bluetooth
low energy i
s an ideal technology for
transmission of small amounts of data between
two devices
while consuming very little power, as
is demonstrated here.
Continuing to press up on the joystick will
alternate between reads and writes
, with the
value incrementing eac
h time
.
1
2
.
Monitor RSSI
P
ressing down on U1 will turn on RSSI (received
signal strength indication) monitoring. The RSSI
will be displayed on the LCD in units of negative
dBm.
If the boards are moved farther apart from each
other,
the RSSI will drop (since the value is
negative, a higher number means lower RSSI). If
they are moved closer together, the RSSI should
rise.
Pressing down on U1 again will turn off RSSI
monitoring.
1
3
. Connection Parameter
Update
P
ressing
right
on U1 wi
ll send a
connection
parameter update request to the peripheral to
use a longer connection interval. This will result
in much longer latency when performing data
reads and writes; however the power consumed
by both devices is significantly reduced.
1
4
.
Terminate Link
P
ressing U1 in
towards the board
will terminate
the link. The peripheral will return to an
advertising state
.
The central device will display
a “Reason code, which indicates why the
disconnection occurred (values are def
ined in the
BLE stack API).
In this case, the reason code of 22 indicates that
the link termination was initiated by the central
device. In the e
vent that the peripheral device
goes out of range or has power discon
nected
from it, you will see a reason code of
8
which
indicates that a link timeout has occurred.
Y
ou can
now
perform
device discovery and re
-
connect to the peripheral if desired.
1
5
.
SimpleBLE Demo Source
Code
The project and source code
files
for these
applications
(as well as many others)
are
included with the
Bluetooth low energy (BLE)
stack from Texas Instruments, which can be
downloaded at
www.ti.com/blestack
.
The two projects implementing this demo are
c
alled SimpleBLECentral (
CC2541
EM
Master
configuration)
and SimpleBLEPeripheral
(
CC2541
Slave configuration)
.
These can be
modified as desired, and should provide a good
framework for developing your own custom BLE
applications.
More details on these
proje
cts
can be found
within the BLE Software Developer’s Guide,
which is included with the stack
.
A
dditional Tools
and
Links
BLE Packet Sniffer
A
CC2540 USB Dongle
(not
included
)
can be
used as a BLE sniffer and monitor packets while
the SimpleBLE Demo is
running.
The SmartRF Protocol Packet Sniffer software
can be downloaded
from
www.ti.com/packetsniffer
SmartRF
Studio
SmartRF Studio allows you to configure the radio,
run RF performance tests, and run link tests
between the two SmartRF05EBs.
SmartRF Studio can be downloaded
from
www.ti.com/smartrfstudio
Smart
RF Flash Programmer
Texas Instruments has a simple tool which can
be used
to program and flash the
CC2541
SmartRF Flash Programmer can be
downloaded from
www.ti.com/tool/flash
-
programmer
BTool
BTool is a Windows application that allows you to
control a central device
using the serial interface
and perform various
BLE
functions
connected to a peripheral device.
BTool is included as part of the installation of the
BLE stack (see “Useful L
ink
s
to the right).
IAR Embedded Workbench
To develop softwar
e, program, and debug the
CC2541
, you should use IAR Embedded
Workbench for 8051
.
More information on IAR EW8051, including a
free evaluation version download, can be found at
www.iar.com/ew8051
.
Useful Links
TI BLE Stack and Software:
www.ti.com/blestack
CC2540
/41
Development Kit User Guide:
www.ti.com
/lit/pdf/swru301
CC2540
BLE Software Developer’s Guide:
www.ti.com/lit/pdf/swru271
CC2540
/41
User
’s
Guide:
http://www.ti.com/lit/pdf/swru191
CC2541
Prod
uct Page:
www.ti.com/cc254
1
For additional help, visit the TI E2E Forums:
www.ti.com/lprf
-