Introduction: GPSDO YT 10 Mhz Lcd 2x16 With LED, UTC Time and GPS Localisation.
February 08 2023 , Last version is 1.58 Available at step 11
Hi guys,
What is a GPSDO ? GPSDO means: GPS disciplined oscillator. GPS for global positioning system. All GPS satellites are equipped with synchronized atomic clock. GPS module receives these signals from several satellites. And by triangulation, it knows his location. But here, what interests us is the pulse per second that is found on the module. With this precise pulse (from atomic clock), we can do a very very accurate oscillator. What for ? For reference, for calibration of frequency counter or just for fun to have one in his lab.
For more explanation on how calibration is working. Go to my first instructable just here:
https://www.instructables.com/id/GPSDO-YT-Discipli...
So i did a frequency generator of 10.000000000 Mhz +- 0.000000001 Mhz or 1ppb on 10Mhz
PS: I had some questions about how i know that the speed is accurate. The answer is quite simple. If you read 10,000,000.000 it's because you have 10,000,000.000 Mhz It's 10 billion count on 1000 seconds. It's a frequency counter AND a gpsdo at same time. If you have different result, probably your reference (pps) isn't accurate. Not enough satellite, weak signal. Can be power supply problem too. OCXO itself take 600ma.
That's said, the accuracy of this device is 10mhz + or - 0.001hz OR +-1x10e-10
In addition, this GPSDO is the cheaper vs accurate you will find and it's working very good.
Let's begin
Step 1: Here Is the Schematic
I improved schematic. I added a pot for the 12v version. Like that almost any 7404 or 7414 are working.
And i added LED support. Optional as well.
Basic projet could be only the uC atmega without LCD and LED. Or only LED without LCD. Output will be the same. But add some monitoring device is more fun :)
Also, like you will see on step 24. I have now added a serial output for monitoring if you do not have a display.
You can download original schematic by clicking on it. And clicking on the arrow at bottom left (download original).
Step 2: Some Parts You Will Need: GPS Module
GPS module. You can buy a cheap one.... any will do but now, by experience, you can have better result with a m8n for this reason: Number of satellite.
Attention: Ublox neo 6m can receive US satellite only. Neo m8n can receive US and Russia, and have more satellite.
You see an exemple here at 3:22
More you have satellite, more accurate is the pulse. At the beginning i thought that just with 3 or 4 was ok. Yes it's working and we have a pulse. But this one is not as precise.
I have 2 gpsdo. One with simple ocxo on neo 6m and another with a double on neo m8n.
My simple ocxo was a bit less accurate of my double. Worst result i saw was 9.985 And I did a test.
I used the m8n pulse for my simple ocxo gpsdo. Problem disappeared.
If we read on wikipedia here, Error sources and analysis, we can see, gps can have error.
If you have some difficulties with the result, gps module and antenna is probably the problem.
You will need to find where is the pulse is. When a led is on the device. Best thing to do is to put a wire from the led to the 7404 input. Or now on eBay i saw some available with on board GPS pulse output.
You need to configure the module to have to have 1 pps (pulse per second) when gps is locked (3-4 sat or more) and 0 pps when antenna or signal is missing.
If you buy a ublox neo 6m. It's by default.
Interesting information:
On a ublox m8n, you can choose an output of 10mhz. So why doing a gpsdo when i could have 10mhz directly of a gps module ? It's because ublox module is using speed of 48 Mhz and this is creating jitter at the output. 48Mhz isn't dividable by 10. This is an exemple at 1 Mhz. At 10 Mhz it's worst and very ugly.
Yellow is a 10mhz reference gpsdo divided by 10. Trigger is channal 1 (yellow). Blue is the timepulse output 1mhz 50% duty of a ublox m8n. As you can read in Timing Consideration book page 10-11, it's because Ublox is using a speed of 48 mhz. And this one isn't dividing by 10. So, at the end the software is doing a correction.
In addition, after some test and experience with pll gpsdo, the pll was sticking on a moving waveform. Resulting by a moving instant frequency. It wasn't too bad when the reference frequency was at 10 Khz but it was easy visible.
In other word, waveform was moving back and forth a bit. And this wasn't just the ublox jitter problem. It's the pll itself doing his correction to keep the right frequency. But it was always following the reference. So in average, on long term, pll gpsdo is very accurate. But if we measure the instant frequency, this one can be higher or lower a bit.
It was also slower to have a sticky waveform. I have finally choose to do an over time uC pwm gpsdo instead.
Another way would have been to make a pll gpsdo and add a uC but only as a frequency counter.
Step 3: OCXO
Oscillator OCXO. Simple or double, 5v or 12, sine or square will do.
On my side i tried the Isotemp square 5v et the C-Mac sinewave 12v and both are working fine.
OCXO take around 600ma alone. So be sure to have a good power supply (transformer).
Also, keep in mind that the pwm output is doing dc from 0 to 5v. If you have a 12v OCXO, maybe the vfc needed will be higher than 5v. Sometime 8v or 12v. In this case an op-amp can be use to match the pwm output to the correct vfc voltage.
Step 4: LCD 2x16
LCD is optional. The gpsdo will works great without it. You could monitor the gpsdo only with the 4 LED'S or with a computer and putty.
But the project is more elegant with it . Take note on the LCD, only pin 1 to 14 is needed. For pin 15 and 16 (backlight),I installed a diode and wire exactly like picture. This one dim the backlight a bit. You can also connect pin 15 directly on Vcc without any problem but double check on back near pin 15 if a resistor is already installed on your LCD.
Step 5: Those for Gps Module
This cable is:
High Frequency Coaxial Connective Cable Cord RP-SMA Female Connector IPX
and antenna:
28dB LNA Gain 1575.42MHz RP-SMA Male GPS Active Antenna Stronger Signal
Exemple here on amazon.ca and here
I do not recommend to use the little antenna provided with the gps module.
Step 6: PCB
For PCB i used the toner transfer method. Not perfect but ok for this project. I'll give you PCB to print at next step.
Step 7:
Here is the file you will need to do the PCB. Top one is mirror for toner transfer method. I also added the gerber files if you want to use a professional way.
Gerber:
Step 8: Check Voltage
Before to add atmega and 7404, voltage must be checked.
I know my heat-sink is HUGE but i'm using what i have :) An old pc heatsink
You don't need to install both connectors to program the atmega. Choose 6 or 10 pins. It depend of your programmer.
Step 9: LED Board
I did a board for the LED. At the end i glued the transistors on the metal box.
I'll give you pcb file on next step.
I suggest these flat cable. If by mistake you plug the cable upside down, no worry. everything will be fine. Just no LED will turn on. That's all.
Why do I use transistor instead direct connection ? Yes the uC can support those LEDs. But the output current was disturbing the PWM (DC output for vfc). That way, the most of the current is provided by the transistor collector.
Step 10: LED Board Files
The files for the little board
Attachments
Step 11: Program Your ATMEGA and Below Here Is the .HEX File and Now, Source Code.
This is an easy part but a lot of poeple fear or hate to program a uC. I'll try to do it simple.
You need an Atmega328p and the .hex file below. You must also choose the right fuses bits.(E0 D9 FF)
Those fuse bits are programmed automatically on USBasp and tiny. no worry.
They are many way to do that:
-STK500
-USBasp (see next step)
-USBtiny (see next step)
-Arduino to program another atmega328p (search on internet, many how to availble)
Myself, i'm using a stk500 with ISP directly in Atmel studio. You can use any other method. A lot of cheap programmer are available on ebay. Next step show an ease alternative.
You must choose the right fuse bit. Here is Picture of stk500 fuses bits. (E0 D9 FF)
-Be sure that external oscillator is selected and the low.ckdiv8 clock is unchecked. See picture. Pay attention, when the external clock fuses bit, you must provide an external clock to program or run the code. In other words, connect the Oscillator in xtal1 pin.
So for short, send the gpsdo.hex file to the Atmega328p and program the fuses bits. (E0 D9 FF)
If you have a stk500, there are many chance that you already know how to program a .hex directly.
Version change:
-Change the watchdog to 2 seconds instead of 1. Some user had self running message no pulse detected. The watchdog was to tight in some cases. So I change this to 2 seconds and add some code to track when a pulse is missing in a different way.
-In some gps module GGA code are slightly different. In the string, some have ,09, other have ,9, (no zero) I added some code to fix this and now have more compatibility with different models.
-The RUN led is also now a Hit LED. This LED turn on at the first time when 10,000,000.000 is Hit (Run mode). The LED will stay on if frequency is staying between + or - 0.001 If not the LED will be off.
-So far, at 1000 seconds gate. Code was comparing only the 2 lasts digits. It was fair enough, result should be only +- 1 or so. But it some case, bug or miscount, uC could stick on a wrong frequency if the jump is too large. Now comparison is done on the whole one billion number. No more mistake.
If a miscount of + or - .050 happen. uC will reload the last good config from eeprom and do a recount first. If result isn't fix, uC return to 1 second gate to do a full recalibration.
-Now the count LED is only flashing at 0.5HZ. The LED turn on IRQ0 and turn off on next IRQ0. IRQ0 is the 1 second GPS pulse. This LED was flashing too quickly and was producing harmonic.
Source code (assembly):
https://github.com/YannickTurcotte/GPSDO-YT
Here to have the file compile and ready to program.
Step 12: Program Your ATMEGA With Avrdude and a USBasp or USBtiny
This method is very simple and cheap. search on ebay or amazon for USBasp or USBTiny. It's between 2 and 5$.
Plug in your USBasp or USBtiny device in your computer and let Windows detect the device (it will report driver not found). If a window pops up asking to search for driver, just close it or click on Cancel.
At this point, download and run Zadig, it should detect the USBasp or USBtiny, or any libusb device that you have. Then in the selection box (see picture), choose libusb-win32 (v1.2.6.0), click on Install Driver, and wait for the installation to complete.
Check in device manager for atmel usb device = ok. No excalmation mark anymore
Download avrdude 6_3 with HEX.rar here below on this page and unzip files in a folder. You will have 5 files, see pictures.
I create a batch file to program the chip with .hex and fuses bits in same time.
Connect USBasp or USBtiny cable in gpsdo board, see picture and turn on the project.
Double click on program usbxxx.bat
At the end, code and fuse bit are programmed, again see picture (black one)
Pay attention, with new fuses bits setting, clock must be now, external.
If programmation is ok and you see happen on lcd, check for oscillation. If you use 12v option, turn the pot
until something is lit on display. Use oscilloscope to adjust duty to 50% if you have one.
Step 13: Jumper Config, (Quick Vs Classic Mode and Baud Rate Speed)
Here are jumpers setting configuration.
PWM correction mode
Quick mode (No jumper default)
Classic mode (Blue jumper)
GPS module transmit speed
9600 bps (No jumper default)
4800 bps (Red jumper)
Quick vs Classic, what's the difference:
Quick mode: will try to correct the pwm by doing large jump when the error is far from the target.
Advantages are, it's quicker to arrive at 10,000,000.000 Hz
Disadvantages are, If the ocxo isn't the same range of correction programmed, the step will be too high or too low. At the end it will jump around and never reach the target.
PWM Corrections for quick mode:
1 second gate. PWM move 0x0222 (41.66mv)
10 seconds gate. PWM move 0x0100 (19.53mv)
60 seconds gate. PWM move 0x006D x missing HZ (8.31mv x missing Hz) if missing Hz > 1
60 seconds gate. PWM move 0x0034 (8.31mv) if missing Hz < 1
200 seconds gate. PWM move 0x0033 x missing HZ (3.89mv x missing Hz) if missing Hz > 1
200 seconds gate. PWM move 0x0010 (3.89mv) if missing Hz < 1
1000 seconds gate. PWM move 0x0008 x missing HZ (610.36uv x missing Hz) if missing Hz > 1
1000 seconds gate. PWM move 0x0003 (228.88uv) if missing Hz < 1
until to find 10,000,000.000 (run mode)
1000 seconds gate. PWM move 0x0004 x missing HZ (305.18uv x missing Hz) if missing Hz > 1
1000 seconds gate. PWM move 0x0001 (76.295uv) if missing Hz < 1
Classic mode: will do little jump even when the error is large.
Advantages, you will eventually reach the target.
Disadvantages, Slower to arrive at 1000 second gate.
PWM Corrections for classic mode:
1 second gate. PWM move 0x0222 (41.66mv)
10 seconds gate. PWM move 0x0100 (19.53mv)
60 seconds gate. PWM move 0x002B (3.28mv)
200 seconds gate. PWM move 0x000C (915.54uv)
1000 seconds gate. PWM move 0x0003 (228.88uv)
until to find 10,000,000.000 (run mode)
1000 seconds gate. PWM move 0x0001 (76.295uv)
Witch one to choose ?
For sure try the quick mode first. It's the default, nothing to do. If you are seeing the frequency jumping up and down and never reach .000 it means that the correction algorithm is too large for your ocxo.
In this situation, just to add a jumper and switch to classic mode.
You can change those values
Download and open the source code with microchip studio, at the beginning of main.asm all information you need is there. Hit F7 to compile, the .HEX will be in \debug
Step 14: Try Your Project
Before to put all the thing in a box. Try it. Be sure that all is working fine.
Here i fixed GPS module on heat-sink. I used an old transformer 16v AC. Too large for the project but again, I'm using what i already have.
Step 15: OCXO Insulation
If you want, you can insulate the OCXO with foam. Here i used depron foam. This is optional only.
Step 16: Holes in Your Box
Prepair your box. Do hole, put some paint! For square i'm using this tool, see picture. Hand Nibbler Sheet Metal Cutter Tool.
https://www.ebay.com/p/1100025827
https://www.amazon.ca/Sheet-Metal-Nibbling-Nibbler-Cutter/dp/B00WFFZ2X8
Here is an alternative 3d printed box. External 5v power supply.
Step 17: Time to Put All in a Box
Here i used a metal box.
Step 18: On Scope Results
Like you can see, sine wave is nice. 3,44V peak to peak. (1 volt/div)
Square wave is 2v/div
Here i'm using a 74LS04.
Step 19: Accuracy From User Experience
These images come from Dino (MAC1). I had never measured accuracy by myself with frequency counter. I was very happy to see these results.
10,000,000,000.0 Mhz +.0003 Hz and -.0006 Hz It is even more precise than I thought. My specification was + or - .001 Hz. Super happy :)
Thanks to him for these photos.
Step 20: Instruction Manual
At turn on GPSDO wait 15 minutes. It do nothing. This is for warming the OCXO and satellites reception.
If you haven't any configuration in eeprom. the starting PWM output is at 50% 0x7FFF. You should be reading 2.5V dc on the pwm output if the vcc is 5V.
If the OCXO is already hot, just push button to pass this wait time.
uC will find the good voltage for your OCXO. If frequency is lower, PWM duty will rise, meaning DC value output will rise. If it's higher, PWM duty will drop. See step 13 for more information about the algorithm of this. You could also change it. You have to download the source code on my github. At the beginning of main.asm you will find some information to do this. Open it with microship studio, do you change as wish. Hit F7 to compile. The hex file will be in \debug
Now begin calibration phases. 5 phases total. 1 second, 10, 60, 200 and 1000 seconds. At 1000, uC is counting 1 billions of cycles (ticks) for exactly 10,000,000.000 Mhz
As soon this 1000 seconds achieved, uC keeps the pwm value in eeprom and continu at run mode.
Meaning it looping at the last 1000 seconds gate correction algorithm. If counter reach 10,000,000.001 or 9,999,999.999 the pwm value (16 bits) is adjusted plus or minus 1 and so on. Again it's depend of the classic or quick mode see step 13.
Important, keep in mind, in all calibration phase and 1000s, the display is showing the actual count or frequency. If the value isn't normal, bizarre or understandable, suspect a gps pulse problem or a low antenna signal. Problem is coming from the pulse. This one isn't arriving at the right time.
When GPSDO is in 1000s mode, config is saved in eeprom. So if this one is turned off and on, GPSDO go directly in phase 4 (200s). But be aware. If power if off for a while. You will probably need to do a whole re-config process. Sometime even with pwm in eeprom, frequency have drifted to much and it's just quicker to restart with default setting.
If for any reason, satellites are lost or weak (below than 3), gps pulse will be lost as well. So pwm value will be not changed anymore until pulse come back. OCXO will run by itself at last good eeprom value. On scope you wont see difference when pulse is there or not. "Self Running..." message will be displayed
If you press button, uC will stop counting and you will see UTC time and localisation for 10 seconds.
Localisation is in Degrees and decimal minutes (DMM). This is how to enter this on google map:
46 19.81750 N 072 35.33259 W
If you want to erase the eeprom value and restart calibration, just push button and hold at startup.
LED explanation:
1 1hz and warming. This led is ON at startup meaning the uC is waiting 15 minutes. This is for give some time to the OCXO to warm-up and stabilize. This is a shared LED with the GPS pluse. As soon as the waiting time is done, or push button press, the uC release the LED and gps pulse can be see.
2 Satellite LED. This LED turn on when 3 or more satellites are detected.
3 Counter LED. This LED is flashing when the uC is counting.
4 The RUN led is also now a Hit LED. This LED will turn on at the first time when 10,000,000.000 is Hit (Run mode). The LED will stay on if frequency is between + or - 0.002 If not the LED will be off until the target is hit again.
Meaning if the frequency is 10,000,000.003 the LED will be off and stay off until .998 .000 or .002 arrive.
Step 21: Conclusion
I hope you will enjoy this project. Questions, commentary are welcome English or French.
Step 22: More Information in Eeprom
If you can read the eeprom, you will find the last 50 hours of result. In 1000 second mode, uC store the frequency in eeprom. The 2 first byte is the pwm config. As shown in the picture we can read 864A. All byte after are frequencies counted. Each 1000s a bytes is stored.
00 is for 10,000,000.000
FF is for 9,999,999.999 or eeprom empty (at the epprom end)
01 is for 10,000,000.001
You can also see those byte when you are using the push button.
Another way to monitor the gpsdo is with putty. See step 24.
Step 23: OCXO Vfc Range.
I did a test code to know the OCXO frequency range. Uc is doing 5 reading at 10 seconds gate. 0% 25% 50% 75% and 100% of the 16 bits pwm range.
Each count displayed the frequency result and restart at the end, restart from 0. I know that base code can tell us unreachable frequency but you can't know exactly the range.
The best result is to have 10mhz around 50%.
Those result help to know the range of your OCXO and to see the linearity. This can also help in trouble shooting.
I checked with DMM and 10 Second is large enough to stabilise the voltage between each count.
If you try this code, it's the same fuse bit.
Step 24: Since Version 1.56 TX Pin Can Now Be Connected to a Serial Port
Since version 1.56 TX pin can now be connected to a serial port. With this feature, you can see the same information on a computer. No need to install a display if you want to. But both is supported as well.
The TX is on pin 3 of atmega328. Connect this pin to the RX of your com port.
You can download putty and open a standard com port, 9600 8 1.
You can also enable the session log in putty to save the communication and see or monitor all your frequencies.
On the picture you can see the beginning of my double ocxo config. Pwm Value, gate time, number of satellite and frequencies.
Step 25: Blog From Other User
Here is some Blog link from other makers:
From Pierre (In french): http://www.rotilom.com/F6IDT/gpsdo-ocxo.htm
From astromeier: https://www.instructables.com/Front-Panel-With-Dis...
Feel free to give me your link if you have did this project. I'll post this here.
Step 26: Cleaning the Harmonics
User Neunziger added a filter to clean the remining harmonics. The result is looking very good.
You can see his tip on the comment section below or here
647 Comments
Question 5 days ago on Introduction
Hello, I read your interesting article and now I'm designing my own pcb.
Can I replace the PDIP version of the ATMEGA328 directly by the SMT version (thereby correctly swapping pins)?
Will the programming file work without modification?
Thanks in advance for your input, Patrick
Answer 4 days ago
Yes it should be will work.
Reply 4 days ago
OK! I'll go for the SMT version then.
Thanks!
Patrick
7 weeks ago
Dear friends, I programmed the 328 with version 1.58c and the display shows Waiting... fo ever, no satellites, no nothing. Thanks in advance for any help
Reply 7 weeks ago
One thing I can see, you programed the uC, but the eeprom config is still there. On my side when I program it. The uC restart from default. So it's probably related with bad programming or corrupt uC ? How did you program it ?
Reply 7 weeks ago
Thanks so much Yannick, you were wright, it was an unknown programming issue. I did it again and seem like it´s going through all normal screen messages.
I´m using a Xgpro programmer.
One of the problems I have that do not allow the GPSDO to reach the 1000 secs goal is a 12V GPS I´m using, that looks no so good. Which is the best 5V GPS you recommend for this instrument?
Thanks a lot because I love this wonderful machine!!!!
Reply 6 weeks ago
I didn't tried a lot. Just look the ocxo datasheet to have a compatible 0-5v vfc range compensation. And for me, the 12V is working better cause it's a double oven ocxo.
Reply 6 weeks ago
Thanks Yannik, I´m about to order the 12V one for the very same reason. Thanks again
Reply 6 weeks ago
8663 works nice. Even if you probably will have the same serial number as my OCXO have :-)
Reply 6 weeks ago
I just discovered that with FW version 1.58c, my 12V OCXO is working a lot much better, GREAD update. Thanks
Reply 6 weeks ago
Good to know: the 12V does not play main role there. That's the last data you're looking at. First of all is important: frequency stability, frequency tuning range, tuning voltage range, output voltage level, signal shape. In the second row, temperature stability (there are single or double oven ), dependence of frequency on the change of supply voltage, supply voltage, dimensions... The 12V does not mean it is double oven. The 12V does not mean OCXO is better. It works better due to different parameters not it is 12V powered :-). My 5V single oven but new one is slightly better than chines used 12V double oven. The price was about 10x higher.
BTW, you wrote about 12V GPS module and now we are writing about OCXO :-)
But important is that it is working now and it also looks nice. Next step is to do correction in source code to be perfect and working quicker.
Question 5 months ago on Step 20
I was wondering what information the LEDs give that is not available on the LCD in case I want a minimalist front panel, but without losing displayed information (though possibly having the info a little less prominently indicated).
It looks to me like:
1. 1Hz/Warming LED: the warming up is also indicated on the LCD, but the GPS pulses are not, so this LED adds info not on the LCD.
2. Satellite LED: the LCD indicates the number of satellites, so the LED does not add information.
3. Counter LED: not clear if the LCD indicates when the uC is counting. Is it?
4. Run LED: The LCD shows the exact frequency, so this LED does not add information.
In short, it looks like the satellite and run LEDs do not add information not on the LCD (though I do get it that they may be more convenient to get a quick status); the 1Hz LED adds information, but I do not know about the counter LED.
Can you please tell me if my analysis above is correct, and resolve the question regarding the counter LED?
Answer 5 months ago
I design it to be able to have only LEDs without lcd. But yes, you can install only LCD without LED as well. Or just install the led you want.
LED 1 is for the warming (only 15 minutes) after it's a gps pulse reapeter. Yes it add info because you can't see the pulse on LCD.
LED 2 is when you have 3 satellites or mores. You can already see it on the LCD.
LED 3 is interesting, because it's the uC interrupt when this one is counting. So yes it means it is counting but also it is running fine. If you do not install this led and your uC hang for some reason, you wont know it.
LED 4 is when the result is inside +- .002 This you can see it on the display.
Hope this help
Yannick
Question 6 months ago
Hi Yannick. You did a fantastic job with this projected and I am excited to get started. It is superbly documented, well done! I saw you put your GPS module on a heatsink. I can do that, too, but did you find it to be necessary? I have a used heatsink here too, and I suppose it is not a problem to use it but they are not so easy to mount and I wonder if it is necessary.
I was also going to ask if your code was detecting the rising or falling edge of the GPS but I see on the schematic that the GPS is expected to be a rising edge and then you invert it with a inverter gate, so the code is actually looking for a falling edge in the end.
I did a quick test of the code with a Atmega328P and a regular 10MHz crystal configuring the 328P as an external oscillator. It works fine, and I see the frequency on the serial monitor, but of course it is not controlled. It is exciting to see, anyway. :)
I set the fuse bits to test a regular crystal as this:
avrdude -c usbtiny -p atmega328p -U lfuse:w:0xCF:m -U hfuse:w:0xD9:m -U efuse:w:0x04:m -F
What if I wanted to control to another frequency? For example, a 27MHz VC Oscillator. I can divide that by 2 and then I have 13.5MHz which should work with an Atmega328P but I can't see in your source code where I can easily tell where to change the expected frequency counts, other than in serial.asm which I know I would have to change. Maybe it is too complicated to change?
Anyway, thanks again for such an interesting and well documented project, even supplying the Gerber files and the source code. My PC board is being made this week. :)
-Gregg
Answer 6 months ago
Hi Gregg, Thank you for your comment.
-No the gps module doesn't need to be on a heat sink. I used used the room left to fix it.
-The Interrupt is on falling edge yes. That's correct.
-The fuse bit are ok. You can keep these setting with a regular OCXO. I found that some user had problem using external clock fusebit and have better result with ext crystal.
-If you want to control another frequency, you must change the frequency count and maybe the display layout but I'm not sure. It can work directly. It is doable for sure. But you will need to put time on it. Not a bad thing you will learn some assembly code.
Try it:
Serial.asm line 6 .equ fosc=10000000 to .equ fosc=13500000
math.inc line 523. You will replace the hex number with your 13.5mhz
F1 = 0xCDFE60
F10 = 0x80BEFC0
F60 = 0x30479E80
F200 = 0xA0EEBB00
F1000 = 0x324A9A700
Optional, Adjust your pwm value to match you OCXO
Program it, run it and check the display to see if all is ok. Take note if error to correct and try to fix it or let me know we will see.
Another option is to keep the whole project like that. And use a SI5351C to output your 27 mhz with a 10 mhz reference. Kuzysk did a instructable on this: https://www.instructables.com/Si5351C-Auxiliary-Bo...
Yannick
Reply 6 months ago
Hi Yannick,
Thank you for your time to reply to me. Noted, on the heat sink and GPS pulse direction. That is very helpful as I certainly can heat sink the GPS but I was trying to figure out what size box I can fit it all in and if I don’t have any benefit to heat sink the GPS, all the better. The GPS module I happen to have on hand is the Adafruit ‘Ultimate’ GPS. It’s not the cheapest one out there but it does grab satellites quite well, and well, I already had one.
As for the frequency modification, your tips made it all clear. I think I have an 11.0592 MHz crystal on hand which I can easily test the modification. I don’t mind to give Assembler a try and your advice is just what I needed to give it a try.
As for the Si SI5351C, yes I know that one, too and have a few modules on hand. But it is an interesting thought experiment I was thinking of. I can control to 10MHz and up-convert to 25MHz for the Si5351m. I know how to do that. But 27MHz has some advantage sometimes with the Si5351C and I don’t know how to up-convert 10MHz to 27MHz. And I found some $5 27MHz VCXO’s for sale. So that was why I was thinking about 13.5MHz. Anyway, your project is perfect for experimenting and am looking forward to experimenting with it.
Meanwhile, I am super excited to receive the used 10MHz OCXO I have coming. Hopefully in a few more days.
Best Regards,
Gregg
Reply 5 months ago
Hi Yannick,
I received my 27MHz VCXO but haven't got a chance to try it yet with it's odd frequency. But in the meantime, I got my project into a finished box and it is really fun to watch it zero in to the 10MHz with a regular OCXO! More fun than watching television. :) I am currently using an inexpensive CTI OSC5A2B02 OCXO. I used your test program to measure the range and it was more than I expected. 33.4 Hz from 0 to 5v which surprised me (6.68 Hz/volt)! So I fine tuned my phase adjustments in your program to match. Actually, this is such a big range that the resolution at phase 5 gets to be quite small so the adjustment step needs to be quite small . But it works, anyway, in quick mode (I never tested classic mode). I am generally now keeping within +/- .001, sometimes to +/- .002. I could still change the Phase5QuickLittleStep_L to 0x01 I guess but for now I leave it at 0x02., same as the QuickLargeStep.
I also have an ISOTemp OCXO134-10 which I think would be much easier to dial in, but it didn't fit in this particular box. Anyway, I am really having fun with your design. In case it helps someone with the same CTI OCXO, below is my phase settings.
Thank you!
Gregg
;phase1 - 1 second
.equ Phase1Jump_H = 0x03;
.equ Phase1Jump_L = 0x10
;phase2 - 10 seconds
.equ Phase2Jump_H = 0x00;
.equ Phase2Jump_L = 0x4E
;phase3 - 60 seconds
;Classic
.equ Phase3Jump_H = 0x00;
.equ Phase3Jump_L = 0x0D
;Quick
.equ Phase3QuickLittleStep_H = 0x00
.equ Phase3QuickLittleStep_L = 0x0c
.equ Phase3QuickLargeStep = 0x15;
;phase4 - 200 seconds
;Classic
.equ Phase4Jump_H = 0x00
.equ Phase4Jump_L = 0x03
;Quick
.equ Phase4QuickLittleStep_H = 0x00
.equ Phase4QuickLittleStep_L = 0x04
.equ Phase4QuickLargeStep =0x10;
;phase5 - 1000 seconds
;Classic
.equ Phase5Jump_H = 0x00
.equ Phase5Jump_L = 0x02
;Quick
.equ Phase5QuickLittleStep_H = 0x00
.equ Phase5QuickLittleStep_L = 0x02
.equ Phase5QuickLargeStep = 0x02
;run
;classic
.equ Phase6Jump_H = 0x00
.equ Phase6Jump_L = 0x02
;Quick
.equ Phase6QuickLittleStep_H = 0x00
.equ Phase6QuickLittleStep_L = 0x02
.equ Phase6QuickLargeStep = 0x02
Reply 5 months ago
Don't waste your time trying to stabilize the CTI OSC5A2B02 better than you can now. Physically principles and possibilities of your OCXO do not allow this. You will never keep the exact frequency, it is not possible. For that you would need a completely different design and a super expensive OCXO. If you looked at the regulation voltage with an oscilloscope, you would see a sawtooth voltage. In fact, your output also sawtooth modulated. It still fluctuates around 10MHz, sometimes it's more, sometimes less, but on average it's still around +- 0.001 or a little more. And then there is a thermal stability and for supply voltage sensitivity.... and bit a more problems.
Reply 5 months ago
Thanks for the info! I had made some educated guesses about the CTI OSC5A2B02 already based on its cheap price, small size, and heat dissipation but I learned a lot more from your comments. I just started testing an IsoTemp OCXO which I think should be much cleaner and more stable but I didn’t get to explore it very much before I had to leave on a business trip for a few days. I do think the CTI is likely 'good enough' for a lot of people even so, depenfing on their application. Anyway, I hope to get back to my experiments in a few days.
Reply 5 months ago
Thank you for the informations. It can help others. If you need help for the 13.5 Mhz just ask. We will figure it out. Yannick