Monday, March 8, 2021

Readout for the 5S14N

Introduction

The 5S14N is a very versatile sampling plugin for the Tektronix 5000 series scope. While some say it is the little brother of the 7S14 for the 7000 series mainframes, it is actually the other way around. The 7S14 contains the same board as the 5S14N, so far that it actually has the 5000 series edge connector on them, but unused, having an adapter board to connect to the mainframe. The only feature missing from the 5S14N is the readout capability, hence the N suffix.

The slower, 5000 series mainframes do not have readout, but the faster 5400 series do. Since I have a 5440, I started wondering if it would be possible to add the readout, as the way the readout works is exactly the same as in the 7000 series scopes. BTW, the readout is masterpiece of analog engineering, created by Barrie Gilbert of Gilbert cell fame.

After consulting with the service manual, it seemed like a viable idea. Since both plugins are practically the same, except for the mainframe interface, I was hoping that Tek did not produce two version with only a few components missing. There is the readout board, which contains the resistors to program the currents for the mainframe readout circuitry, which is not in the 5S14N, but that didn't seem to be a problem, as that could easily be duplicated. However, if the switch contacts from the timebase or the input attenuators are missing, then there is not a lot of hope. After taking apart the unit and doing some measurements, it turned out that fortunately this is not the case. Everything is there that is needed for the readout. Well, nearly everything, these are the missing components:

  • The readout board
  • Interconnect between the readout and the horizontal board
  • Interconnect between the readout and the vertical switch board
  • Connecting harness between the readout board and the input attenuator switches
  • Connection between the readout board and the mainframe interface

So, let's go trough these items and see what can be done.

The readout board

The readout board is a fairly simple circuit, consisting mostly of resistors, that create the programming currents for the readout in the mainframe. The resistors are switched by the cam switches of the horizontal timebase, the vertical attenuator switches and some other switch, like Ch2 invert, etc.
Additionally, there are some active components to implement the 10x/1x probe readout switching and the readout enable for the enabled channels.
Due to the excellent service manuals from the time this plugin was produced, the schematics are given in the 7S14 manual. Fortunately, the same mechanical implementation can be used, as the board is fastened to the casing of the delay line, which is also the same in the 7S14 and the 5S14N, there is no need to figure out where to put the extra board. Given all this, my approach was very simple: make a copy of the boards.

I used KiCad for the whole process. First, I entered the schematics into ESchema basically copying the one in the service manual. 


The components are simple, the resitors must have the same value as on the schematic, as they control the currents for the readout. For the diodes, the usual 1N4148 or any similar diode is ok.

Substitutes had to be found for the transistors. For Q1 and Q2 I used MPSA14 NPN Darlingtons. Q3 and Q4 PF5101 N jFETs and for Q5 and Q6 2N2222 NPN transistors.

Q5 and 6 have to have Uce above 30 v and Q3 and 4 have to have UGS above 30 V. The later is especially critical, as a lot of jFETs has this voltage lower, they will break down and possibly blow the readout current switch in the scope. There are a lot of devices that may be used, just make sure, you get the pinout right on the PCB, or change the design to suit.

Then design the PCB. The placements of the components are in the service manual, but the layout is not, or at least was not readable in my copy. So I basically used the same placement of the components and then designed the layout myself. There is nothing critical in there and it is simple enough to easily implement on a double sided board, even without using vias.



Once done, it was sent to JLCPCB for manufacturing, and after some time, I had a very nice PCB.
The KiCAD project and Gerber files are available at https://github.com/szigix/5S14N-readout

Interconnect for the horizontal board

This is easy. The horizontal board has the pin headers already populated for the readout so all I needed were a couple pieces of ribbon cable with pin header socket on each end. Unfortunately I did not have the crimp connectors used by Tektronix, so I simply soldered pin header sockets at the end of the cables. I made them a bit longer than what is really necessary, so it would be easier to assemble.

Interconnect for the vertical board

This is similar to the horizontal board, some ribbon cables with socket at the end. Not too easy to plug them into the vertical switch board, but long tweezers and sharp eyes can help.

