PAN1322 ApplicationNote
PAN1322 ApplicationNote
eUniStone
Information in this document related to the Intel product or, if any, related to its use is provided in connection with Intel products. No license, express or implied, by estoppel or otherwise,
to any Intellectual property rights is granted by this document. Except as provided in agreements concluded individually or Intel’s terms and conditions of sale for such products, Intel
assumes no liability whatsoever and Intel disclaims any express or implied warranty, relating to sale and/or use of Intel products including liability or warranties relating to fitness for a
particular purpose, merchantability, or infringement of any patent, copyright or other Intellectual property right.
Unless otherwise agreed in writing by Intel, the Intel products are not designed nor intended for any application in which the failure of the Intel product could create a situation where
personal injury or death may occur.
Unless otherwise agreed upon, Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of
any features or instructions marked “reserved” or “undefined”. Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising
from future changes to them. Unless otherwise agreed, the information here is subject to change without notice. Do not finalize a design with this information.
Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order.
Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or go to:
http://www.intel.com/#/en_US_01.
Any software source code reprinted in this document is furnished under a software license and may only be used or copied in accordance with the terms of that license.
This document may contain information on products in the design phase of development.
Intel product numbers are not a measure of performance. Product numbers differentiate features within each product family, not across different product families.
Code Names are only for use by Intel to identify products, platforms, programs, services, etc. (“products”) in development by Intel that have not been made commercially available to the
public, i.e., announced, launched or shipped. They are never to be used as “commercial” names for products. Also, they are not intended to function as trademarks.
SMARTI, SMARTi & Device, BlueMoon, Comneon, Comneon & Device, M-GOLD, S-GOLD, E-GOLD, A-GOLD, X-GOLD, XMM, X-PMU, XPOSYS are trademarks of Intel Corporation and related
companies.
Copyright © 2013, Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.
Revision History
Contents
1 Introduction .................................................................................................................. 10
2 Interfaces ...................................................................................................................... 13
5.1 Accessory....................................................................................................................... 22
5.2.1.3 Android market and Developing Apps for Android Smart Phones ........... 35
7 Layout ............................................................................................................................. 44
8 Antenna .......................................................................................................................... 50
9.4.3 Restoring SPP - Writing BD address and oscillator trim value ................. 59
9.5.2.1 Crystal Trimming with HCI application for special RF tests ....................... 61
10 FAQ .................................................................................................................................. 67
11 References..................................................................................................................... 75
Figures
Figure 1. Simplified Block Diagram of eUniStone Module .................................................. 12
Figure 3. Host Initiates Low Power Mode Entry and Exit ................................................... 14
Figure 4. Host Initiates Low Power Mode Entry, eUniStone Initiates Exit ................... 15
Figure 7. Host processor with peripheral device and UART connection to eUniStone
........................................................................................................................................................... 23
Figure 9. Smart Phone Apps using Serial Port Profile UUID connecting to Serial
port accessory. ............................................................................................................................ 29
Figure 10. eUniStone with three registered services and possible connections to
Smart Phones. ............................................................................................................................. 30
Figure 12. Accessory and Android Smart Phone App using the same UUID will be
able to connect............................................................................................................................ 34
Figure 14. Restricted area under antenna and recommended placement on PCB. . 44
Figure 15. Top layer and drill holes of the eUniStone USB Dongle. .............................. 45
Figure 16. Bottom layer (from above) and drill holes of the eUniStone USB Dongle.
........................................................................................................................................................... 45
Figure 17. The two layers of the eUniStone USB Dongle. ................................................. 46
Figure 25. Typical 32MHz frequency offset in PPM versus OSC_Trim value. ............. 61
Figure 29. Finding the COM port in the Device Manager ................................................... 68
Figure 30. Modify the Latency Timer of the FTDI driver .................................................... 68
Figure 31. Aardvark drivers installed and visible in the Device Manager. .................. 72
Figure 32. Aardvark connect to the PBA31309 USB dongle. (Black = GND, Red =
I2C clock, White = I2C data) ................................................................................................. 73
Tables
Table 1. Sending and receiving data in command mode ................................................... 19
Table 4. Class of Device bits for a handheld terminal with bar-code scanner. ......... 28
1 Introduction
eUniStone (embedded UniStone), with part number PBA31309, is a module based on PMB8754
(eBMU), an integrated BT radio transceiver, baseband and protocol stack, with EEPROM, band-pass
filter and built in antenna
Device is visible and connectable until the link has been set up
Sniff and Sniff Sub Rating are supported on the link to save current
Secure Simple Paring Debug mode to sniff and decrypt the air traffic
eUniStone
EEPROM
I2C
I2C interface
RF
UART Onboard
singnal
Antenna
Balun filter
LPM PMB8754
eBMU
GPIO
Supply Supply
regulator
26MHz
Crystal
2 Interfaces
The interface consists of four UART signals for the AT interface and two GPIOs for additional low
power mode control, as shown in Figure 2.
Host eUniStone
UARTTXD UARTRXD
UARTRXD UARTTXD
UARTRTS UARTCTS
UARTCTS UARTRTS
BT_LPM_OUT P0.14
BT_LPM_IN P0.0
The low power mode protocol for eUniStone is based on hardware signaling only. No AT commands or
responses are required for the low power mode protocol. The two GPIOs are used to tell the other
device (host or controller) when it may enter low power mode, when it should wake up and when it
cannot transmit because the other device is in low power mode.
To allow the eUniStone to enter low power mode, the host sets pin P0.14 low. When eUniStone is
ready, it will also allow the host to enter LPM by setting P0.0 low. Before entering LPM, the host shall
set UART CTS of eUniStone high. Before entering LPM, eUniStone will set its own UART RTS high.
Figure 3 shows a case where the host initiates low power mode entry and exit.
Host eUniStone
3. When UARTRTS is high and P0.0 is low, eUniStone enters low power mode. The host
may now enter low power mode by signaling UARTCTS high.
5. eUniStone wakes up. P0.0 goes high and UARTRTS goes low.
Figure 4 shows a case where the host initiates low power mode and the controller wakes up the
host.
Host eUniStone
Figure 4. Host Initiates Low Power Mode Entry, eUniStone Initiates Exit
3. When UARTRTS is high and P0.0 is low, eUniStone enters low power mode. The host
may now enter low power mode by signaling UARTCTS high.
If the HW flow control is not used, UARTCTS must be tied low (flow "go"). Floating UARTCTS will result
in random stop of the UART flow.
Without the HW flow control, a buffer overflow can occur on the UART, more probably at higher baud
rate but also possible in lower baud rates due to congestion over the air.
For the LPM protocol, UARTCTS shall be high during LPM. In some cases the module could send events
before the host is completely awake. Therefore LPM shall not be used without HW flow control.
On the PBA31309 module, the communication between the eBMU PMB 8754 and the EEPROM is
carried through a standard I2C bus. The I2C bus is also accessible from external pins, which is useful in
the development or debug phase in case the EEPROM gets corrupted.
The non-reserved pins on port P0 may be controlled with AT commands. The P1 pins are not
controllable through AT commands. They are reserved for use by future applications of the chip.
JTAG# has an internal pull-up. If the JTAG functionality is not needed, leave this pin open.
3 Power Supply
Main supply voltages (VSUPPLY1 on pin A4, A5 and A6) are required in the range
from 2.9V to 4.1V. All these supplies are internally connected. It is only necessary to
supply one of them.
supplied externally. In this case voltages between 1.35 and 3.6 V are required.
connected to the internal regulator, voltage “Internal 2” on pin VREG (pin No.
C1), if 2.5 V is enough for UART operation (of course, voltage levels of the digital
signals on the UART interface depends from this supply voltage). Ultimately, this
depends on the host.
Note: The state of UART pins is not defined while VDDUART is not supplied. The
host shall not drive any UART pin before the reference levels are stable.
supplied externally. In this case voltages between 1.35 and 3.6 V are required.
connected to the internal regulator, voltage “Internal 2” on pin VREG (pin No.
C1), if not used.
Note: The state of pins P0.0-P0.3 is not defined while VDD1 is not supplied. The
host shall not drive any of these pins before the reference levels are stable.
The sequence of the EEPROM accesses at start-up is shown in Figure 5, During the EEPROM access,
UARTRTS stays high. When the EEPROM access has finished, the UARTRTS signal is pulled down and a
startup response “ROK” is sent via UART to the host. After receiving the startup response, the host is
informed that the eUniStone module is ready to work.
The range for the startup time is indicated for each application SW release in the Release Notes [3].
RESET#
SDA0
UARTRTS
UARTTXD
When the ONOFF pin is driven low, the reference levels VDDUART and VDD1 must also be switched
off. Otherwise the module would draw current from VDDUART and VDD1, and the output pins would
be “undefined”, i.e. they could drive high or low levels or vary periodically.
One option is to supply VDDUART and VDD1 by pin C1 VREG which connects to the “Internal2” voltage.
Internal2 is switched off when ONOFF goes low. VSUPPLY can remain always on. Precondition for this
is that the host’s UART pins are compatible with the logical levels for Internal2 driven pins indicated in
the data sheet: Input Low max 0.45 V, Output High min 2.1 V. See “Table 18 Internal2 (2.5 V) Supplied
Pins” in the data sheet [1] for the full specification.
4 Operation Modes
After a SPP connection is set up to another device, data is sent using the command AT+JSDA. Data
received from the other side is sent to the host with the response +RDAI. See example in the SPP AT
specification, [2]. Sending and receiving data in command mode is normally used when transmitting
burst and packetized data.
Host eUniStone OK<cr><lf> Positive response that the data was sent
If the remote device disconnects the link when the eUniStone module is in stream mode, the
eUniStone module will immediately send a „Disconnect Indication“ +RDII to the host and switch back
to command mode automatically.
If the remote device is off (e.g. powered off or out of range) when the eUniStone module is in stream
mode, stream data cannot be transmitted any more on the air. Hardware flow control stops any
further UART communication as soon as the module’s UART input buffer is full. After the link
supervision timeout of 20 s, the module sends a „Disconnect Indication“ +RDII to the host. At that
instant, Any UART data is flushed and the device switches back to command mode automatically.
The host has to wait during the supervision timeout of 20 s. As soon as the UART buffer is full, it is not
possible to leave stream mode or to disconnect the link locally before the supervision timeout expires.
1. The host is searching for “+RDII“ in the data stream from the module. The host shall
switch from stream mode to command mode when it recognizes the “+RDII“
indication. Any stream data sent after the “+RDII“ indication will be answered by an
error message “ERR=-1“ (syntax error). If the host after that sends a first command
it will be responded with “ERR=-1“, since the UART is out of sync. The second
command will get the expected response (e.g. “OK”).
2. The GPIO pin P0.1 (pin E5) is used to indicate the connection status. P0.1 is HIGH
when eUniStone device is connected and LOW when there is no connection. The
transition from HIGH to LOW happens prior to sending the “+RDII” indication via
UART. Hosts that cannot monitor the incoming data stream for the "+RDII"
indication in stream mode may monitor P0.1 in eUniStone.
P0.1 is configured as input pin by default. To use this feature the host shall send the AT command
“AT+JGPC=FFFD,0000,0000,0000,FFFD” which configures P0.1 as an output pin.
UART
iPhon
eUniStone e
PBA31309
Windows Phone 8
5.1 Accessory
An accessory can be any device that connects, sends and/or receives data to and from a remote
device. The device can be small and portable or part of a bigger system. Typical usages for an
accessory are;
Sensor
Display
Remote control
Keypad
Handheld terminal
The eUniStone is specially made to support all these types of accessories/applications using the Serial
Port Profile (SPP) over Bluetooth.
Host Processor
Ext.
Host application
ext bus
ctrl
AT command interface
External chip
UART
SPP
I2C bus
EEPROM BT STACK
Figure 7. Host processor with peripheral device and UART connection to eUniStone
Performance
Power
Other peripheral function can be measurement of physical parameters like temperature, humidity,
pressure, acceleration. Also input and output capabilities need to be considered like how keyboard,
display, LED’s and input buttons should be handled, and it all depends on the functionality of the
complete accessory product.
The eUniStone provides the support to use a low cost minimal footprint host processor. A normal
implementation for a host running an eUniStone could be around;
Of course the complete functionality decides the final requirements for the host processor in regard to
handle the eUniStone.
The below picture shows how a general state machine for the Host application may be implemented
and running in the host processor controlling the eUniStone module.
Started
Initialize
Error
Not
Connected Disconnection
Connection
Connected Disconnect
Error
Below is a short description of the states from the Host application state machine from above.
1. Started, is after power on or a HW reset. To do this the host processor must be able
to Control GPIO’s for HW reset and Low Power Mode (LPM).
3. Not Connected, can be an idle state were it waits for an incoming connection or it
waits for the user of the Host application to make an input so that it connects to
another device. This state could also be very short if the host application is
configured to directly try to and successfully connects to another device.
4. Connected, requires that the host application is able to handle transmit and receive
of data to and from the remote device (e.g. a mobile phone). Disconnect, is an
intermediate state where a disconnection has occurred on purpose or by unknown
reasons.
When being in the Not Connected or Connected state it is important to save power. The Not
Connected state is most probably the normal state and LPM (Low Power Mode) should be used at all
times as long as the host is not sending any commands to eUniStone nor receiving a wake-up from
Since Bluetooth is wireless, a link disconnection can occur due to radio disconnections, and such errors
needs to be handled. In case of any error’s in any state there should be an error handling routine that
takes care of it and initializes eUniStone again. If the error occur while connected to another device it’s
recommend to try to Disconnect the link before making a new initialization.
The above are the main considerations and specific configuration which has impact on the
compatibility vs the three main Smart Phones. Also the actual phone App settings/functionality has
impact on the compatibility.
eUniStone as a connectable device B should be configured, by the Host application using the following
SPP-AT commands and their specific functionality [2].
AT+JSEC (Set security level, variable/fix PIN, Input and Output Capabilities)
eUniStone as a connecting device A should be configured, by the Host application with the following
SPP-AT commands.
AT+JSEC (Set security level, variable/fix PIN, Input and Output Capabilities)
AT+JSLN (Set a local name so that the remote device can request it when
connected)
When creating connections it is necessary to find the remote devices and services first - use then
device discovery (AT+JDDS) and service search (AT+JSDS).
The AT+JSEC command may only be sent after power up, a HW or SW reset. It shall therefore always
be the first sent command. Local name and services shall always be written for a device B since it will
be easier for the connecting device to find it. It’s also recommended to do such settings on a device A
since after a device A has connected to a remote device the remote device might do a remote name
request and add the name to its device list.
AT+JSEC=<security_mode>,<PIN_type>,<length_PIN_code>,<PIN_code>,<Input_capability>,<Output_capability>
Example: AT+JSEC=4,1,04,1111,2,1
Security mode 4 is the supported mode by eUniStone since it supports Secure Simple Pairing. Variable
PIN is normally used when the device have Input and Output Capabilities. Devices that are missing
Input and/or Output capabilities can use a fixed PIN that is set with the security command. The Input
and Output capabilities are also set. The Input and Output capabilities shall be set according to the
capabilities available in the accessory.
For example if the host solution have an input button, the Input capability shall be set to ‘1’. If the host
solution has a keyboard, the input capability shall be set to ‘2’. The Output refers to the accessories
capability like e.g. screen.
When bonding with a Smartphone the accessories configured Input and Output Capabilities used, will
result in different bonding procedures since the manufactures of the mobile phones have made
interpretation and implementation how it should work. See chapter 5.2
Secure Simple Pairing (SSP) is supported but also the legacy paring is supported when connecting to
older Bluetooth devices for backwards compatibility, see SPP-AT specification [2]
A Serial Port Profile accessory, according to Bluetooth standard, uses either a short or a long UUID as
below;
Class of Device should be set according to what kind of device the accessory is. CoD does not tell the
exact services and functionality available in an accessory, but it is recommended to have a class of
device in eUniStone as close as possible to what’s implemented. The CoD consist of a 24 bit field.
When Smart Phones search for accessories the CoD may result in finding or not finding the accessory
since the manufactures of the phones handle CoD differently. Below are a couple of examples;
Table 4. Class of Device bits for a handheld terminal with bar-code scanner.
Bi 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 0 0 0
CoD = 0x000560, details about the bits are available at https://www.bluetooth.org under the section
called “Assigned numbers, Baseband”.
The CoD is set to 0x240704 in the below example and works with all three Smart Phones in this
document, and it is iPhone requiring it for Accessories. In the following examples, the service name is
“Serial port” and is set to port 0x01 (possible values are 0x01-0x30), furthermore it starts with length
field for UUID and service name.
Figure 9. Smart Phone Apps using Serial Port Profile UUID connecting to Serial port accessory.
When the UUID with the Serial Port Profile is used any other device or mobile phone application which
use the Serial Port Profile can connect to the Accessory with eUniStone (iPhone require a specific long
UUID).
Figure 10. eUniStone with three registered services and possible connections to Smart Phones.
The figure above shows how the various Smart Phones are able to connect, or not connect, to an
accessory using eUniStone with three registered services. Observe that only one CoD is possible to
store and use, so the last registered will always be used.
When a remote device connects to eUniStone it will tell the host application which service that has
been connected to in the Connect Confirm Response. With the services used in the previous chapter
the following three successful Connect Confirm Response will be received.
1. +RCCRCNF=500,0000110100001000800000805F9B34FB,0
2. +RCCRCNF=500,00000000DECAFADEDECADEAFDECACAFF,0
3. +RCCRCNF=500,D2CA6960F6A042308BE980CF63B25BAF,0
Incomming
Connection
+RCCRCNF with No
Service #1
+RCCRCNF with No
Yes
Service #2
Yes
For example if the connection contains the first service it can choose to just be a cable replacer. If it
contains the iPhone service, it shall also initiate a specific Apple authentication before being able to
send and receive data. If it contains the third random UUID (Android specific) it can take a proprietary
actions that only is used together with remote devices that has the same UUID.
eUniStone ROK
eUniStone OK
eUniStone OK
eUniStone OK
eUniStone OK
eUniStone OK
For a Smart Phone to start the connection and get connected to the accessory with above settings the
normal procedure is;
4. A passkey will be displayed on both the accessory and on the phone. Compare them
and, if they are equal, accept the connection on both accessory and phone.
The procedure will vary and depend on the UUID, CoD and Input, Output Capabilities set with the
security command on eUniStone. See chapter 5.2 for detail about Android, Windows Phone and
iPhone in combination with settings on eUniStone.
iOS by Apple
The Serial Port Profile UUID, CoD, service name and port number of the service is registered with the
command AT+JRLS, and the values shall be written to eUniStone as initialization. The below example
should work with most Android Smart Phones. The service is called “Serial port” and set to port 0x01.
The name and port number can be chosen to be different to the example.
What CoD to choose depends on the specified behavior of the accessory. However, in some cases it is
also important to use info from the field on what works. Details about CoD can be found on
https://www.bluetooth.org under the section called “Assigned numbers, Baseband”.
Random UUID can be used if the Accessory (eUniStone) only shall work with a specific Android Smart
Phone App. If eUniStone uses a random UUID, an Android Smart Phone App needs to be developed
which use the same specific random UUID. The specific accessory with eUniStone and the Android
Smart Phone App will then more easily be associated in a way so that this Android Smart Phone App
will only connect to the accessory using that specific random UUID.
Observe that the long random UUID is only generated randomly once during development of the
accessory and Smart Phone App. Most programing languages and tools contain functions for
generating a long random UUID. UUID generators can for example be found in Java. Also there are
online webpages that can generate random UUID’s.
Figure 12. Accessory and Android Smart Phone App using the same UUID will be able to connect.
5.2.1.2 Security settings and connecting/bonding to Smart Phone versus App in the phone
Bonding an Android phone with Accessory (eUniStone) can be performed either through the Bluetooth
settings in the Android phone or directly through an App running on the phone. To be able to do it
inside, the App needs to support such a procedure. The security command (AT+JSEC) is used to set the
security for eUniStone, variable/fixed PIN and the Input and Output Capabilities. The Input and Output
Capabilities are set according to the capabilities of the accessory. Depending on which capabilities are
set the bonding with Android Smart Phones or a specific App has minor differences. The below tables
show expected results.
Android eUniStone
2 1 0 1 Pass key is shown by both eUniStone and phone. Bonding is accepted on phone only.
2 1 1 1 Pass key is shown by both eUniStone and phone. Bonding is accepted on both eUniStone
and phone.
2 1 2 1 Pass key is shown by both eUniStone and phone. Bonding is accepted on both eUniStone
and phone.
1)
Inside an App the bonding and connection setup might not be possible with input, output set to 0, 0
or 1, 0. The reason for that is that the App is requesting a “secure RFCOMM socket” with man-in-the-
middle protection. To be able to use the input, output combinations 0, 0 and 1, 0 on eUniStone the
App should request an “insecure RFCOMM socket”.
When doing Secure Simple Pairing a bonding procedure is performed and link keys are made between
the two devices. Next time the devices connect, the connecting procedure will be easier and quicker,
since there are already valid link keys to be use by the two devices (Smart Phone and eUniStone).
With the above information and other supporting references it should be possible to in a fast and
secure manner develop a Bluetooth accessory, using eUniStone, and thus being compatible with
Android Smart Phone application.
5.2.1.3 Android market and Developing Apps for Android Smart Phones
To publish or download Android Apps the following sites are normally used.
https://play.google.com/store and https://play.google.com/apps/publish. However, it is possible to
download Android Apps directly from other sources as well.
Developing applications for Android phones can be done using e.g. Eclipse [11]. Information on how
to download and install the Android SDK is found on http://developer.android.com. The main
programing language used is Java, C and C++ can also be used. This chapter describes the most
common classes and methods for settings up and managing a Bluetooth connection in Android. More
about Android App development is available in the Demo Specification [15].
5.2.2.2 Bonding
Bonding a Windows Phone with eUniStone can be performed either through the Bluetooth settings in
the Windows Phone or directly through an application running on the phone. To be able to do it inside
an application, the application needs to support such a procedure. Depending on which capabilities set
with the security command (AT+JSEC), the bonding with Windows Phone and eUniStone will vary
according to the comments in below table.
Windows 8 eUniStone
2 1 1 1 Pass key is shown on both eUniStone and phone. Bonding is accepted on both eUniStone
and phone.
2 1 2 0 Pass key is shown on phone. Bonding is accepted by pass key input on eUniStone
2 1 2 1 Pass key is shown on both eUniStone and phone. Bonding is accepted on both eUniStone
and phone.
Install windows phone SDK, it can be downloaded from the Microsoft website:
(http://dev.windowsphone.com/en-us/develop)
Windows Phone emulator (To test windows phones app, to use hardware related
apps we will need a real phone)
Expression Blend for Windows Phone (It has more feature for GUI building, not
necessary to use )
To start developing basic windows phone application open visual studio and click File -- click New
Project, it with show you a dialog box, select Windows Phone Application
For Bluetooth communication Windows Phone provides a basic API, It has four basic classes which are
PeerFinder
Peerinformation
StreamSocket
ConnectionRequestedEventAArgs
If you are trying to make a connection between App to App you will need to add the capability
"ID_CAP_PROXIMITY" and for App to device, add the capabilities ID_CAP_PROXIMITY and
ID_CAP_NETWORKING. If you don't add these, you will get an exception.
PeerFinder.AlternateIdentities["Bluetooth:Paired"] = "";
if (peerDevices.Count == 0){
When you get paired device
Debug.WriteLine("No you
paired get information
devices like Hostname, address etc.
were found.");
5.2.3 iPhone
This chapter describes how the eUniStone PBA31309 Bluetooth module may support communication
with the Apple iPhone/iPad/iPod touch products. The iPhone/iPad/iPod touch products, hereafter
referred to as Apple devices, implement an additional protocol layer on top of RFCOMM called iAP
(iPod Accessory Protocol). The eUniStone host, hereafter referred to as the accessory, must identify
and authenticate itself towards the Apple device to gain access to iAP
Host Processor
Host application
AT command interface
MFi chip
UART
eUniStone
AT command interface
SPP
I2C bus
EEPROM BT STACK
The above hardware and software is needed in the accessory to be compatible and working with
iPhone applications. Furthermore, developing Accessories using the Bluetooth Serial Port Profile and
applications for iPhone and iPads, important considerations must be taken on how to make the
accessory compatible with iPhone Apps.
AT+JRLS=32,11,00000000DECAFADEDECADEAFDECACAFF,Serial port,01,240704
The eUniStone Class of Device (CoD), set by the AT command AT+JRLS, shall be set to a specific value in
order to be discovered by an Apple device. Using e.g. CoD 0x240704 for the Accessory it will in many
cases not reflect the correct functionality of the device since this means that it is a (Audio, Rendering,
Wearable, Wristwatch) device.
For Audio/Video:
Hands-free Device
Loudspeaker
Headphones
Portable Audio
Car Audio
For Wearable:
Wristwatch
Jacket
Helmet
Glasses
Details about the assigned numbers for the various applications are found at the Bluetooth.org.
Additionally when an iPhone application is connecting to eUniStone the iAP authentication needs to be
handled by the accessory. Full insight in iPhone accessory is available to MFi licensees.
5.2.3.2 Bonding
Bonding an iPhone with eUniStone is always performed using the Bluetooth settings in the iPhone.
After bonding, it is possible to start an iPhone application and connect to eUniStone. When the iPhone
application connects to eUniStone the iAP authentication will be started and handled automatically by
iOS. The accessory needs to contain an MFi chip to be able to handle the iAP authentication.
Depending on which capabilities set in Accessory (eUniStone) with the security command (AT+JSEC),
will be according to the below table.
iPhone eUniStone
2 1 0 1 Pass key is shown on both eUniStone and iPhone. Bonding is accepted on iPhone only.
2 1 1 1 Pass key is shown on both eUniStone and iPhone. Bonding is accepted on iPhone only.
2 1 2 0 Pass key is shown on iPhone. Bonding is accepted by pass key input on eUniStone
2 1 2 1 Pass key is shown on both eUniStone and iPhone. Bonding is accepted on both
eUniStone and iPhone.
Observe that the bonding between iPhone and eUniStone in Table 9 only shows the Bluetooth
bonding and does not involve the complete iAP authentication which is also required when an
application running on the iPhone connects to the Accessory (eUniStone).
To be able to use iAP and the MFi hardware you need to enroll into the MFi program at Apple’s
development site for MFi. You will find the MFi program on the following link https://mfi.apple.com
On that page click the link “Apply now” and follow the instructions. You can either apply for a
developer license or a manufacture license. More information on how to apply and which license that
fits your need can be found on http://mfi.apple.com/faqs
VSUPPLY, VDDUART and VDD1 can be supplied by the same 3.3 V voltage.1
C1 is only need to be placed in case noise is present from the power supply.
All NC pins are internally not connected and can be left open.
Since the internal LPO (low power oscillator) is used by the module then the
P1.5/CLK32 pin can be left open.
Is strongly suggested having test point on P0.12/SDA0 and P0.13/SCL0. These can be
useful for debugging purpose.
A test point on P0.1 or P0.8 is needed for crystal calibration in case the pre-stored
value is lost and for the HCI application for RF Testing.
The line UARTRXD and UARTCTS must remain high during low power mode. If the
host cannot drive them all the time, a pull-up might be needed.
If JTAG interface is not used, JTAG# pin can be kept open (internal pull up). To
enable JTAG interface, a 4.7 k pull down resistor must be put on this pin.
1
If only one voltage supply is used, then the ONOFF pin may not be used. The ONOFF
pin shall be connected to VSUPPLY.
2
No reference level or input signal shall be applied to the module while ONOFF is low.
Output signal levels are not defined while ONOFF is low.
The GPIO pin P0.1 (pin E5) can be used to indicate the connection status. P0.1 is
configured as input pin by default. To use this feature the host must send the AT
command “AT+JGPC=FFFD,0000,0000,0000,FFFD” which configures P0.1 as an
output pin.
UART F4 P0.14 If LPM is not used, this pin shall be pulled up to VDDUART.
UART E4 P0.0 If LPM is not used, this pin may be left open.
UART E6 UARTRXD A 4.7 k pull up resistor can be needed to keep level in LPM.
UART F6 UARTCTS A 4.7 k pull up resistor can be needed to keep level in LPM.
JTAG C3 JTAG# If JTAG interface is not used, this pin can be kept high; otherwise a 4.7 k pull down
resistor shall be used to enable JTAG.
JTAG B3 TMS / P1.0 If JTAG enabled: 4.7 k pull up; otherwise: leave open.
JTAG D3 TCK / P1.1 If JTAG enabled: 4.7 k pull up; otherwise: leave open.
JTAG F2 TDI / P1.2 If JTAG enabled: 4.7 k pull up; otherwise: leave open.
JTAG B3 TDO / P1.3 If JTAG enabled: 4.7 k pull up; otherwise: leave open.
JTAG B4 RTCK / P1.4 If JTAG enabled: 4.7 k pull down; otherwise: leave open.
JTAG C4 TRST# If JTAG enabled: 4.7 kpull down; otherwise: leave open.
In case of using JTAG, the resistors shall be placed on the external JTAG connector.
7 Layout
The PCB layers under the antenna shall not contain any metal.
Place module with the antenna facing the edge of the PCB.
Do not place the other sides of the module too close to the edge of the PCB.
8.7
Min. 15mm 5.00 Min. 15mm
Restricted Area
3.00
Top View
Min. 40mm
Figure 14. Restricted area under antenna and recommended placement on PCB.
Figure 15. Top layer and drill holes of the eUniStone USB Dongle.
On the top layer eUniStone is placed according to the recommendations in Figure 14. Observe that
there is no copper layer under the antenna of the module. A ground plane is spread all over the top
layer making a good ground between all components. The power feeding lines have been made wider
than the signal lines. The signals are routed to through via, which are the cheapest kind of via and
possible to use since there is enough space between the pads of the module.
Figure 16. Bottom layer (from above) and drill holes of the eUniStone USB Dongle.
Most of the signal lines are routed on the bottom layers. Also a ground plane is spread, connected
with via to the top layer ground.
Phase 3: routing.
Figure 18 shows the layers of a general four layer design. In this case, because the number of
connections is very small, no special care is required in this phase:
Bottom layer is used for general grounding and to route the rest of the traces
Micro via: they have a diameter between 50 m and 100 m and can be placed directly into the pads
of BGA and similar components. The availability of this technology must be verified with the
manufacturing factory. Because of the small diameter much PCB’s space can be saved and power and
ground planes are less discontinuous.
Buried via: they are connecting two or more inner layers (for example from 2nd to 3rd layer). The
diameter is ≥ 100 m. Since is not required to drill all the PCB they can help to save space for routing.
Through via: they are drilled from the top layer to the bottom layer, and have a typical diameter of
200-300 m, all the inner layers can be connected to the via. Often are used to connect all the ground
areas in the different layers.
When a trace that carry high current moves from one layer to another, more parallel via are required.
Placing more via reduce the resistance of the overall connection.
Too high resistance in the power trace might lead to a not constant supply in TDMA system where the
TX section is switched on only during the TX slot: when the power section is on, the IC is drawing high
current, which produce a voltage drop in the trace, the supply is AM modulated, which ultimately
might affect all the performances of the IC.
1. Place the connectors in the most rational way considering power distribution and
interfaces.
2. Place the eUniStone module with the antenna on the edge of the PCB.
Place all the other components in order to minimize track length and –if possible- keeping separate
high frequency and baseband sections.
Group and route traces according to their functionality. Start routing high frequency
lines and other sensitive lines.
Minimize the length of parallel routed traces, in the same layers and in adjacent
layer. In adjacent layers orthogonal routing – alternating horizontal and vertical
routed layer – is helpful to avoid capacitive coupling between traces on different
layers.
b. eUniStone has several pins that must be connected to ground. Ideal would be to
connect each pin with the ground underneath through via directly on pin. In
case this cannot be done a trade-off must be found.
c. Remove dead copper. Small ground filling area, not connect to ground through
via, can have unwanted effects. They can behave as antennas, or like a coupling
filter or other kind of unwished effects. For this reasons, if it is not possible to
connect to ground with enough via they shall be removed.
8 Antenna
The manufacturer of the antenna is Murata. The model number is LDA21K.
The antenna having 50 ohm impedance has been matched on the module to have good efficiency, and
enabling the full power of the Bluetooth chip. The matching also assures that the best receiver
sensitivity is achieved.
Even if the antenna is onboard of the module there are some considerations to make for the PCB
layout, see chapter 7.
For testing of the PBA31309 with SPP AT SW 3.x the SPP Toolbox shall have version number 3.02 or
later.
For testing of the PBA31309 with SPP AT SW 3.x the SPP Test Tool shall have version number 2.1.1.0 or
later.
For testing of the PBA31309 with SPP AT SW 3.x the HCI Lite should have version number 3.03 or later.
The Aardvark I2C/SPI Host Adapter is a hardware dongle available through Total Phase. The eeprog.exe
is only available in one version and is not dependent on SPP AT SW version.
After attaching the device to the computer and opening COM port, follow the below sequence.
3. Read BD-data (Note the BD-address to be used for the connection of the CBT)
When the CBT is connected to eUniStone, all control of the RF measurements is done by the CBT over
the air.
Note: Once the HCI application has been loaded to the module, it cannot be reprogrammed
over the UART anymore. An I2C programmer is needed to restore the module with the
standard SPP application.
d. Make a note of the BD_ADDR and Osc_Trim (These will be needed later)
g. Select image of HCI application and click “Download” (See Figure 22).
Read the BD-data using SPP Toolbox (over UART) and make a note of the BD_ADDR and Osc_Trim.
Connect the AARDVARK Programmer and follow the instructions in [4].
When the HCI application is downloaded into EEPROM, issue a HW reset to load the HCI application in
eUniStone.
Note: It is important to read out and note the OSC_Trim value before download of the HCI
application. Since the download procedure will overwrite the calibrated OSC_Trim
value, the original OSC_Trim must be written back into the EEPROM after the download.
The HCI Lite tool provided by Intel allows the configuration for RF transmission tests on the module.
2. Loading latest SPP SW version using SPP Toolbox, described in chapter 9.4.2.
3. Writing back BD address and oscillator trim value using SPP Toolbox, described in
chapter 9.4.3.
1. 2. 3.
Sequence:
1. Send a HCI reset by clicking the ”Reset” button to make sure that the chip/module is
in a known state.
2. Click on ”Send custom command” and paste 0111fc020100 in the command field,
then click ”Send”
3. Once more click on ”Send custom command”, clear the command field and paste
018ffcae90010800000000a600000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000
Click “Send”
After the HW reset, the module will start up running the SPP-AT application, close HCI Lite and start
the SPP Toolbox.
Sequence:
1. Start SPP Toolbox, open the COM port and make a HW reset, ”ROK” is returned.
3. Download the latest SPP-AT application by first clicking ”Production mode” and then
”Download Image”
4. Choose the latest available SPP-AT application file and click ”Download”
6. Check that the intended SPP-AT application is used by “Read Revision Information”.
8. Fill in BD address (BD_ADDR) and oscillator trim value (Osc_Trim) as in chapter 9.3.
At this point the full restore is performed. You can check that the correct SPP-AT application version,
BD address and oscillator trim values are stored in the module by reading them with the commands
“Read BD-data” and “Read Revision Information”.
Shifted TX frequency, which at the end can cause the failure of TX frequency
accuracy test (TRM/CA/08/C initial carrier frequency tolerance).
If the calibrated OSC_Trim value has been lost, the internal crystal must be calibrated again before
performing any RF tests with the module or putting the module into any real application.
The following table shows the capacitance switched by each bit and how to get the value in
hexadecimal notation.
9 8 7 6 5 4 3 2 1 0 Bit
0 0 0 = 0 pF
1 9 F = 6.36 pF
3 F F = 12.76 pF
There are 10 internal capacitances between the pins LOAD and VSS and every bit of the array
represents one of the capacitances. All of them are switchable so it is possible control whether they
are connected or not. With setting a bit to 1 the capacitance is connected.
Table 11 shows 3 examples of a value for the Osc_Trim and the real capacitance. The first example is
the minimum, the second the proposed start value for the tuning algorithm and the last the maximum
achievable value. The frequency gets lower with a higher value of the capacitance array.
The reference signal must be adjusted with a precision that is determined by the total acceptable
deviation of ±20 ppm for the Bluetooth reference clock. The sum of adjustment precision, variation
over temperature and ageing must remain within this range. The best achievable precision for the
reference clock adjustment is ±2 ppm (±64 Hz) for PBA31309.
A frequency counter is needed with a sufficient precision, for example the Agilent 53131A Universal
counter.
ppm
ppm (32MHz) vs Osc.trim
40
30
20
10
-10
-20
0 200 400 600 800 1000
Osc trim (Decimal)
Figure 25. Typical 32MHz frequency offset in PPM versus OSC_Trim value.
With HCI Lite the crystal trimming can be performed easily. The 32 MHz clock signal can be switched to
GPIO pin P0.1 or P0.8 using the HCI Lite tool (see in Figure 26). Then the clock frequency can be
measured by a frequency counter connected to the test pin.
1
6
The crystal trimming procedure using a frequency counter and the HCI Lite tool is as following:
1. Make the 32 MHz clock available at P0.1 or P0.8 using the HCI_Lite tool. (See in
Figure 26)
2. Connect the frequency counter to the appropriate test pin P0.1 or P0.8.
3. The 32 MHz clock signal can now be measured by the frequency counter.
4. Write the trimming value to the Osc_Trim register through the HCI Lite tool. The
start value is 0x19F. (See in Figure 26)
6. When the desired accuracy of the 32 MHz clock is obtained, store the corresponding
trim value to the parameter Osc_Trim of the BD-data. This can be done by clicking
the button “Write BD-Data” in HCI Lite tool. In the pop-up window, only change the
parameter OSC_Trim to the calibrated value and give the module an individual
BD_ADDR. (See in Figure 27)
This is only necessary if the original calibration value, which is programmed during module production
at Intel, has been lost.
3. Issue the following command that makes the internal reference clock available at
the test point (32 MHz generated by the 26 MHz crystal oscillator):
AT+JCAC = <osc_trim_value>,<GPIO>
Where:
b. <GPIO>:
0x0002 to output 32 MHz on pin P0.1
0x0100 to output 32 MHz on pin P0.8
4. Measure the frequency of the signal on pin P0.1/P0.8 with the counter.
5. Trim the 32 MHz frequency to be within ±2ppm (±64 Hz) of accuracy changing the
field <osc_trim_value>.
6. When the desired accuracy is obtained, write the corresponding trim value to the
parameter Osc_Trim in the BD_Data using the command AT+JCBD=<bd_data>.
The SPP Toolbox provides a friendly user interface which enables the user to execute the AT
commands simply by clicking several buttons (see in Figure 28).
6
2
4
10 FAQ
1. 4.
2.
3.
5.
Observe that this needs to be done for each new virtual FTDI COM port. E.g. for each connected USB
dongle.
The module will respond with the complete BD-data. (UART baud
+RRBDRES=083C0E19030000008A0080BA8C01BF020 rate is marked with bold).
67E981F598740FA1218800003040506440C10020400
01102404F2F8FE04B90006000000000000000000
5 AT+JRES Send software Reset to the module to make it use the written BD-
data and new baud rate.
Observe that that the response from the module will be sent on the
new baud rate.
AT+JRES Send software Reset from the host on the new baud rate
OK An OK will indicate that the baud rate has changed. (The OK is sent
on the old baud rate)
10.3 SW update
The software update of PBA31309, has to be done in a certain way to make sure that the correct
Bluetooth address (BD_ADDR) and the oscillator trim (OSC_Trim) values does not get lost in the
process. The software update can be performed by either the SPP Toolbox or with a customer specific
tool or application. In the below table you will find the needed commands and the order of them.
The module will respond with the complete BD-data including the
+RRBDRES=083C0E19030000008A0080BA8C01BF02067 Bluetooth address and oscillator trim value, (marked with bold).
E981F598740FA1218800003040506440C10020400011
Observe that the values are in reverse byte order. The real address
02404F2F8FE04B90006000000000000000000
in this example is 0x0003190E3C08 and the oscillator value is 0x00B9
5 DOWNLOAD THE SOFTWARE The software shall be downloaded by binary writing one byte at the
time until the complete SW file has been loaded to the module.
+RDOICNF The module shall indicate with an event that the software/patch has
been successfully downloaded
ROK The module has now restarted and runs the new software, but with
default Bluetooth address (0003199E8B71) and default oscillator
trim value (0218).
8 Write BD-data with the address and oscillator trim value read out in
+JCBD=083C0E19030000008A0080BA8C01BF02067E98 step 2.
1F598740FA1218800003040506440C10020400011024
04F2F8FE04B90006000000000000000000
9 AT+JRES Send software Reset to the module to make it use the written BD-
data.
When the driver installation started choose to install the driver manually. The driver is found on the
development CD.
Figure 31. Aardvark drivers installed and visible in the Device Manager.
I2C data
I2C lock
GND
Figure 32. Aardvark connect to the PBA31309 USB dongle. (Black = GND, Red = I2C clock, White =
I2C data)
-w Write to EEPROM
This can be overcome by powering the PBA31309 USB dongle with a USB hub
Observe that the USB hub shall not be connected to the computer that Aardvark is connected to.
Also does the USB hub need to be powered so that it can power PBA31309.
11 References
10 Qt Project http://qt-project.org
11 Eclipse http://www.eclipse.org