Aug 10

10MHz Rubidium Frequency Standard and Signal Distribution Amp Follow-Up

This is a follow-up to my previous article here. When testing the 1 PPS output I found some strange output which needed further investigation. I also decided to make further use of the micro controller and status LED to indicate the 1 PPS signal to provide a degree of visual confidence that the frequency standard was working.

Various Pictures

IMG_5966.JPG
IMG_5966.JPG
IMG_5965.JPG
IMG_5965.JPG
IMG_5964.JPG
IMG_5964.JPG
IMG_5963.JPG
IMG_5963.JPG
IMG_5962.JPG
IMG_5962.JPG
IMG_5961.JPG
IMG_5961.JPG
IMG_5960.JPG
IMG_5960.JPG
IMG_5959.JPG
IMG_5959.JPG
IMG_5958.JPG
IMG_5958.JPG
IMG_5956.JPG
IMG_5956.JPG
IMG_5957.JPG
IMG_5957.JPG
IMG_5954.JPG
IMG_5954.JPG
IMG_5955.JPG
IMG_5955.JPG

The 1 PPS Channel
Here is the outline schematic of the digital channel of the video amp that is now used for the 1 PPS signal.

The fast comparator used in this circuit is an LT1016

The Micro-controller
When I first tried to implement this I used (or tried to use) the edge trigger interrupt capability which on the face of it should have been the perfect solution. However, no matter what I tried I could not get it to work, the best I managed to achieve was getting it to work some of the time, but it was very random. I suspect this was down to the way in which the PIC12X handles interrupts and context state saving implemented by the compiler, I read somewhere on the microchip forums that this issue *could* be resolved by upgrading to the PRO version of the compiler…..hmmmmmmm. Anyway, I decided to change tact and poll for the 1PPS signal which meant I also had to construct a really simple pulse stretcher circuit to ensure I was able to catch each pulse. Not as elegant as an interrupt-driven solution but it works. I think the more advanced PIC18Fxxx series micro controllers would have worked using interrupts but those are big chips and I was already committed to the PIC12F675.

Here is the schematic for the micro controller which now also monitors the 1 PPS output of the RBS. The shaded area is what has been added to the circuit since the previous article.

Here is the firmware source code with the 1PPS implementation added. Its implemented as a simple state machine in run mode, I have tried to keep the code simple to read.

#include <xc.h>

// PIC12F675 Configuration Bit Settings

// CONFIG
#pragma config FOSC  = INTRCIO  // Oscillator Selection bits (Internal oscillator: GPIO on GP4/GP5)
#pragma config WDTE  = OFF      // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF      // Power-Up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = OFF      // GP3/MCLR pin function select (GP3/MCLR pin function is digital I/O, MCLR internally tied to VDD)
#pragma config BOREN = OFF      // Brown-out Detect Enable bit (BOD disabled)
#pragma config CP    = OFF      // Code Protection bit (Program Memory code protection is disabled)
#pragma config CPD   = OFF      // Data Code Protection bit (Data memory code protection is disabled)

// IMPLEMENTATION STRATEGY
//
// PIN ASSIGNMENTS
//   2 = RFS_RDY signal from Pin 6 (GPIO5)
//   4 - 1PPS signal
//   5 - Front Panel LED
//

// We are running the chip at 4Mhz
#define XTAL_FREQ 4000000

#define CLK_1PPS GPIObits.GPIO4
#define LED_STATUS GPIObits.GPIO2
#define RFS_READY GPIObits.GPIO5