The only exception is P4 on the readout board, which goes to P4-1 and P6-3 on the horizontal board. Those headers already have connectors on them, but the one pin missing. I found some crimp connector sockets that I was able to insert into the connector housing and used that. All other connectors go to the vertical switch board, which is hard to access, but otherwise pose no problem.

Be careful not to mix P3 and P4 they are both two pin connectors next to each other. Mixing them may blow Q5 and Q6.
 

Attenuator connection

This one is a fiddly job. We need the connection from the attenuator switches, uncal switches and Ch2 invert switch to the readout board. Very very fortunately, the the rotary switches for the attenuators contain the wafer and contacts for the readout. Without them, it would be probably pretty much impossible to retrofit readout. The same is true for the Variable pots, they do have the switches for the uncal indicator, just unconnected. So the task was to figure out what goes where and then how to connect.

The switches are hard to access, but by removing the fastener nuts from the switches and from the gain and the time diff pots, they can be wiggled out to access the connections. I soldered wires to them and after some switching back and forth and checking with a continuity tester I was able to find the pinout. The diagram shows what goes where. The pin names are referencing the names on the 7S14 schematics of the readout board. Looking at the wafer closer to the front of the instrument, there are five solder tabs, two of them are actually between the attenuator resistors. The pin for 2 and 5 are close to each other, so this positively identifies the whole setup. The switches for the two channels are in different orientation when in place, but the pinout is the same.
The "uncal" switches and the Ch 2 invert pushbutton are trivial. 6 wires come from Ch1 and 7 (because of invert) from Ch2. I laced the wires and soldered the connectors onto the other end.

This is the  connection for the wiring. P1 on the readout board is for Ch2:

P1-1 - col
P1-2 - 0
P1-3 - 00
P1-4 - 2
P1-5 - 5
P1-6 - uncal (<)
P1-7 - invert

P2 is for Ch1, be careful, this is not the same pinout:

P2-1 - uncal (<)
P2-2 - 5
P2-3 - 2
P2-4 - 00
P2-5 - 0
P2-6 -col 

This picture shows Ch2 already wired and the wires laced up, see the blue, red, white, green, brown wires soldered to the front wafer. Also, observ the blue wire (col) going to the Ch2 invert switch. Ch1 is still to go, some of the trimmers are removed from the front panel to provide access to the switch. 


The mainframe interface

This is easy, but not very elegant. Fortunately the fingers on the edge connector are there, but they are not connected to anything, just the bare pads. I wish Tektronix had put at least a solder pad next to them. So the solution is to simply solder the wire at the inner end of the connector, bodge wire style. That should do it. Once everything is tested, I will probably put a dab of epoxy there to mechanically stabilize the wires. Be careful no to pinch the wires when the frame holding the rear of the modules are put back.

Fortunately, there are holes that can conveniently be used to access the other side of the connector.

This is how the edge connectors are connected. The first 3 columns show the function of the pin, where Ch1c is Ch1 column current, Ch1r is row current and TS1 is TimeSlot pulse number 1, etc. 
The next two columns show where these are connected on the horizontal boards and the last two on the vertical boards. 10-1 means pin 1 of P10 of the readout board, except the two with the *, where these are connected to P4 of the vertical switch board.
 
Number  A  B     HorizB    Vert A  B
24   Ch2c Ch2r    4-2*  10-1    6-3   6-4  
25   TS3   TS2    10-5  10-4    5-3   5-2
26   TS8   TS9    10-7  10-8    5-5   5-6
27   TS1   TS4    10-3  10-6    5-1   5-4
28   Ch1c Ch1r    4-110-2    6-1   6-2

Putting it all together

So, how all this goes together? Some details are already mentioned above, so here are some general guidelines.

Use thin wires. There are a lot of wires connecting the readout board and there isn't much room below the horizontal board.I used ribbon cable for most of the interconnect and it takes up a lot of space. The best I could do is to loop some of them under the readout board, so they don't get pinched between the board and the cover of the horizontal cam switch cover.

The pin header should be as low as possible, because the pushrods for some of the front panel switches can get in the way.

Since there are a lot of wires, double check that everything is connected properly.



Saturday, February 20, 2021

YATPGPSDO - Yet Another TruePosition GPSDO - Part 3: the firmware

 In the previous part I described the hardware. So now it is time to write about the software.

