VK5TM


News, Updates and Other Minutiae

As a lot of people have pics of things unrelated to ham radio on their websites, I thought I would add a couple of my own (Scroll down for site updates). Banjo, our Red Heeler/Koolie cross at 4 months old. Banjo at 4 months And at 12 months old (Feb 2016) enjoying his birthday breakfast treat of banana on toast. Banjo at 4 months

May 2017

New project added - my version of the X-Phase noise canceller. PCB available and a kit of parts to follow soon

27 December 2016

Another addition to the Gallery section. This time, fitting a DDS module to a Philips PM5326 RF Generator to cure a bad drift problem.

26 November 2016

Additional software for the Simple DDS VFO added. This enables the pushbutton on the encoder to change step size (step sizes 10kHz, 1kHz and 10Hz). See the notes in the Download section of the Simple DDS VFO page for more info.

20 November 2016

I have had some interesting conversations with homebrewers over the last few years relating to experiments/modifications of the works published on this website. One of the things on the 'list of things to do', was to publish some of their pics' etc on my website, so along that line, the first one, a filter/leveller for DDS modules from G3OAG, is now on my site. This one and all the others I have available to show, will be posted under the 'Gallery' menu. Now that things are starting to return to somewhat normal around here, I will endeavour to get the others up as quickly as possible (with apologies to those that have been waiting to see their work in lights).

I have had a quantity of pcb's made commercially for this project which can also be used for the Xtal Substitute project. Cost is $10 AUD for one including postage (local or oversea's). Additional pcb's $6 AUD each for oversea's or $6.60 each in Australia. See contact page to get in touch with me. 22 Feb 2017 - PCB's for this project are all gone, if there is enough demand, I will get some more made.

DDS xtal substitute pcb DDS xtal substitute pcb

DDS Xtal Substitute MK2

Mark 2 version of the Simple DDS based xtal substitution project

Following up on a suggestion from another ham, here is the Mark 2 version of the DDS Xtal Substitute. It is the same circuit as the original Xtal Substitute, but with different software and a diode matrix at the input. It enables you to select any one of up to eight frequencies. If you have already built the Mark 1 version, all you need are the input matrix and the new software. Click schematic drawing for larger version. Opens in new window. 8 frequency DDS xtal substitute schematic

If you have one of the 3.3v modules, all that needs to be done is to replace the 7805 with a 3.3v regulator. The PIC will happily run at 3.3v and it doesn't control anything but the DDS module, so no other interfacing problems.

While the schematic shows a rotary switch, you can use any system that will pull the selected input to ground. Which ever system you use, as with the Mark 1 version, make sure that it stays set. The reason is that the software in the 12F629 uses a feature called 'interupt on change' on the inputs. So, regardless of whether an input goes Hi or Lo, the 12F629 recognises that there has been a change and sets the DDS output frequency according to the new input setting. Once the frequency has been set, the 12F629 goes to sleep until any input changes. This should help on two fronts - reducing any possibilty of interference from the 12F629 and reducing current consumption. Also, like the Mark 1 version, there are different requirements for switches used during calibration. SW-1 & SW-2 need to be momentary push buttons. SW-3 is an on/off style switch. Their use will be explained in the paragraph on calibration. I have not included any sort of filtering, but have placed pads for both the filtered sine and unfiltered sine outputs of the DDS modules so either can be used (not on the Simple VFO pcb). Bandpass filtering is strongly suggested for this application, expecially if you use frequencies above about 25MHz on the AD9850 module and about 40MHz for the '9851 module. (Note that the square wave outputs only work up to 1MHz apparently. Never tested them myself). It should be easy enough to arrange a filter on a piece of pcb material to do the job. A shielded box for the whole assenbly is probably a good idea as well. In the Downloads section below, there is a file that includes the main pcb, a switch matrix pcb and a diode matrix pcb. The main pcb is only 2 inches (50.8mm) square and will accept either the AD9850 Module or the same format AD9851 module. A 1 pole 12 positon rotary switch (only 8 positions used) is used on the switch matrix pcb. The diode matrix pcb has a couple of possible uses: 1) use with a different switching system. 2) can be mounted horizontally against the switch and wired with stiff wire if there is not enough room to mount the switch matrix pcb. 3) can be used with a different style of switch and mounted as in 2 above. Xtal substitute pcb Switch matrix pcb Diode matrix pcb

Software

A few words about the software. You will need to input the values of and recompile the software for your required set of frequencies. Xtal_1_0...3, to Xtal_8_0...3 in the asm file are the frequencies that the DDS will be set to when one of inputs 1 - 8 is taken low (or grounded). Any of the 8 frequencies can be set to zero, if so desired. The Calibration frequency - This is the frequency the unit needs to be adjusted to during the calibration procedure. I suggest making it in the middle of your range of frequencies. How to calculate these is presented further down this page. If you use MPlab to compile the software, the above are between lines 128 and 197 in the asm file. In the file available to download below, the frequencies are 1 MHz, 2 MHz, 3 MHz, 4 MHz, 5 MHz, 6 MHz, 7 MHz, 8 MHz and the calibration frequency is 4.5 MHz. They are of no particular relevance, other than to be far enough apart so you know that the frequencies are changing during testing. There is no limit to the frequency range other than that of the AD9850 or AD9851 modules.

PLEASE NOTE: If you have not done the calibration procedure before installing into your rig/project or other, make sure that inputs 2, 4, 6 or 8 are NOT HELD LOW when the power is first turned ON, otherwise it will enter calibrate mode. The software has been designed, such that, once the calibration has been done, the above restriction does not apply

