v1.7 - Jun 2019
15 |
P a g e
$RNC ABC*
(from v11.12) where ABC is the command to send to the RN4677 (or RN4678 if that is
installed). When you send that command to the BlueFly it sends back some serial signals to the
RN4677 in the following manner:
Turns on the BlueFly green LED.
Sends
$$$
to the RN4677, which puts it into command mode. This stops the BlueFly sending
data.
Waits 1000 ms.
Sends
ABC
to the RN4677 followed by the
\n
character. In most cases ABC is an individual
RN4677 command you choose from it's user guide to adjust a setting on the module
Waits 500 ms.
Sends
R,1\n
to the RN4677 to restart the RN4677 and store the setting.
Waits 500 ms.
Turns of the BlueFly green LED.
Restarts the BlueFly.
Second Serial Port
From version 8 a second serial port is available as an input, and from version 9 you can also send
data to it. This serial port exposes UART1 from the PIC Microcontroller. The key parameters are:
Baud Rate:
9600 (by default – see uart1BRG below)
Data Bits:
8
Stop Bits:
1
Parity:
No Parity
Flow Control:
None
Voltage (for TTL):
Nominally 3.0 Volts
The second serial port is set up to receive NMEA GPS sentences and send them out on UART2 (the
standard output). In this way the BlueFlyVario effectively multiplexes the GPS data with the standard
output controlled by the outputMode. This allows the BlueFlyVario to output a single stream of data
which can be read by XCSoar or other applications.
Data received on the Rx line of UART1 is processed in the following way (if the setting uart1Raw is
false). Any series of ASCII characters starting with $ and ending with \n are recorded as a sentence.
The sentence is then scheduled for transmission at the next available 20 ms cycle. Note that it is
probably possible to overload the device with too many sentences. Standard GPS output at 1Hz
(with about five sentences sent each time) seems to work well.
The setting uart1BRG (default = 207) controls the baud rate on UART1. The baud rate is calculated
according to the formula:
Baud Rate = 2000000/(u1)
For the default value of 207 this results in a baud rate of ~9615 which is about equal to 9600. The
integer setting which is closest to the desired baud rate should be used.