First let's summarize what the software needs to do. The TruePosition board implements practically all function of the GPSDO, so we don't have to deal with processing GPS messages or implementing frequency counting or anything else like that. Except for one thing, the TruePosition board would only need power to operate. The one thing is that it won't boot without getting the $PROCEED command via its serial interface. So the bare minimum software is something that send this command and stops. But, of course that is not enough. I want a cool instrument with blinkenlights!

I have to admit that the firmware for this instrument was developed/evolved during some time, while simultaneously learning TruePosition, STM32-Arduino and the u8g2 graphics library. As a result, the code quality is far from best.

Design goals and features

I came up with some design goals and required features for the software:

  • Implement basic functions to drive the TruePosition board. Sent the startup command and any additional configuration command. Monitor status of the board.
  • Provide a usable, concise and aesthetic user interface. Provide means to get detailed data but also have a 'quick glance' way to see the current state.
  • Provide configurable option for timezone, display backlight and position.
  • Be robust. The instrument should tolerate and if possible recover from any issue and notify the user on them.

Basic structure

The development environment was the Arduino implementation for STM32. I initially though that the simple Arduino structure of setup() and loop() was not going to be enough, and I would need to step up to some more complex solution such FreeRTOS, but eventually it turned out to be sufficient. 

The basic structure of the firmware actually very much follows this pattern. After setting up the display, serial lines, etc. it goes into a loop, where it reads character from the GPSDO, detects key presses, handles timing and updates the display and LEDs if required. If enough character is read so that a complete message is received then it is processed. Same for the key presses.

The main loop checks if messages are received from the TruePosition. If they do not appear for a length of time, then the GPS lost message is displayed and the Fail LED is lit. This should not happen in normal operation unless the board stops working or the serial connection is disconnected.

If the boot message is received, the firmware send the $PROCEED command to initiate the booting and waits for the first $STATUS message at which time the GPSDO is considered initialized. 

The User Interface

For main user interface there is a 128x64 pixel bitmap LCD. Obviously a much simpler display would also work, but it looks cool. Incidentally the bulk of the code is about creating the pages for this LCD.

There are two buttons, the Mode and the Select. The Mode button cycles between the pages. On some of these pages the short press of the Select will chose between options and the long press will activate that option. Finally, there are four LEDs. One is for power, on the left side of the front panel, which is always green as long as the device is switched on. The other leds are on the right to the display. The green LED indicates the Locked state. So if there are two green then he GPSDO is locked and operating properly.  The next LED is yellow, which is on if the GPSDO is in Holdover. Finally the red LED indicates fault condition, like disconnected antenna. Additionally there are other states and transitions, like startup or acquisition indicated by blinking and/or combinations of the LEDs.

These are the display pages.

1 - General status page. This is the default page. The status bar shown the current status (such as locked, holdover, etc.). There is an icon to indicate whether the TruePosition is in normal or survey mode. An antenna symbol shown that an antenna is detected and finally there are two indicators for the operation of the 10Mhz and 1PPS output. Although I have never seen the GPSDO board indicate that these are not operational. 

The current time is displayed, as well as how long the device has been locked or in holdover.

Finally at the bottom the number of satellites tracked, the DOP value, the control voltage for the oscillator and the temperature is shown. 

2 - The next page is the clock page. Current time and date and the quality of the timing is shown as well as an analog clock.


3 - Then comes the satellites page. The left shows the constellation and on the right the list of satellites. SNR is a small bargraph in front of each satellite data row in the list. 

4 - The position page comes next. Latitude, longitude, elevation and number of satellites are displayed. Pressing the Select button increases the survey time while long press of the same button initiates a survey.

5 - The final page is the configuration page. Short press of select cycles trough the lines and long press changes that line. Yes, it is not the most ergonomic solution.


The first line sets the time-offset from -12 to +12 hours. The next sets the backlight to always on, always off and automatic.  These settings are not persistent, unless saved using the Save config line. The last line is 'Load last position'. When the configuration is saved, the current position is saved. However, as opposed to backlight and timezone offset it is not automatically reloaded at startup. Instead this menu can be used to load the position, to speed up acquisition.

The source code and the KiCAD files are available under GPL V3 on Github: https://github.com/szigix/YATPGPSDO