Calibration

Once you have built the unit, it really should be calibrated before you fit it into anything. Calibration requires the use of an accurate frequency counter with 1Hz resolution and is used to adjust the "OSC" values in software to correct for off frequency Xtals on the DDS modules. Calibration requires the use of momentary push buttons connected to inputs 1 & 2 and an on/off switch connected to input 3. Connect the frequency counter to the output of the unit and turn the switch connected to input 3 ON. Do not turn it off until calibration is complete. Turn the whole thing ON. The frequency counter should show a frequency somewhere in the vicinity of the calibration value put into the software. Go away and have a cup of coffee, maybe a biscuit or 2 or what ever your choice. Once you have left the unit to run for a minimum of fifteen minutes, then continue. Or in other words, give it time to warm up before doing any adjustments. Push either the UP or DOWN button as is required to change the frequency so that it becomes your calibration value. There is approximately a 1/3 second delay between each frequency change step. Release the button when you have reached the CAL frequency. You can now turn the CAL switch OFF. This will save the new computed "OSC" values into EEPROM and the unit will now be functional. It will also set a flag in software that prevents it entering calibration mode again, unless the PIC is reprogrammed. At this point, you can remove power and fit it into what ever it is you are going to use it in. Note that, currently, the PIC must be reprogrammed if you want to do another calibration. I am looking at various ways around this.

Calculating and entering different frequencies

For those with Windows systems, it is easier to use the upgraded scientific calculator available for download (in "Programmer" mode). Users of other operating system (or those that don't want to download the calculator), will need a decimal to hex converter program of some sort (unless you are lucky enough to be able to do it in your head). In the DDS_XTAL_SUB_8 asm file, starting from line 128, are several 'EQU' statements for xtal_1_0..3 to xtal_8_0..3 and calibration frequency. I will use the value of 5MHz to show you how to get the numbers. The following sequence applies to all nine of the 'EQU' sections (with different numbers of course). Firstly, enter the dec number 5000000 (5 million) into your dec to hex calculator/program (I'm not going to tell you how to work your calculator/program, you need to work that out). The HEX number will be 4C4B40 Now break this number down into groups of 2, starting from the right hand side:- 4C 4B 40 The right hand number is the least significant byte, so you enter 0x40 into the line that says, funnily enough, least significant byte. Enter 0x4B in the next line up and 0x4C into the line above that. The '0x' tells the MPlab compiler that the number is in HEX format. So, where is the most significant byte? Well, in this case, it is 00, because 5000000 only converts to the three bytes just shown. So, if your calculation only gives you three nice even groups of two numbers, the most significant byte will be 0x00. Lets do another one that doesn't give you three nice even groups of two numbers. Enter 20000000 (twenty million) into your calculator/program. It should come back with the HEX number of 1312D00. Breaking that down into groups of 2 as before gives you: 1 31 2D 00. Not so nice even groups of two numbers plus an odd one. To fix that, you put a '0' in front of the 1 to get 01 31 2D 00. Because nought is nought (or zero is zero), it has no effect on the calculated value, so you can enter the numbers as before, but the most significant byte will now be 01. Don't forget to put 0x in front of your numbers (or whatever you compiler requires to indicate HEX numbers), otherwise, strange things will happen. Using the AD9850 or '51 modules, the most significant byte will not be any more than 03 hex (which puts you upwards of 50MHz).

Hex Calculator

Alan, G8UJS, has kindly supplied an Excel spreadsheet (in the Downloads section below) which can be used to calculate the Hex values for the 8 different xtal substitute frequencies. No more fumbling or head scratching with that rotten calculator. A point to note is that this file will only work in the newer versions of Excel. It will also calculate the values for different frequency oscillators on the AD9850/51 modules. To use, open the Excel file and click on the Yellow area to enter your frequency (double click to enter directly in the box or enter your numbers in the area above the column designators). It may ask you to "Enable Editing", go ahead and click yes (otherwise it won't work). Then either hit "Enter" or click out of the box and your answer will magically appear in the box next to the one you changed. You still need to seperate out the Hex number into it's individual pairs and add the 0x. Most people can ignore the section on the right unless you are converting old Pye units to 4m, when this may come in handy. If you want to keep the numbers when closing Excel, click yes to save, otherwise click no to keep the file as is (I recommend keeping a copy of the Excel file somewhere else in case you make an error and corrupt the file). One thing this has brought to view, is that my calculator finger is a little bit out of calibration and I have made a small error in calculating the values for the 125 MHz ref_osc values. ref_osc_0 should be 0xD0 instead of 0xCA. Note that this only 6 Hz off and WILL NOT AFFECT those that have already built and CALIBRATED their units (the tolerance of the oscillators on these modules is greater than 6 Hz anyway). I will go through the site and update all the necessary files with the new value.

Downloads

These files are provided free for personal use ONLY. I retain all copyright on all works published on this website. They may NOT be used in any commercial or profit making enterprise of any kind without the express WRITTEN permission of the copyright holder.

(Right click and 'Save as..' or what ever is required by your browser) DDS_XTAL_SUB_Binary_input.asmThe ASM file for the Mark 2 Xtal substitute project. It is set to AD9850 by default. Instructions are in the file to change it. There are no HEX files. but, if you really, really, really, need a HEX file with your custom frequencies, I will create it for a small donation. VK5TM_DDS_Xtal_Sub_8.lay6 The Sprint Layout 6 pcb file. See the PCB Info page for information on using this file. DDS_HEX_CALCULATOR.xlsx Kindly supplied by Alan, G8UJS.