Enhanced features for  the HP Z3801 GPS locked frequency source

 Dave Robinson G4FRE

 Introduction

 I have owned an HP Z3801 since they started appearing on the surplus market a couple of years ago. While they do an excellent job of producing a GPS locked 10MHz signal, it was felt they could be made more useful.

 As supplied the units are controlled via RS422 through the 25 pin connector. The interface can easily be changed to RS232 (1). The control software is supplied by HP is a custom program called SATSTAT which runs on a PC. This program is considerably more complex than a terminal emulator (figure 1). Alternatively the GPSCON ((2) as shown in figure 2) programme also provides this functionality, with the additional facility to log data, produce trend plots; even putting them real-time on the internet!. With either program the quality of the 10MHz lock, number of satellites, status and  time amongst other parameters can be seen, but it does tie up a computer that could be doing more useful things. Of the data provided the most useful information is the valid time. It would therefore be nice to have a large 6 digit 7 segment on the front panel with the UTC time, to allow accurate schedule timing

 The lack of an NMEA string output from the Z3801does prevent the unit being used with NMEATIME (3) to lock the shack computer  to UTC time. This is useful for correct timing during WSJT schedules (4).  It would be nice if the unit could produce a $GPGGA string with sufficient information for use with NMEATIME and similar PDA based programs. 

 A technique for providing both of these features is the subject of this article.

 Preliminary Investigations

 Looking under the PSU board in the Z3801, it was found that the GPS board was a Motorola unit with the 10 pin standard interface. Hooking up pin 8 of the GPS header via a MAX232 level converter to hyperterminal program at 9600 Baud showed that the main Z3801 PCB was sending commands to the GPS unit continually and the board was responding. The data was Motorola binary format (not ASCII)

Amongst other strings, an “@@Ba” string was produced once per second, however no definition of this string could be found in the Motorola binary reference documents to determine its format. Since publishing this article Brian Kirby emailed me the definition @@Ba. During the initial development it was found that the closest defined binary string was the @@Ea where the bytes were arranged as follows

 @@Eamdyyhmsffffaaaaoooohhhhmmmmvvhddtntimsdimsdimsdimsdimsdimsdimsdimsds CR LF

 Date

m month 1..12  

d day 1..31  

yy year 1998..2018

Time

h hours 0..23

m minutes 1..31

s seconds 0..60

ffff fractional second 0..999,999,999 (0.0..0.999999999)

t num of satellite tracked 0..8

 All the needed information for a clock could be extracted from this string, and as an added bonus the date was also available. The number of satellites tracked byte (t) would be used to determine if the time was OK. When the Z3801 does a cold start the clock starts at 1/1/98 1200 (bad if the computer sets the clock during this period!) but it was found by simultaneously using SATSTAT and hyperterminal that the clock was good when t was 3 or higher. It was also noted that the time in the @@Ba string was always UTC, irrespective of whether SATSCAN set it’s time output to GPS or UTC time (currently 14 seconds offset)

 Design

 Previous microprocessor projects (5)(6)(7) have used PIC microprocessors from Microchip (8), so they were used again as the development tools were available.  The facilities offered by these chips have increased considerably since the original keyer applications, features such as UARTS, SPI interfaces, EEPROM;  the question was which features were needed.

 The next task was to identify suitable displays.  No suitably sized 6 digit displays could be found, so a pair of 3 digit 7 segment plus right hand decimal point multiplexed displays were found (9). To drive the 7 segments plus DP of all 6 digits would require a PIC with 14 output pins and a lot of processing to do the multiplexing

After doing a web search a Maxim chip (MAX7219) was discovered (10) which had an SPI  3 pin interface (thereby only requiring 3 PIC I/O pins) had onboard multiplexing and could drive up to 8 Common cathode digits.

 To satisfy the PIC requirements a 16F628A was chosen. Chips were available that had both SPI interfaces and onboard UART, which would have been ideal BUT what you need to dig out from the datasheet (11) is that both cannot be used together in the same application as both use the same pins, which cannot be changed. Hence a cheaper PIC with just an onboard UART was chosen and the SPI part was done using onboard software (sometimes called “bit banging”).  Flash versions of the chips were chosen as they can be electrically programmed many times, very useful in the development stages.

 The circuit diagram is shown in Figure 3, the associated component list is shown in Table 1. A spare section of the RS232 level converter chip was used to buffer the 1PPS output of the GPS board and provide it on the RS232 pin 6, for possible future use.

 Software development

 The software was developed in assembler using Microchips MPLAB IDE version 6.60 (8). The Olimex PIC-ICD2 (12) MPLAB compatible in circuit debugger was used in conjunction with MPLAB IDE to debug the programme. The chips were finally programmed using Microchips PICSTART+, which had to be upgraded to program these new chips.

 Maxim provides an application note on their web site (13) using a PIC to drive a MAX7219 in a LED display thermometer, which made writing the SPI interface easier.

 The 16F628A has an onboard 4MHz RC clock, which was initially used to save component count and cost. However it was discovered, by witnessing corrupted received data that this clock was not stable enough. Therefore an external 10MHz crystal clock is used; since this change no further problems have been encountered.

One software issue that initially caused concern  was the UART Baud rate The incoming binary data is at 9600 Baud. However the  NMEA data, as per specification is at 4800 Baud. Experimentation revealed that this is not a problem for the PIC, as the board rate clock for the 16F628A can be changed while the program is being run. The baud rate is set to 9600, the binary data is read into the PIC and stored. The baud rate is set to 4800 and the NMEA data is sent. The process is then repeated.

 As the date information is read into the PIC before it gets to the time information it was decided to have the option to display the date on the front panel. Date or time is selected with a SPDT switch with a centre off position. The third position is used to blank the display. To save space here (program is around 400 lines of assembler), and allow revision control, the final software will be distributed to interested parties as a .HEX file to allow the 16F628 to be programmed. (15)

 
Construction  

To enable the board to be squeezed on the front panel below the existing LED status board, it would have to be double sided, with plated through holes. This was beyond my production capabilities so following the guidance of Paul Wade W1GHZ, boards were designed and made by Expresspcb. (14) The PCB is designed using their supplied software, the design is submitted via the web and the boards arrive 3 days later. The final board size is 3.75 x 1.75”.  A view of the front of the assembled PCB is shown in Figure 4, the rear view is shown in Figure 5.

The two displays are mounted on one side of the board along with the chip components. The Integrated circuits, electrolytics and crystal are mounted on the other side, thus allowing the board to be directly mounted on the front panel. The PIC is mounted in an 18 pin socket to enable any future software updates. Input signals and power for the board are extracted from the GPS board by a length of screened  cable soldered directly to the appropriate pins.. The handle on the front panel was removed as it would obstruct the display. A 175x18mm cut out was made in the front of the chassis and the front panel, (just large enough to show the digits).  Four 4-40 clearance holes were made in the chassis (but NOT the front panel) aligning with the four holes in the PCB and countersunk. The board was held in place against the front panel with four countersunk 4-40 screws and spacers.

A hole is filed in the back panel for the 9 pin connector for the NMEA output as shown in Figure 6. The photograph also shows the IEC connector for the AC supply for the internal 48V PSU. The modified front panel is shown in Figure 7.

Operation

When the Z3801 is powered up all the digits on the display are blanked except for the right-hand digit which indicates number of satellites acquired. Three Decimal points will flash on and off  to show that GPS valid data is being received from the GPS board.  The switch has no effect at this time. When Three satellites (or more) have been acquired the display will then show UTC time. Date may be displayed by putting SW1 in the Date position, or the display blanked by the other SW1 position.

When the time is invalid an NMEA string of the following format is output:-

$GPGGA,,,,,,0,00,,,,,,,  (The “00” value changes to show the number of satellites acquired.)

When the time is valid an NMEA string of the following format is output.:-

$GPGGA,172330.00,,,,,1,05,,,,,,,   (The “1” indicates that the output time is valid, 05 five satellites.)

These minimised GPGGA strings (without checksum) have been found adequate for correction operation of NMEATIME.

Future Developments

The project has achieved all the aims originally set. By slightly altering the software the same PCB could be used to make a digital clock from the cheap OEM GPS modules that were available a few years ago in the Dallas area. This will be written up at a later date.  Details on obtaining Programmed PICs, PCB’s and complete kits from the author will be found at (15)

References:

1.    http://www.ad6a.com/Z3801A.html

2.    http://www.realhamradio.com/gpscon.htm

3.    http://www.visualgps.net/

4.    http://pulsar.princeton.edu/~joe/K1JT/

5.    http://g4fre.com/keyers2.htm

6.    http://g4fre.com/intelli.htm

7.    http://g4fre.com/dtmf.htm

8.    http://www.microchip.com

9.    http://www.fairchildsemi.com/ds/MS/MST6941C.pdf

10.           http://pdfserv.maxim-ic.com/en/ds/MAX7219-MAX7221.pdf

11.           http://ww1.microchip.com/downloads/en/DeviceDoc/40044b.pdf

12.           obtained from  Sparkfun electronics, http://www.sparkfun.com

13.           http://www.maxim-ic.com/appnotes.cfm/appnote_number/917

14.           http://www.expresspcb.com/

15.           http://g4fre.com/kits.htm

Table :1 Component Listing

R1              10k 0805 size SMT (DK 311-10.0KCCT) (increase value to dim display)

U1               PIC16F628A 18 pin DIL (DK PIC16F628A-I/P-ND)

U2              MAX7219 24 pin DIL (DK MAX7219CNG-ND)

U3, U4        MST6941C 3 digit common cathode display (Mouser 512-MST6941C)

U5              MAX232CPE

X1              10MHz 18pF crystal HC49US (DK 300-6021)

C1,C2        18pF 0805 size SMT (DK 311-1102)

C3                0.1uF ceramic 0805 SMT

C4                10uF 16V Tantalum SMT

C5,6,7,8     1uF 35V tantalum SMT (DK 478-1671-1-ND)

SW1           DPDT centre off (DK 360-1257-ND)

S1               18 pin IC socket for U1 (optional)


Figure 1: SATSCAN Display Screen

Figure 2: GPSCON Display Screen


Figure 4: Assembled PCB: Front view

Figure 5: Assembled PCB rear view

Figure 6: Photograph of finished unit: Rear Panel

 

 Figure 7: Photograph of finished unit: Date display (European format shown, USA format available)

  

 

Last modified 23 Oct 2006