Author Topic: Lars DIY GPSDO with Arduino and 1ns resolution TIC  (Read 274573 times)

0 Members and 2 Guests are viewing this topic.

Offline W3AXL

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #925 on: October 23, 2021, 06:45:44 pm »
Hey everyone! It's been a while since I last posted in this thread, but I was working on a schematic/PCB for my version of the GPSDO and got sidetracked with life, the pandemic, etc.

Anyway, I'm hoping to finally get my boards sent off to the fab, but I'd love for the community here to take one more look at my schematic & board to make sure nothing looks majorly out of place. I'll be using the Bliley NV47M OCXO since I have a couple used ones on hand. Had to make a decent amount of changes to account for the current chip shortage, but everything should be in stock with this version and the total comes into around $60 which is fantastic for a GPSDO in my book.





Let me know what you think! Made some definite compromises, went for a single 5V regulator instead of dual analog/digital 5V rails, could maybe use some more filtering, but eh. I'm not going for a precision lab instrument or timenutz street cred. I just want a cheap GPSDO for aligning some radios.
 

Offline AndrewBCN

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #926 on: October 23, 2021, 07:41:50 pm »
Hey everyone! It's been a while since I last posted in this thread, but I was working on a schematic/PCB for my version of the GPSDO and got sidetracked with life, the pandemic, etc.

Anyway, I'm hoping to finally get my boards sent off to the fab, but I'd love for the community here to take one more look at my schematic & board to make sure nothing looks majorly out of place.
...

Hi Axel, and first: thank you. A question: it seems you are connecting the MCU serial port to the GPS module, unlike Lars' original schematic. But there is no provision in Lars' original code to communicate with the GPS, or to indicate a status on any of the extra LEDs you have included. Do you have an extended version of the Lars' GPSDO firmware to go with your schematic?

Two more little details: OSC_CTRL from the DAC is drawn as an input but it is really an output, ditto for the LEDs and the MCU UART Tx; and the RST(inverted) bus is not connected to anything (as far as I can tell).

The PCB looks very well laid out, with just one little detail that I would change if possible: TP1 (GPS PPS) would be under the GPS module if the module is mounted horizontally, can it be moved someplace else?
 
The following users thanked this post: W3AXL

Offline W3AXL

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #927 on: October 23, 2021, 09:58:41 pm »
Hey everyone! It's been a while since I last posted in this thread, but I was working on a schematic/PCB for my version of the GPSDO and got sidetracked with life, the pandemic, etc.

Anyway, I'm hoping to finally get my boards sent off to the fab, but I'd love for the community here to take one more look at my schematic & board to make sure nothing looks majorly out of place.
...

Hi Axel, and first: thank you. A question: it seems you are connecting the MCU serial port to the GPS module, unlike Lars' original schematic. But there is no provision in Lars' original code to communicate with the GPS, or to indicate a status on any of the extra LEDs you have included. Do you have an extended version of the Lars' GPSDO firmware to go with your schematic?

Two more little details: OSC_CTRL from the DAC is drawn as an input but it is really an output, ditto for the LEDs and the MCU UART Tx; and the RST(inverted) bus is not connected to anything (as far as I can tell).

The PCB looks very well laid out, with just one little detail that I would change if possible: TP1 (GPS PPS) would be under the GPS module if the module is mounted horizontally, can it be moved someplace else?

Expanded firmware is something I'm planning on doing. Hoping to allow for some kind of passthrough from the GPS module through the 32u4's USB serial port. And adding in the status LEDs as well. Of course, I could also just break out the RX/TX lines of the GPS if needed down the road.

Good call on the PPS test point. Super easy to move so I'll do that.

As far as the flag direction, that's just the default KiCad flag. It doesn't differentiate between an input and an output. Just a minor schematic detail. But thanks for mentioning it.

EDIT