void main(void)
{
    // Used as LED state machine control variable
    char _led_state = 0;

    ADCON0bits.ADON = 0;    // Turn off the ADC
    ANSELbits.ANS = 0;      // Make all inputs digital
    VRCON = 0;              // Turn off the internal voltage reference
    CMCON = 0x7;            // Turn off the comparator

    // Set up our I/O pins
    TRISIObits.TRISIO2 = 0; // Make GPIO2 an output - LED
    TRISIObits.TRISIO4 = 1; // Make GPIO4 an input - 1PPS counter input
    TRISIObits.TRISIO5 = 1; // Make GPIO5 an input - RFS_READY

    while(1)
    {
        if(RFS_READY == 0)
        {
            // This is when we are in run mode.

            // We are polling the 1 PPS signal, if we sense a "1" we set the
            // _led_state variable to the number of 10ms periods you want. In
            // this case I want about 80ms. Once this is set the state machine
            // below will hold the LED on and wait 10ms until ir reaches 2,
            // and then normal state resumes, the end result being an LED thats
            // lit normally, and pulses brightly for about 80ms on each 1pps
            // count.
            if(CLK_1PPS == 1)
                _led_state = 10;

            // This is a simple state machine that will run the LED
            // at one third power by outputting a 33% duty cycle square
            // wave. Each time around the loop the state variable will
            // count 0-1-2-0-1-2...etc LED on for 0, and off 1 & 2.
            // When the 1PPS interrypt is fired, the state machine
            // holds the LED on at full brightness (100% duty)
            switch(_led_state)
            {
            case 0:
                LED_STATUS = 1;
                _led_state = 1;
                break;

            case 1:
                LED_STATUS = 0;
                _led_state = 2;
                break;

            case 2:
                LED_STATUS = 0;
                _led_state = 0;
                break;

            default:
                _led_state--;
                LED_STATUS = 1;
                _delay(10000);
                break;
            }
        }
        else
        {
            // If we get in here we are in warm-up mode. We blink the
            // LED with a short on period (20%) and a long off period (80%)
            // about three blinks a second.
            if(LED_STATUS == 0)
            {
                LED_STATUS = 1;
                _delay(75000);
            }
            else
            {
                LED_STATUS = 0;
                _delay(300000);
            }
        }
    }
}

Catch you next time….

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.

Aug 03

Build a 10MHz Rubidium Frequency Standard and Signal Distribution Amp for my Lab

Having gotten myself a Rubidium Frequency Standard I found that the unit on its own is not that useful, its really just a component and needs really a supporting PSU and a decent enclosure to make it useful. I was searching around for something suitable when I was directed to a robust quality unit being sold on e-bay for just £20 with an unbelievable level of re-usable content and turned out to be an almost perfect solution to making the Rubidium Standard a useful Lab item. Rarely does such a fine marriage of junk bits come together to make something really useful.

I had a lot to cover, the whole thing was built in an afternoon and as a result this is a long video at 1 hour 16 mins so be prepared…

The PIC Micro-controller – PIC12F675
The original plan was to use the PIC for three functions, the first was to make the power LED flash while the RFS was warming up and on solid when locked. The second was to generate a 1 PPS signal from the 10Mhz signal and the third was to generate a PWM signal to control the fan speed. As it turns out the RFS already has a 1 PPS output on Pin 6 of the DB9 connector so there was no need for this. It also transpired that the only fan I had to hand was a three wire fixed speed fan, so I also did not need the PWM signal, this left me with just the power LED to deal with which is what the PIC ended up controlling. Here is the schematic for the PIC and the source code.

#include <xc.h>

// Using MPLAB-X and the XC8 compiler, both are free from Microchip.com. I am using this on OSX (Mac) and with an ICD3 for programming.

// PIC12F675 Configuration Bit Settings

// CONFIG
#pragma config FOSC = INTRCIO   // Oscillator Selection bits (Internal oscillator: GPIO on GP4/GP5)
#pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF      // Power-Up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = OFF      // GP3/MCLR pin function select (GP3/MCLR pin function is digital I/O, MCLR internally tied to VDD)
#pragma config BOREN = OFF      // Brown-out Detect Enable bit (BOD disabled)
#pragma config CP = OFF         // Code Protection bit (Program Memory code protection is disabled)
#pragma config CPD = OFF        // Data Code Protection bit (Data memory code protection is disabled)

// IMPLEMENTATION STRATEGY
//
// PIN ASSIGNMENTS
//   2 = RBS_RDY (GPIO5)
//   5 - POWER_STATUS_LED
//

// We are running the chip at 4Mhz
#define XTAL_FREQ 4000000

#define RBS_RDY GPIObits.GPIO5
#define POWER_LED GPIObits.GPIO2

void main(void)
{
    ADCON0bits.ADON = 0;    // Turn off the ADC
    ANSELbits.ANS = 0;      // Make all inputs digital
    VRCON = 0;              // Turn off the internal voltage reference
    CMCON - 0x7;            // Turn off the comparator

    // Set up our I/O pins
    TRISIObits.TRISIO2 = 0; // Make GPIO2 an output
    TRISIObits.TRISIO5 = 1; // Make GPIO5 an input

    while(1)
    {
        if(RBS_RDY == 0)
        {
            POWER_LED = 1;
        }
        else
        {
            if(POWER_LED == 0)
            {
                POWER_LED = 1;
                _delay(100000);
            }
            else
            {
                POWER_LED = 0;
                _delay(400000);
            }
        }
    }
}

The Video Amp – Extron ADA 6 300MX HV
The video amp unit I used in this hack is made by Extron and the model number (on the front panel) is ADA 6 300MX HV. When I communicated with the seller, he said he had about 30 of them, so if this is useful to you and you want to make your own I would go grab yourself one before they are gone. The basic outline schematic for an input channel is here:

The video op amp chip used in this unit is a CLC409, the data sheet is here.

The heat sink I have ordered can be found on e-bay, search for “150x25x60mm Aluminum Heat Sink for LED”.

The switch mode PSU I used can also be found on e-bay, search for “Enclosed Power Supply SMPS,15V,2.4A,36W, it is made by TDK-Lambda and the part number is LS35-15”

See you next time.

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.

Jul 26

DIY HP/Agilent 53131A-030 3GHz Channel 3 Option Board

As part of the process of upgrading my counter to have a DIY high stability OCXO (Oven Controlled Crystal Oscillator), someone who watched my videos had designed a DIY 3GHz Channel 3 53131A-030 option board. The original from Agilent is very expensive (obviously) and there are clones you can get on e-bay which are a quarter of the price Agilent charge which is why he decided to design his own. His name is Andy and when he saw my video’s he got in touch and offered me one of the PCB’s to which I of course said YES PLEASE 🙂

Now as it turned out, when Andy constructed his own board he had enough components left over so also constructed and tested one for me which was a really kind thing to do and very unexpected too. In exchange for this I have insisted that I can build him an OCXO board while I am doing mine to return the favour.

Anyways, I thought I would do a video to show the HP/Agilent 53131A-030 DIY 3GHz Cannel 3 Option board getting fitted to my counter. I also spend some time explaining how the pre-scaller circuit works and in basic terms what MMIC’s are and how they work too. I also make an adaption to my previous hard power switch modification to make way for the upcoming DIY OCXO board, and I measure up to get the exact board dimensions and mounting hole positions I need for the OCXO PCB layout.

The entire work and full attribution for the DIY 030 option board/PCB goes to Andy, so Andy – thank you so much for making one of these for me – I really appreciate it.

PLEASE NOTE: I will not put Andy’s Youtube/EEVblog ID here unless he asks me to, and I will not pass on his details without his express permission so please don’t ask – I respect peoples privacy. If Andy does want to share his details in connection with this project then I will gladly put them here.

PLEASE ALSO NOTE: The schematic drawing below is technically incomplete and is meant as an illustrative block diagram. In the real circuit there is also a resistor in series with each inductor at the top of each MMIC to set up the right DC conditions.

See you next time.

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.

Jul 08

HP 339A Teardown

A piece of equipment I use rarely but when I do I find really useful is my HP 339A Distortion Measurement Set. Built in the 70’s this unit has a precision sine wave oscillator and distortion measurement section. One of the things thats really nice is the oscillator and the notch filter are tied together and the notch filter auto-nulls to make measurements really easy to accomplish.

The build quality of this unit is impeccable, made by HP when they were making stuff properly. The entire chassis is made from folded high quality aluminium sheets with capture nuts and really precise machining. The main oscillator switches are coupled using a bar and wafer scheme but both the oscillator and the filter are fully screened and isolated in their own chassis sub-sections. The smell from inside the unit is that old-school electronics smell I used to encounter all the time when I was a kid taking apart old TV’s and Record Players. I don’t know what chemicals exactly make that smell but I am pretty sure if you could bottle it you could sell it – there is an idea for a unique aftershave! It could be called “Ye’old TV Man”!

Anyway, hope you will find the video interesting. Thanks for watching.

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.

Jul 07

Measuring Distortion with a HP 339A and a Keithley 2015 THD

I have had my HP 339A for a long time now and despite only using it a small handful of times it is a really great instrument – but – its big and takes up a lot of shelf space. A few weeks back a purchased a Keithley 2015 THD which is a 6.5 digit bench meter with a built in distortion analyser, I bought it because of the distortion analyser function. I would like to get some more instrument shelf space back so am able to replace the HP 339 with this 2015THD I will make that much needed space. I decided to build a simple output circuit so that I can induce some crossover distortion and compare the basic measurements on these two devices to see the results. Now I must make it clear that this is a basic 101 on measuring distortion, I am sure there is a lot more to know that I do but I believe I cover off the basis.

The simple drawing I used to explain the test and test circuit.

I will tear down the HP 339A on video to show how nicely these are built. This is one of those rare “all analog” devices that has not digital parts at all, watch out for that video if you like seeing the guts of nicely built equipment.

Thanks for watching.

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.

Jun 30

Seven Decade Programmable Resistor – A Low Cost Solution

I have spent a lot of time over the years prototyping electronic circuits and the amount of resistors that have ended up in the trash because they are so cheap you don’t bother to keep them tidy or organised once you take them out of their organised storage – you know the story. One potential solution to this is a programmable resistance box but the problem with these things are they are bulky and expensive and do not lend themselves well to breadboard prototyping. The cost of construction means they are typically the reserve of high-precision resistance boxes. I have a CROPICO RBB6E resistance box in my lab which I open up to have a look inside, its really well made, mostly by hand too, far too nice to abuse in prototyping….

I looked around at what is available but did not find a solution that met my own requirements so I decided to design something simple myself. I also wanted to make a simple project to get manufactured by machine which apart from other things requires reasonable volume, and I thought this project would be useful enough to others that I should get some made and make them available.

Various Pictures

IMG_5847.JPG
IMG_5847.JPG
IMG_5850.JPG
IMG_5850.JPG
IMG_5851.JPG
IMG_5851.JPG
IMG_5852.JPG
IMG_5852.JPG
IMG_5853.JPG
IMG_5853.JPG
IMG_5854.JPG
IMG_5854.JPG
IMG_5856.JPG
IMG_5856.JPG
IMG_5858.JPG
IMG_5858.JPG
00000273.png
00000273.png

Project Discussions

Project discussion thread on EEVBlog forums

Other Resources I mention in the Video

Cheap Resistance Substitution Box by @vtl on the EEVBlog
Cheap Resistance Substitution Box – Hack-a-day

If you do want one of these I have these for sale on “tindie.com”, the item listing is here:

https://www.tindie.com/products/gerrysweeney/seven-decade-programmable-resistor-1r-9999999r-1-500mw-gerrysweeneycom/

I have also listed these on e-bay, you can search for “gerrysweeney.com” which will find the listing.

As ever, if you have any comments, suggestions or feedback, please use the form at bottom of this page

Thanks for watching

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.