Sunday, February 7, 2021

YATPGPSDO - Yet Another TruePosition GPSDO - Part 2: the hardware

The hardware for the GPSDO is very simple. There are two main parts: the power supply and the microcontroller.
All the design was done with KiCAD, design files will be shared in the last part of this series. 

The Power Supply

The power supply is nothing special. The TruePosition board needs 12V, with a peak current of 0.5A, which will decrease somewhat once the oven is warm and the heater switches off. The microcontroller and the display needs 5V with less than 100mA.

This does not need anything extraordinary. I already had nearly everything for the power supply, a 230V/12V transformer, bridge rectifier, capacitors and a 7812 and 7805 regulator. The only component i had to get was the connector/fuse holder/switch to the back.


The microcontroller

The controller part is similarly simple. There is a socket for the STM32 and there isn't much else. Two pushbuttons, four LEDs, three of them connected to the controller. There is also a transistor to switch the LCD backlight and one pot for the LCD contrast voltage. And a couple of headers for connecting all this.

The PCB

The PCB was designed to fit the available space in the instrument case. The transformer and the line voltage parts are on the left, carefully spaced for safety. The power supply is in the middle. Initially I wanted the regulators to go on the backside of the instrument for cooling, so they are both on the edge of the board, but later decided to use a heatsink, so they are connected via wires from their original place. Finally the right side hosts the controller the other small parts and the headers for the display, LEDs, etc. 


Manufacturing was done by JLCPCB, This is the finished board.

Assembly

For such a simple circuit, there wasn't much to get it working. I first populated the power supply part, and made sure that it works as intended. Getting into the case was easy, since the PCB was designed to fit perfectly. There was some fiddly work to get al the wires to the LCD, LEDs and switches, but eventually everything was there. I was considering putting pin headers everywhere, but then decided to simply solder the wires in place. I don't think I ever want to disassemble it and everything is accessible from above as well as from below.
I plugged in the STM32 and tested that it runs and drives the LCD properly. Then finally I connected the power and serial lead to the GPSDO.

It worked without any issues, although the software was far from completed at that time. The BluePill can be programmed in circuit, so I could now concentrate ot the firmware, it was actually easier to do testing in the assembled instrument instead of some breadboard state of completion. I used ST-link V2 to program, but the serial pins are also there on the PCB if someone uses serial programming. 
The next part will describe the software.




Friday, February 5, 2021

YATPGPSDO - Yet Another TruePosition GPSDO - Part 1.

Introduction

As promised in the teaser I am giving a detailed description on my version of the TruePosition GPSDO and releasing the design files.

This is the first part of a series, with the general description of the project, concentrating on the mechanical design. The next part will contain the electronics hardware and the third part the software component.

Why another GPSDO?

First let me give some justification for the project. There are already a ton of GPSDO projects on the net, and one can buy ready made units from all price segments. There are versions specifically for hobbyists, such as Leo Bodnar's unit or the BG7TBL frequency reference.  So why create a new one?

Well, first because it is a fun project, and second, because it is a fun project. I had a TruePosition boards hanging around. I got it years ago from eBay and they are still available for cheap. I did use it for adjusting counters, but by itself it is a pain to use, as it needs power and it needs some kind of a computer to control. Initially I looked around for designs, which there are plenty, but then I decided to spin my own. I wanted to use as many components from my drawer as I could, but I also had the goal to create a standalone unit, which only needs power to run. So after looking around of what I have and what I can use for this project, I came up with the following list of requirement.

  • Built in power supply. There are already more power bricks around than what I want, so let's not have even more. The case will be larger, and one needs to be careful with the line voltage, but that is OK. I already had a suitable transformer, voltage regulators and most important a case that seemed to be large enough to fit everything.
  • Have a simple, but informative user interface. I had a 128x64 pixel graphical LCD, which is probably an overkill for this, but hey, it doesn't really make anything more complex, except for the software. But that can even be updated later and it looks cool. However, I also wanted some status LEDs to check the status at a glance.
  • Be a standalone unit, it should just works without any external intervention or connection. 
  • Use an STM32 BluePill for controller. I have a bunch of these cheap units so why not use one. This looked to be a good learning project, as I have not really used the STM32 before.
  • No computer interface. I just don't need it right now, but I did keep in mind to have the possibility of maybe later adding it in the form of a serial or USB port.
  • No distribution amplifier. It would make sense, but I decided to build a separate amplifier once I need one. This is going to be a 10Mhz / 1PPS reference only.