Alright, boards and parts have been ordered. This is right about the time someone replies and points out a glaring error in my design  :P
« Last Edit: October 23, 2021, 11:38:26 pm by axel »
 

Offline MIS42N

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: au
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #928 on: October 24, 2021, 10:13:16 pm »
Had to make a decent amount of changes to account for the current chip shortage, but everything should be in stock with this version and the total comes into around $60 which is fantastic for a GPSDO in my book.
:
:
I just want a cheap GPSDO for aligning some radios.
When you say total $60 is that GPS antenna, GPS module, OCXO, populated PCB, power supply, suitable enclosure? I costed out my GPSDO design (which BTW decodes all NMEA and can do NMEA passthru) for an OCXO and populated PCB at less than $12US. But once you add GPS antenna $12, GPS module $6, enclosure $4, wall wart (will work off a $5 USB charger so say $5 although usually there's a better spare one somewhere) and serial/USB converter the total blows out to nearer $40.
 

Offline W3AXL

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #929 on: October 25, 2021, 06:11:59 pm »
Had to make a decent amount of changes to account for the current chip shortage, but everything should be in stock with this version and the total comes into around $60 which is fantastic for a GPSDO in my book.
:
:
I just want a cheap GPSDO for aligning some radios.
When you say total $60 is that GPS antenna, GPS module, OCXO, populated PCB, power supply, suitable enclosure? I costed out my GPSDO design (which BTW decodes all NMEA and can do NMEA passthru) for an OCXO and populated PCB at less than $12US. But once you add GPS antenna $12, GPS module $6, enclosure $4, wall wart (will work off a $5 USB charger so say $5 although usually there's a better spare one somewhere) and serial/USB converter the total blows out to nearer $40.

BOM cost (minus OCXO and enclosure): $42 + $5 shipping
PCB: $25/5 from JLCPCB so $5/ea
OCXO (Bliley NV47 series): $30/3 = $10/ea
Enclosure (Hammond 1455K1201): $15

So for a complete GPSDO minus antenna and power supply (I already have both on-hand) it comes out to a little under $80. I had already bought the OCXOs and the enclosure so my goal was to get PCB + parts under $60, and I did.

 

Offline W3AXL

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #930 on: November 03, 2021, 05:00:48 am »
I'm surprised nobody pointed out that my amplifier design for the 10MHz output was totally incorrect :) oh well - I bodged it into a unity gain buffer and all is well.

I've got the board assembled and it's up and running. Next plan is writing up the software. Is there a "recommended" arduino sketch for the GPSDO, or is everyone pretty much rolling their own based on the original document?
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #931 on: November 03, 2021, 05:24:14 am »
I'm surprised nobody pointed out that my amplifier design for the 10MHz output was totally incorrect :) oh well - I bodged it into a unity gain buffer and all is well.

I've got the board assembled and it's up and running. Next plan is writing up the software. Is there a "recommended" arduino sketch for the GPSDO, or is everyone pretty much rolling their own based on the original document?

I think most are starting with the "original code" from Lars first post.
He had to name the upload extension .ino.txt , to get the forum to accept it.

/Bingo
 

Offline AndrewBCN

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #932 on: November 03, 2021, 11:11:59 am »
I'm surprised nobody pointed out that my amplifier design for the 10MHz output was totally incorrect :) oh well - I bodged it into a unity gain buffer and all is well.

I've got the board assembled and it's up and running. Next plan is writing up the software. Is there a "recommended" arduino sketch for the GPSDO, or is everyone pretty much rolling their own based on the original document?

Check out Lars' first post in this thread, it has his original Arduino sketch attached. Or you can check the GitHub repository I created for Lars' files, here: https://github.com/AndrewBCN/Lars-DIY-GPSDO

I would be grateful if you would fork this GitHub repository and add your files to your fork, then make a pull request for all your work. You can also change the README file which I wrote, to include as much information as you want about your work.

Finally: I got started on editing Lars' Arduino sketch for improved formatting and comments (essentially no changes to the code itself), if you want I can send it to you in a PM.

On a side note: I was shipped a bunch of fake LM35DZ temperature sensors from a vendor on AliExpress; they are just NPN transistors. I opened a dispute and was promptly refunded.
« Last Edit: November 03, 2021, 02:49:28 pm by AndrewBCN »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #933 on: November 03, 2021, 06:02:41 pm »
The software in Lars first post is not bound to GPL v3.
Could be used as ie. lgpl or the like

/Bingo
 

Offline AndrewBCN

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #934 on: November 03, 2021, 06:32:56 pm »
The software in Lars first post is not bound to GPL v3.
Could be used as ie. lgpl or the like

/Bingo

Lars did not specify any open source license for any part of his work before he passed away, and very modestly did not even reserve any copyrights. I had to assume his wish was to make all parts of his GPSDO design, including the firmware, available to any other person without any restrictions apart from retaining the "openness" and the fact that he is the original author, as the name of the project clearly indicates ("Lars' DIY GPSDO"). Hence the choice of the GPLV3 license for the files on GitHub. I believe this respects most closely the spirit with which Lars posted the project files here on the EEVblog forum.

The LGPL is a different license primarily used for software libraries. It's not really suitable for a project such as Lars' DIY GPSDO.

Btw now that Lars' files are on GitHub under a GPL V3 license and under his copyright, I would question the ethics of anybody claiming the copyrights of the same or modified files or any change in the applicable open source license (in other words, changing from GPL V3 to any other license).

If anybody here is in doubt about what all this means or wants to know the nitty-gritty, please check: https://opensource.org/licenses
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #935 on: November 03, 2021, 06:51:15 pm »
Btw now that Lars' files are on GitHub under a GPL V3 license and under his copyright, I would question the ethics of anybody claiming the copyrights of the same or modified files or any change in the applicable open source license (in other words, changing from GPL V3 to any other license).

Nobody would be claiming anything, they're just not bound to adhere to your gpl v3 license invention , if using Lars original sources.
I have downloaded & used that software back when Lars posted it here, and have been using it long before you made that repos.
Must be a bit like prior art.

And while i agree that Lars meant it should be usable for all as in free to the public, I can't see anywhere where it even suggests it should be GPL.
It could just as easy have been a beerware , MIT , apache or BSD license, and that has nothing to do with ethics.

/Bingo
« Last Edit: November 03, 2021, 06:57:07 pm by bingo600 »
 

Offline W3AXL

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #936 on: November 03, 2021, 07:59:38 pm »
Got my GPSDO board assembled, and it's up and running. For the most part at least. OCXO is alive, the MCU is programmable via USB, and nothing has let the smoke out yet.

However, it looks like the 32u4 with the Pro Micro bootloader doesn't like the interrupt that Lars used for the PPS signal. His original arduino code hangs after startup waiting for the PPS to trigger, but it never fires despite having a good PPS signal. I'll have to look into why that is. I'm guessing there's some annoying conflict with that interrupt and the USB bootloader causing things to go wrong.

Days like this I wish I knew more about embedded programming.
 

Offline thinkfat

  • Supporter
  • ****
  • Posts: 2152
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #937 on: November 03, 2021, 08:16:09 pm »
The software in Lars first post is not bound to GPL v3.
Could be used as ie. lgpl or the like

/Bingo

Lars did not specify any open source license for any part of his work before he passed away, and very modestly did not even reserve any copyrights. I had to assume his wish was to make all parts of his GPSDO design, including the firmware, available to any other person without any restrictions apart from retaining the "openness" and the fact that he is the original author, as the name of the project clearly indicates ("Lars' DIY GPSDO"). Hence the choice of the GPLV3 license for the files on GitHub. I believe this respects most closely the spirit with which Lars posted the project files here on the EEVblog forum.

The LGPL is a different license primarily used for software libraries. It's not really suitable for a project such as Lars' DIY GPSDO.

Btw now that Lars' files are on GitHub under a GPL V3 license and under his copyright, I would question the ethics of anybody claiming the copyrights of the same or modified files or any change in the applicable open source license (in other words, changing from GPL V3 to any other license).

If anybody here is in doubt about what all this means or wants to know the nitty-gritty, please check: https://opensource.org/licenses

The nitty-gritty is that Lars didn't specify a license, and if his action of posting it on this website isn't considered a release into the public domain, then factually his next-of-kin now own the copyright. I would not dare making any assumptions on his intentions. I consider the GPLv3 very restrictive and demanding. Knowing nothing about what the original author intended, this is not the license I'd have chosen.
Everybody likes gadgets. Until they try to make them.
 
The following users thanked this post: bingo600, Jacon

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #938 on: November 03, 2021, 08:16:50 pm »
MEGA32U4

DS. pg. 79
Uses Pin D4 (avr pin) for Timer1 ICP (Input capture)  - M328 uses PB0 (Avr pin)
ICP1/ADC8 – Port D, Bit 4
ICP1 – Input Capture Pin 1: The PD4 pin can act as an input capture pin for Timer/Counter1.

/Bingo
 
The following users thanked this post: W3AXL

Offline AndrewBCN

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #939 on: November 03, 2021, 08:30:48 pm »
Nobody would be claiming anything, they're just not bound to adhere to your gpl v3 license invention , if using Lars original sources.
....
/Bingo
Seems like I have to dot the i's and cross the t's in this matter.

As we all know, unfortunately Lars passed away before he could choose and specify any license for his project, and as I mentioned, he did not even reserve the copyright for his work. From a licensing and copyrights point of view, his work was in a sort of limbo until now.

For the record, at the end of September (around a month ago) I announced here in this thread that I was creating a repository on GitHub for Lars' project, that I was reserving the copyright over the files in the repository in Lars' name and that I was choosing the GPL V3 (GitHub asks you to choose a license for any repository created there). I asked for comments at the time.

Now you are objecting to that choice? A little bit late, isn't it?

You seem to not understand (or not want to understand) that an Open Source license is there to protect YOUR freedom as well as the freedom of every single EEVblog forum member. What would happen if somebody in this thread or elsewhere claimed the copyright over Lars' work for himself, and/or decided to change the license to a restrictive one, with royalties and fines?

So yes, it is very much a question of ethics, and I believe I made the ethically correct decisions to protect Lars' work, to respect his wishes, and to protect everyone's freedom to use his design and source code with the very few and very reasonable restrictions that are spelled out in the GPL V3, which you can read here: https://www.gnu.org/licenses/gpl-3.0.en.html

I consider the GPLv3 very restrictive and demanding. Knowing nothing about what the original author intended, this is not the license I'd have chosen.

That's your personal opinion, and you are fully entitled to it, and of course you are free to choose whatever license you want for your own projects or not even specify any. That is, of course, if you have developed and published any projects at all.

Now let's be clear: there are literally millions of software projects licensed under the GPL V3, and in fact it is the 4th most popular software license worldwide (the older GPL V2 is the second most used).

A few examples:

1. The Arduino IDE, which Lars used, is licensed under the GPL.
2. The gcc toolchain, which is used by the Arduino IDE and hence which was used by Lars, is licensed under the GPL.

I must say I am rather shocked that some of you who have been following this project since the early days when Lars was still alive, have never bothered to check with him what license he was willing to apply to his design and code. Or even after he passed away, have never bothered to clarify this matter with his family and friends.

And now, one month after I asked for comments, you are objecting to the choice of the perfectly adequate GPL V3, which apparently you have not even bothered to read?  :--







« Last Edit: November 03, 2021, 08:56:36 pm by AndrewBCN »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #940 on: November 03, 2021, 08:45:37 pm »
Seems like someone already made a github repos 10+ month ago , and made his version of Lars GPSDO licenced with MIT.
https://github.com/paulvee/Lars-GPSDO

So why should your GPLV3 be the chosen one.
paul's repos came before you, and he made a lot of experiments with Lars code.

I do agree that paul didn't publish Lars unmodified sources in his name, but just because you put Lars files on github,
does not give you the right to chose what license Lars original files belongs to.

What would happen if somebody in this thread or elsewhere claimed the copyright over Lars' work for himself, and/or decided to change the license to a restrictive one, with royalties and fines?

You just did

/Bingo




« Last Edit: November 03, 2021, 08:47:40 pm by bingo600 »
 

Offline AndrewBCN

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #941 on: November 03, 2021, 09:12:53 pm »
You just did

NO.

More than one month ago, I created a repository on GitHub for Lars' files, after consulting with the person that was closest to him and to his family that I could get a hold of. Lars' work was in license limbo and I chose the latest version of the same license that the tools he used to create his project are under, as a license for his work. I asked for comments on this thread and as the records show, you did not object at the time. In fact nobody objected in any way.

Had you or anybody objected at the time we could have had a sensible discussion over the finer points of various open source licenses. But now I just feel nauseated having to discuss this with you.
 

Offline AndrewBCN

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #942 on: November 03, 2021, 09:30:56 pm »
Regarding the MIT license, and an important difference compared to the GPL V3 license:

"The MIT License is short and to the point. It lets people do almost anything they want with your project, like making and distributing closed source versions."

I don't think Lars would want to see people making and distributing closed source ("black box") versions of his project.

So GPL V3 it is. And why V3 and not V2? Because V3 is the latest version of the GPL.
 

Offline AndrewBCN

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #943 on: November 03, 2021, 09:46:22 pm »
Got my GPSDO board assembled, and it's up and running. For the most part at least. OCXO is alive, the MCU is programmable via USB, and nothing has let the smoke out yet.
However, it looks like the 32u4 with the Pro Micro bootloader doesn't like the interrupt that Lars used for the PPS signal.
...

Sorry for not noticing this before, but apparently the 32u4 alternate function pin assignments are very different from those of the 328. So not only the PPS has to be input on a different pin, but also the 5MHz (the OCXO 10MHz divided by 2 by the 74HC390). And you'll probably have to change some of the pins you are using to drive the LEDs too.
No smoke, but a few traces to cut and a few wires to solder here and there, and a few lines of code to edit. You should get it working in a couple of hours!  :-+
 

Offline W3AXL

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #944 on: November 04, 2021, 12:36:15 am »
Let he who has made a perfect board in one attempt cast the first stone



Looks like things are working! Log prints are running, I ran through a basic calibration with Lars' guide, and my diff_ns is slowly approaching 0. We'll see if the thing actually locks properly. Fingers crossed!

Is there a guide or a link to a post in this thread with instructions on how to set up Timelab for monitoring the various parameters? I'm still reading to learn exactly what ADEV and MDEV are, but Lars had nice plots of them in Timelab and I have no clue what I'm doing on that front. Found the handy appendix in Lars' documentation. It helps to read. :)

Looks like I need to do some more calibration. Still haven't gotten a lock after 10 minutes, and my diff_ns value has been going from -30 to +30, with occasional jumps to -160 or so.
« Last Edit: November 04, 2021, 12:56:43 am by axel »
 

Offline W3AXL

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #945 on: November 04, 2021, 01:16:06 am »
Here's where I'm at after 45 minutes

Code: [Select]
3248 -431 41681 6.3 NoLock 6 360 32 1 28109 56 1103 0 0 0
3249 -427 41680 6.3 NoLock 4 400 32 1 28109 59 1104 0 0 0
3250 -422 41681 6.3 NoLock 5 460 32 1 28109 63 1105 0 0 0
3251 -418 41682 6.3 NoLock 4 510 32 1 28109 65 1106 0 0 0
3252 -413 41682 6.3 NoLock 4 560 32 1 28109 69 1107 0 0 0
3253 -407 41684 6.3 NoLock 6 630 32 1 28110 74 1108 0 0 0
3254 -404 41684 6.3 NoLock 4 670 32 1 28110 78 1109 0 0 0
3255 -399 41684 6.3 NoLock 4 720 32 1 28110 80 1110 0 0 0
3256 -395 41684 6.3 NoLock 4 770 32 1 28110 83 1111 0 0 0
3257 -390 41686 6.3 NoLock 5 830 32 1 28110 88 1112 0 0 0
3258 -387 41685 6.3 NoLock 3 860 32 1 28110 90 1113 0 0 0
3259 -382 41685 6.3 NoLock 4 910 32 1 28110 93 1114 0 0 0
3260 -375 41688 6.3 NoLock 7 990 32 1 28110 98 1115 0 0 0
3261 -373 41688 6.3 NoLock 3 1020 32 1 28111 101 1116 0 0 0
3262 -368 41688 6.3 NoLock 4 1070 32 1 28111 104 1117 0 0 0
3263 -364 41689 6.3 NoLock 4 1120 32 1 28111 107 1118 0 0 0
3264 -360 41689 6.4 NoLock 4 1160 32 1 28111 110 1119 0 0 0
3265 -355 41691 6.4 NoLock 5 1220 32 1 28111 114 1120 0 0 0
3266 -351 41691 6.4 NoLock 4 1260 32 1 28111 117 1121 0 0 0
3267 -347 41692 6.3 NoLock 4 1310 32 1 28111 120 1122 0 0 0
3268 -343 41692 6.4 NoLock 4 1350 32 1 28111 123 1123 0 0 0
3269 -339 41693 6.3 NoLock 4 1400 32 1 28111 127 1124 0 0 0
3270 -334 41694 6.3 NoLock 4 1450 32 1 28112 129 1125 0 0 0
3271 -331 41694 6.4 NoLock 4 1490 32 1 28112 133 1126 0 0 0
3272 -326 41695 6.3 NoLock 4 1540 32 1 28112 136 1127 0 0 0
3273 -322 41697 6.3 NoLock 5 1590 32 1 28112 138 1128 0 0 0
3274 -319 41696 6.4 NoLock 3 1620 32 1 28112 142 1129 0 0 0
3275 -314 41698 6.3 NoLock 5 1680 32 1 28112 146 1130 0 0 0
3276 -310 41699 6.3 NoLock 4 1720 32 1 28112 149 1131 0 0 0
3277 -306 41699 6.3 NoLock 4 1760 32 1 28112 151 1132 0 0 0
3278 -304 41699 6.3 NoLock 3 1790 32 1 28113 154 1133 0 0 0
3279 -298 41701 6.3 NoLock 5 1850 32 1 28113 159 1134 0 0 0

Here were my calculations for the gain I ended up with using the Bliley OCXO:

Code: [Select]
h1 diff_ns: 1550 ppb average
h65535 diff_ns: -990 ppb average

VCO Range (ppb) = 2540 ppb

Gain = 65535 / VCO Range = 25.80

Two problems I'm running into:
  • The darn thing still won't lock! My diff_ns gets pretty close to zero, but the TIC value stays around -200 to -400 and never gets below +/- 100 ns.
  • For whatever reason my LM35 is reporting a temperature of 6.3C which is absolutely not correct. I set the temperature mode to j1 which should be LM35 mode.
« Last Edit: November 04, 2021, 01:22:29 am by axel »
 

Offline AndrewBCN

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #946 on: November 04, 2021, 01:34:41 am »
Read the voltage output by the LM35 with a multimeter, it should be 10mV x ambient temperature. If the voltage is correct, then check that the firmware is reading the correct analog channel, and what is the ADC value.
 

Offline W3AXL

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #947 on: November 04, 2021, 01:36:14 am »
Figured the LM35 part out at least. INTERNAL reference on the 32u4 is 2.56V instead of 1.1V, so I'll have to go into the code and change the reference voltage. At least that was a simple fix. Perhaps the invalid temperature was also causing issues with the main TIC loop?

EDIT

Interestingly it appears on the 32u4 that the analogReference() function does nothing. The raw ADC reading is still referenced to 5V instead of the expected internal 2.56V. Will have to figure out why that is.

EDIT 2

It's because I have an external AREF connected. Whoops. Hopefully I didn't kill the internal VREF by doing that. Either way I'm stuck with the external AREF since the trace for that runs under the MCU. No cutting that one without lifting the proc, which I can't do. |O

More investigation needed to figure out why my GPSDO still won't lock!
« Last Edit: November 04, 2021, 01:50:39 am by axel »
 

Offline AndrewBCN

  • Frequent Contributor
  • **
  • Posts: 571
  • Country: fr
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #948 on: November 04, 2021, 01:54:57 am »
Yes, for the 32u4 you have to use INTERNAL1V1 instead of INTERNAL. That will also affect the TIC readings, obviously.

https://www.arduino.cc/reference/en/language/functions/analog-io/analogreference/

Also you have your LM35 connected to ADC5, the 32u4 does not have an ADC2 input pin, so you also have to change that in Lars' code.

EDIT: AFAIK you don't need to cut the trace from 5V to AREF, just set the reference voltage to INTERNAL1V1.
« Last Edit: November 04, 2021, 02:00:54 am by AndrewBCN »
 

Offline W3AXL

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #949 on: November 04, 2021, 02:28:05 am »
Unfortunately not so.

From page 313 of the 32u4 datasheet:
Quote
The internal voltage reference options may not be used if an external reference voltage is being applied to the AREF pin.

So I'm stuck with my ~5.2V supply for this board revision. Definitely going to have a new revision in the works.

Still looking for suggestions on how to get this darn thing to lock in the first place. I'm still seeing the TIC value hovering around -300 to -400. On this last boot it started up at 650 or so and worked its way down. I'm now about 40 minutes or so into this cycle and still no closer to a lock.

Code: [Select]
2111 -405 42168 29.6 NoLock 2 660 32 1 24262 80 10 0 0 0.0
2112 -405 42164 29.6 NoLock 0 660 32 1 24262 79 11 0 0 0.0
2113 -403 42162 29.6 NoLock 2 680 32 1 24262 81 12 0 0 0.0
2114 -402 42159 29.6 NoLock 1 690 32 1 24262 81 13 0 0 0.0
2115 -400 42157 29.1 NoLock 2 710 32 1 24262 83 14 0 0 0.0
2116 -400 42154 29.6 NoLock 0 710 32 1 24262 83 15 0 0 0.0
2117 -399 42151 29.6 NoLock 1 720 32 1 24262 83 16 0 0 0.0
2118 -398 42149 29.6 NoLock 2 740 32 1 24262 85 17 0 0 0.0
2119 -396 42147 29.6 NoLock 2 760 32 1 24262 85 18 0 0 0.0
2120 -394 42145 29.6 NoLock 2 780 32 1 24262 87 19 0 0 0.0
2121 -395 42141 29.1 NoLock -1 770 32 1 24262 87 20 0 0 0.0
2122 -393 42139 29.6 NoLock 2 790 32 1 24262 88 21 0 0 0.0
2123 -393 42135 29.6 NoLock 0 790 32 1 24262 89 22 0 0 0.0
2124 -391 42133 29.6 NoLock 2 810 32 1 24262 89 23 0 0 0.0
2125 -391 42130 29.1 NoLock 0 810 32 1 24262 90 24 0 0 0.0
2126 -390 42128 29.6 NoLock 2 830 32 1 24262 90 25 0 0 0.0

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf