6.3.2 UART baudrate negotation
When PIO4, CLK and CMD are all pulled low, BCSP over UART is selected. The speed for this initial
communication should be between 57600bps and 115200bps and must use even parity.
Since the WT21 doesn't know its internal clock frequency nor the baud rate it should communicate at, a form
of baud rate auto-negotiation is implemented on the module. The host needs to send some data packets so
that the WT21 can assess the baud rate the host uses.
Any seemingly non-uniform data can be used but for BCSP sending Link Establishment packets is the natural
choice. Once the WT21 has received enough samples it will start communicating back to the host by replying
to the Link Establishment messages.
Since the H4 doesn't have any link protocol, repeated queries for some known value can be used. Once the
host has started receiving replies for the queries, it can be assumed that that the baud rate has been
established.
Note:
The number of packets the WT21 will need for assessing the baud rate is dependent on the host's UART hardware. With poor
quality UARTs the auto-negotiation may fail, which means the WT21 will use an incorrect baud rate to communicate back. The
host will see this as packets of garbage, i.e. full of crc errors and checksum errors when using BCSP. To restart the negotiation
the host will need to reset the WT21. The host should have some way to power cycle the WT21 to restart the baud rate
negotiation, either by controlling the reset pin or directly the module's VCC.
6.3.3 Loading the PS keys
Once a communications link has been established, BCCMD packets are used to load PS Keys. At least the
following PS Keys need to be set:
Key address
alue Description
&0001 00dd eeff 00cc aabb Bluetooth address (aa:bb:cc:dd:ee:ff)
&01be 01d8 UART baud rate (01d8 = 115200)
&01fe 6590 Chrystal frequency. Do not modify.
&025d 0001 VM disable. Do not modify.
&01f9 0001 Host interface, (0001 = BCSP)
For the host interface the following protocols are supported:
BCSP 0001
H4 0003
H5 0006
H4DS 0007
To activate the changes the command for warm reset is sent to the WT21.
After this the module will immediately reboot using the configured settings and thus switch to the specified
baud rate.
Bluegiga T
echnologies Oy
Page 13 of 1
6