General description

Let's go from outside to inside. Probably the hardest part of hobby projects is to have a nice casing for whatever one builds. At least for me it is definitely the case (no pun intended). I guess if I had a machine shop, this would make it easier, but I don't, so...

Not all is lost though, fortunately ready made cases can be bought in every shape and form or old instruments can be repurposed. I was lucky, I had an unused case, which was originally destined to host a small power supply, but it never happened. It is approximately a 20x20x8 cm size quite good quality aluminium case, so all components should fit comfortably.

It was important to find a case first, as it determines the PCB design so it is easiest to mount it inside.

The front contains the 10Mhz and 1 PPS outputs, two buttons for control and 4 LEDs for power (green), lock (green), holdover (yellow) and failure (red) and of course the LCD. Which required a lot of careful filing to fit. Sometime I will need to create labels for all of theses to have a really professional front panel.

The back has an IEC connector, switch and fuse and the MCA connector for the GPS antenna,

The inside contains the main components. The TruePosition board is front left. It's size is given, so everything else is based on it. The boards are supported by spacers on aluminium L profiles fastened to the side rails of the case.

The display, the LEDs, the buttons, and the connectors are all on the front pane.  I used ready made cables with the proper SMB connectors.

And finally, the main topic of this blog post: the power and controller board, which is placed aft in the case. It is one board with the power supply on the left. There is the large black transformer, and the STM32 on the right with some additional components. I designed the board to fit into the remaining place, so there wasn't really any problem with component placement. The display, buttons and LEDs are connected with pieces of ribbon cable.

The two voltage regulators were originally go onto the back, but I found a heatsink in my junk drawer that fit perfectly between the profiles holding the TruePosition board, so the regulators went to the front right. The heatsink is a bit overkill, but one can never go wrong with larger than required cooling.

So that is about the mechanical aspects of the unit. Of course everyone will need to adapt to whatever case and components they have.

In the next part I'll describe the design of the power / controller boards. See you soon in Part 2.



Thursday, January 28, 2021

YATPGPSDO - Yet another TruePosition GPSDO - a teaser

The TruePosition GPSDO board used in telecom equipment is a cheap solution to have a GPS controlled frequency reference. It is usually available on eBay for cheap. EEVblog has a buch of forum topics around it, so it is quite well understood.

It is a standalone GPSDO in the sense that it implements all GPSDO functions, it needs a GPS antenna and has outputs for 10MHz and 1PPS.

However, it is not standalone in the sense that it needs a little bit (or a lot, if you are so inclined) control. At the very minimum it needs a startup command sent via its serial interface to boot. Once booted, it will work all right, but there are a lot of other function that can be controlled, like position survey, satellite data, time, etc.

So since everyone seems to be doing it, I also decided to build my own GPSDO based on the TruePosition boards. I used a cheap STM32 BluePill board for controlling, a 128x64 bitmap LCD and buttons for user interface and yes, it even has a case and built-in power supply!

This was actually a learning project for me with STM32 in the Arduino environment. So the quality of the code reflects this at some places :-)

The hardware was design with KiCAD.

Once I tidy up the design documentation a bit I will release the blueprints and the software. Until then watch this place and look at the teaser pictures below.


 



Thursday, August 27, 2020

YAO - Yet Another OCXO for the HP 5316A counter

The HP 5316A is a nice little counter. Well, not so little, it is housed in a deep case, but certainly not a 5335A sized beast.

I have one which I originally built from two non working units sourced from eBay. It has Option 003, which is the 1.3GHz channel C, a useful option. However, it does not have a high stability timebase. Option 001 is the TCXO and Option 004 is the OCXO. It has neither, just a simple quartz oscillator. While it is not impossible to find the OCXO option on eBay, it is certainly not economical to do so due to its price. It usually costs way more than the base instrument itself. Furthermore, it is a bulky unit, with the power supply board and the oven being two separate units. I wouldn't even bother with it, as I already have plenty of counters with ovenized references and I have a GPSDO anyway. But, I had a Bliley 47A1282 OCXO laying around in my junk box. So why not use that to replicate Opt 004 and have a counter that can be used outside of the lab. 

