QTFM Serial Communication

This page provides information on the command structure and port settings for communicating with the QTFM. This is normally performed automatically by the QuSpin user interface, but the simple communication also allows for full access using a terminal emulator.

Figure 1: Windows Device Manager showing a list of USB Serial Com Ports devices.

This page last updated on May 16, 2017.

The QTFM electronic control unit (ECU)  accepts serial commands from a computer through a USB virtual Com port using the provided Power/Coms board (USB-UART bridge), or by directly accessing the UART Rx and Tx lines from the ECU. A simple terminal emulator (such as Tera Term or minicom) can be used to fully control the mag and stream data. The USB bridge uses the FT232RL chip. If drivers are not loaded automatically through Windows, they can be downloaded here.

Serial port settings:
Baud rate: 115200
Data: 8 bit
Parity: none
Stop: 1 bit
Flow control: none

Terminal new-line:
Receive: CR
Transmit: CR+LF

The digital stream from the sensor electronics is classified into three types, delimited by the first character as described below.

# Sensor status and response messages
* State indicator star code indicating state of magnetometer and corresponding to the light sequence on the ECU
! Magnetometer digital data output.

The magnetometer data is sent as lines of ASCII text and is delimited by the ‘!’ character with the line terminated by the carriage return and linefeed characters (\r \n). The composition of the data line changes to include more data at slower decimation times. Decimation modes range from 2 to 11. The table below shows the data line format for different decimation modes.  The magdata value is converted to nanoTesla by dividing by 6009.342147 (or alternatively multiplying by 1.664075660e-4).

Dec. mode Data Format
2 !magdata\r\n
3 to 5 !magdata@signalstrength\r\n
6 to 11 !magdata@signalstrength^cyclecounter\r\n

The following table provides a list of single-character ASCII commands for operating the QTFM (case sensitive).

Command ASCII Decimal Comments
Auto Start > 62 Initiate the automated sensor startup routines
Change Data Rate o 111 Cycles through data decimation time according to T = 6.144e-4 seconds *2^x where x cycles from 2 to 11
Coms check ! 33 Reports back as "#Check"
Data Rate Announcement p 112  Query decimation time. Returns time in seconds
Serial Number Announcement q 113  Query serial number of the magnetometer
Star Code Announcement r 114  Query current star code/magnetometer state
Firmware Announcement s 115 Query firmware version loaded on the ECU
Manual RF Lock On B 66  Manually activate RF lock
Manual RF Lock Off C 67 Manually deactivate RF lock
Line Filter On y 121 Apply a line filter at 50 Hz and 60 Hz. Not recommended for taking data
Line Filter Off z 122 Remove 50 Hz and 60 Hz line filter
ISR On a 97 Restart ISR
ISR Off b 98 Disable ISR
Zero cycle counter ^ 94 Resets the cycle counter to zero
Reset Mag _ 95 Reboot the ECU

Commands to change startup conditions: These should be issued through a terminal program following ISR Off command
~sup0 Magnetometer starts up in dormant unlocked mode
~sup1 Magnetometer powers up and begins autolock procedure
~drt'x' Change default decimation time from startup. 'x' represents a number starting from 2 with decimation time according to T = 6.144e-4 seconds *2^x.

The following table provides a description of the star codes that represent the current state of the magnetometer, reflected by the LED pattern/color on the ECU.  Star codes messages are ASCII strings sent by the ECU over the serial com with the following form: “*” followed by a number from 0 to 5. They are sent upon state change of the magnetometer or can be queried with the single-character command ‘r’.

Star Code LED State Indicator Description
*0 Red flashing laser off
*1 Red solid laser on
*2 Green flashing laser locked, rf unlocked, cell unlocked
*3 Green solid laser locked, rf locked, cell unlocked
*4 Blue flashing laser locked, rf unlocked, cell locked
*5 Blue solid laser locked, rf locked, cell locked