The VNGBOX Serial Communications


HARDWARE DESCRIPTION

Follow the RS232 Schematic as you read this description.

The VNGBOX uses a personal computer or serial terminal to set the clock and frequency control settings. While a PC can be left connected to monitor the performance of the unit, it will of course operate without the PC connected. Much of the available information can be recorded manually from the LCD/PLED display in the unit.

The RS232 signals to and from the PC are at different levels to those in most digital electronics. The idle state is normally -5V to -9V, and the active state +5V to +9V., which are also inverted in sense from the CMOS levels used internally. Thus inverters must provide the necessary signals. The RS232 circuitry runs from +5V and -5V supplies.

Telemetry transmitted from the micro (signal REFTX) goes low when active, and via R5 turns TR1 on. TR1 pulls its collector high, so the RS232 output signal (RS232TX) is inverted. When the micro returns high, the PNP transistor turns off, and the RS232TX line returns to -5V, pulled low by R9. R8 prevents damage to TR1 if the output is shorted to ground.

The telemetry from the unit starts on the UTC second, and takes 20ms to transmit at 9600 bps. It is possible to arrange for the GPS unit to transmit the @@Ea message late (in the prototype it is 250ms late by default), and so it is possible to combine the two signals on the same output without conflict - provided the software in the PC is clever enough to understand both messages! To do this, a link placed in the GPSTX line connects to R6, pulling TR1 on when the GPS transmits its data. The link is provided in order to disable this option. It only works if the PC software can make sense of the messages, and of course if you can arrange the timing to be correct. The Navman Jupiter-T engine does this by default, and other similar modules (such as the Motorola Oncore) should also be useable.

Commands sent to the unit by the PC are inverted by TR2. The idle condition is at -5V to -9V, and D1 catches this negative voltage to prevent damage to TR2. When the PC output is active, the input goes positive, R12 conducts into TR2 base, and the transistor conducts, pulling the collector low and with it the REFRX input to the micro.

The RS232 connector depicted is a DB9F (female) connector, which will correctly operate with the PC is a normal modem cable is used (note - NOT a 'null-modem' cable). Use a panel mount type on the back of the VNGBOX enclosure.

COMMS PROTOCOLS

Serial communications happens in both directions (full duplex) at 9600 bps (9600-N-8-1).

TRANSMIT (DATA)
A single human-readable sentence is transmitted in ASCII, terminated by CR (0x0D) and LF (0x0A). The message takes 25ms to transmit. The unit transmits time, phase and control feedback term every second, starting on the second event. Time can be received over the serial link within 10ms of the UTC second event. The format is:

HH:MM:SS NPPPPFFFFIMBB<CR><LF>
All values except time are transmitted in hexadecimal. Time is in BCD (decimal) format.

The first eight digits HH:MM:SS represent the local time, hours, minutes and seconds. The 'N' is the firmware version number, encoded as ASCII ('N' represents version 4e).

PPPP represents the phase of the local reference sampled by the GPS 1PPS reference. The value of PPPP can be from 0000 to one less than the divisor required from the clock reference to 2 kHz, and is expressed in 16 bit HEX. (Maximum value with a 10MHz reference is 4999 or 1387HEX).

FFFF represents the feedback control voltage, and is a 16 bit HEX number 0 - 4095, and can be interpreted approximately as millivolts. The exact representation is FFFF x 5000 / 4095 mV.

IM is the current mode. 'I' (the most significant bits) represent the integration time in hex. The integration time is (I + 1) x 2. 'M' represents the actual operating mode, 0 - 7 or 8 - F (for inverted operation). The mode commands are explained in the next section.

BB represents eight internal flags which control operation. Only the least significant few are of interest (they are related to GPS performance). The unit also transmits responses to some of the time setting commands.

RECEIVE (COMMANDS)
There are no front panel controls on the clock. After all, it is absolutely accurate and has a backup supply, so what would need adjusting? The local time will need to be retarted by one second when a leap second is added to UTC, and if used to display local time, may need to be changed every six months to allow for daylight saving (summer time). All adjustment is achieved using the serial link to a PC. There are only six commands:

 
Cim	Command to frequency controller
Hnn	Set UTC hours to nn (BCD) hours
Mnn	Set UTC minutes to nn
Snn	Set UTC seconds to nn
+	Add one to UTC seconds
-	Subtract one from UTC seconds

The commands should be used in the order shown while setting the clock. The commands shown in red cause the clock to stop and disrupt phase lock while they are entered, so must not be used during time-keeping. Lower case letters are accepted and used as upper case. Invalid commands are ignored. The controller and clock can be set with a simple ASCII terminal program, such as Windows TERMINAL, or even HYPERTERM.

The 'Cim' command sets the frequency controller mode and integration time. The first value is integration time 'i', and is half the number of seconds between frequency control corrections. The integration time affects the gain (0 = maximum). The value can be 0HEX - FHEX, representing 1 to 31 seconds. Higher values can give better noise performance but less tight frequency control. Choose a compromise which suits your oscillator best.

The second number 'm' sets the operating mode, and is one of:

 
0 Normal (default) differential / integral
1 Proportional+differential / integral
2 High gain proportional (fast settling)
3 Feedback = 0 (maximum frequency)
4 Feedback = centre
5 Feedback = 4095 (minimum frequency)
6 Ramp frequency up
7 Ramp frequency down

If 8 is added to any of these modes (8 - F), the direction of voltage control is reversed. The modes in red are usually only used during initial calibration. If you use the unit as a phase comparator, it won't matter which mode it operates in.

GPS TELEMETRY
The Navman Jupiter-T and Motorola Oncore timing engines use the Motorola Binary Protocol '@@Ea' message, which includes date, time, position, fix quality information, plus the data for eight satellites tracked. The message is 76 bytes long, and so is quite delayed when it is eventually displayed. The PC software REFMON4 provided with the VNGBOX firmware is able to interpret this message, and displays the UTC time, date, fix data and position, making clock setting easy. The VNGBOX does not use the GPS message - it just passes it on.


Copyright � Murray Greenman 1997-2009. All rights reserved. Contact the author before using any of this material.