I'm not the first one to venture into this project, there is a whole thread on EEVblog on this. I could have taken one of the designs there, but due to the different OCXOs, availability of parts, etc., it would have needed redesign anyway. So, why not start the design from scratch, it is a nice little project for those rainy evenings.

The requirements I set were fairly straightforward:

  • Use common parts, and of course use the OCXO I already have.
  • The design should be electronically compatible with the counter, and
  • it should also be mechanically compatible, including connectors, fastening and access for adjustment.

These are not hard to meet. The design is very simple. By looking at the service manual of the 5316A the connector pinout is available. Basically the only thing required besides the actual OCXO is a power supply. The counter provides around 7.5V standby voltage. However, the OCXO module is running on 5V. This is solved by a simple 5V low dropout regulator, I used a L4941BV. Especially during the warm up, the OCXO can consume up to 500mA, so to be on the safe side a small heatsink is required on the regulator.

Other than the supply, there are two additional components on the board. One is a 12 turn pot for the fine tuning of the frequency and the other is the 50ohm (R1 and R2) termination for the 10MHz out, as required by the datasheet of the OCXO.

The schematic was drafted in KiCAD.

KiCAD was also used for the  PCB design 

The PCB was designed to mount the same vertical way as the original oscillator boards, using the same L shaped brackets and right angle pin header. The tuning pot is placed in such a way, that it is accessible via the hole on the backpanel, so one can do closed cased adjustment for better thermal equilibrium. Although in practice, due to the long distance, it is quite fiddly to be able to access the very small screw on the pot.

I got the PCB manufactured by JLC PCB, they did a good job.

 

 After soldering all the components, verifying that the regulator is working as intended I installed the boards, which worked at first try.


I did successfully adjust it to my GPSDO, which is a good sign as it means the OCXO module is not outside its nominal frequency. (Of course that was verified in advance.)
There is the new Opt 004 in the top left corner of the picture, next to the HPIB interface boards.
So far it has been working fine, I will sometime check how much it drifts.


Monday, August 24, 2020

Completing Opt 004 on the 5342A

Continuing from Part 1
I got all the required components and based on the schematics and board layout in the service manual, I simply installed all of them. I was trying to make it look as original as I could, so I even used proper push on pins for the additional connection of wires (though I did not have gold plated ones, bummer), and in general, used parts that fitted well to the footprints on the board. 
This was quite simple. A handful of components to the A2 display board and a couple of wires from the backplane to the board. An hour later I had the finished board.
The new components are on the right. The DAC80-CCD-V chip is evident. There are the four TTL ICs next to the DAC to the left. Some resistors and trimmers on the upper right and the SMB connector for the output just below the DAC. The empty socket is for the connecting cable to the mainboard.
That is all for the display board.
Three wires are needed from the backplane to provide power (+- 15V) to the DAC and to provide the LDA signal for the CPU access. 

Also required a run of coax cable from the SMB socket to the BNC connector on the backside of the instrument (upmost BNC on the picture).



All components were installed, the wires connected and secured. Then I hooked up a multimeter to the DAC out, gave some signal to the 5342A to count and hit the DAC button. I got a voltage out which was about right. Promising start, so I did the adjustment procedure described in the service manual. Basically the offset and the gain pots had to be adjusted to get zero and 9.99V out for 000 and 999 counts at the specified digits. 
The video shows the somewhat useless demonstration of selecting the drifting Hz digits for DAC source. The voltage is accurate and sometimes it can be seen that the digits are probably entered sequentially into the DAC, the Fluke 87 is fast enough to do a measurement between the update of the most and least significant digit.
It is also good to know that the DAC will convert any digits to voltage, so if the unit is equipped with Opt 002 for RF level measurement, one can hit AMPL for the dBm display and then do a SHIFT-DAC-9 and the DAC output will provide the dBm level, though without the sign for negative values. But still, this could be useful
So to summarize, it is possible to retrofit Opt 004 to the HP 5342A counter. There is only one special part required, the DAC, but even that can be sourced easily. All other parts are common and readily available.